| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to get data from other databases? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to get data from other databases?
I plan to install drupal, wordpress, and using different databases for www.buyeyeglasses.net. How to get data from drupal 8, and wordpress 4.8, pls?
tks
__________________
x-cart gold 4.7.12 http://www.prescriptionglasses123.com/ http://www.glassespeople.com http://www.loupesusa.com http://www.eyeglassesclub.com |
|||||||
#2
|
|||||||||
|
|||||||||
Re: How to get data from other databases?
X-Cart 5 uses Doctrine library to work with the database. Although it works with its own tables via the ORM part of the library, you still can execute raw SQL queries over database tables created by other applications - see the documentation on createNativeQuery() method there:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html To get the entity manager that works with the XC5's database, do this: PHP Code:
To work with other databases (created by other web applications) you can create custom "entity managers" - check how X-Cart 5 creates its own entity manager in \XLite\Core\Database::startEntityManager() method.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: How to get data from other databases?
Actually, there is an easier method if you don't need the ORM functions:
http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/index.html Doctrine ORM works on top of Doctrine DBAL, so, in theory, you should be able to use it inside X-Cart 5 code too. However, I never tried this, and can't find examples in the source code of X-Cart 5.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#4
|
|||||||
|
|||||||
Re: How to get data from other databases?
www.buyeyeglasses.net is based on x-cart 4.7.8, not 5
__________________
x-cart gold 4.7.12 http://www.prescriptionglasses123.com/ http://www.glassespeople.com http://www.loupesusa.com http://www.eyeglassesclub.com |
|||||||
#5
|
|||||||||
|
|||||||||
Re: How to get data from other databases?
I don't understand the question then.
In X-Cart 4 there is no the abstract layer on top of MySQL - you work with "raw" SQL queries. How would you access any MySQL database from a custom PHP script? PDO? Do the same inside X-Cart 4 scripts. Or do you face any specific problems with this method?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|