1

I am new with Zend Framework and I couldn't find an answer anywhere so I would like to ask you.

I have an application ready, all is working well in browser but I would like to run once a day one .php file which will be processing the data and downloading some more from other SQL server. I would like to be able to access all classes/functions, basically everything from my Zend Application.

I know how to set up the CRON, I just don't know what should I put into .php file to get all functions from the project available for me as well as DB connections.

I'm using Zend Framework 1.11.11

Thanks guys, Mirko.

  • 1
    why you don't make a new controller for the cron job? – bitWorking Jan 29 '13 at 14:51
  • Hi Redreggae, thanks for you reply. The problem here is that I don't understand the form of the file. In the past, I always created something.php and put in the beginning require_once('functions.php'); and I had all I needed available. If I didn't make it clear, I will use cron to run a file, for example /var/www/sync.php so I won't call http://www.example.co.uk/controller – Mirko Bucko Jan 29 '13 at 15:01
  • ok you want to run it from command line..look at this post [http://stackoverflow.com/questions/2325338/running-a-zend-framework-action-from-command-line](http://stackoverflow.com/questions/2325338/running-a-zend-framework-action-from-command-line) – bitWorking Jan 29 '13 at 15:06

1 Answers1

0

As i understand, you can include Zend Framework Autoloader, in your standalone file, and after this you can use any Zend Framework Classes.

require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('myOneFile_');

read more here

But it's not cool =)

Andrey Vorobyev
  • 896
  • 1
  • 10
  • 37