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.

3
  • 1
    why you don't make a new controller for the cron job? Commented Jan 29, 2013 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 example.co.uk/controller Commented Jan 29, 2013 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 Commented Jan 29, 2013 at 15:06

1 Answer 1

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 =)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.