php - Cant make use of classes in files that are called by cron job -


I have some files that are called by cron jobs or ajax call, in any of these files, I use any of the classes can not do.

Example:

  & lt ;? Include Php (dirname (__ FILE__) "/ include.php") .; $ Result = "query result" foreign currency ($ result as line $) {// invoice $ invoice = new invoice; $ Rand = substrate (MD5 (microgram ()), rand (0, 26), 4); $ RAND = '-'. Substr (MD5 (microgram ()), rand (0, 26), 4); $ RAND = '-'. Substr (MD5 (microgram ()), rand (0, 26), 4); $ Invoice name = stratouper ($ rand); }  

is included. PHP is included in all my classes.

is included. Php

  & lt;? Php include_once 'functions / connection.php'; Include_once 'functions / functions Php '; Need_once 'functions / mdf / mdfapp'; $ Square = scanderer ('classes'); $ Length = count ($ square); {Include_once 'classes /' for ($ I = 2; $ i & lt; $ length; $ i ++) $ Classes [$ i]; }  

Normally I will be given an example of the invoice. But when php file is called with cronjobs or AJAX, it is not an example of invoice I have included class files Tried, but it also does not work.

Is this a known object?

************** *************************************************************************** **************************************************************************************************** ****************************************************************************** When I used to use the dirname (__ file __) , but in my code, 1 need to do the directory. dirname (__ file __). "../ include.php" did the trick.

Is this the way to call you included?

I once had a script that I regularly called through the browser and its relative paths were included. However, when it was called through the cron, it did not work. When I changed it physically :)


Comments