Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating external scripts with Zend Framework

What is the best way to integrate an external script into the Zend Framework? Let me explain because I may be asking this the wrong way. I have a script that downloads and parses an XML file. This script, which runs as a daily cron job, needs to dump its data into the database.

I am using Zend Framework for the site which uses this script and it seems to me that it would be best to use my subclassed model of Zend_Db_Abstract to do the adding and updating of the database. How does one go about doing this? Does my script go in the library next to the Zend Components (i.e. library/Mine/Xmlparse.php) and thus have access to the various ZF components? Do I simply need to include the correct model files and the Zend DB component in the file itself? What is the best way to handle this sort of integration?

like image 569
rg88 Avatar asked Jan 25 '23 00:01

rg88


1 Answers

Yes, you should put your own classes that maybe inherit Zend Framework classes or add further classes into your own folder next to the Zend Framework folder in library.

When you have Zend_Loader s auto-loading enabled, the class names will automatically map to the class you created, e.g.:

My_Db_Abstract will map to My/Db/Abstract.php .
like image 80
Sebastian Hoitz Avatar answered Jan 29 '23 11:01

Sebastian Hoitz