[eluser]mddd[/eluser]
The point here is not about private methods. The point is that the TS wants to run something from the (unix) commandline (maybe through a cron command). But that code must not be callable by someone using the website. So he wants to call something like
Code:
usr/bin/php /my/ci/folder/crons/my-cron
but other people should not be able to go to
Code:
htttp://example.com/crons/my-cron
So the solution is to check for php variables that are different in the case of a direct call as opposed to a call from someone through a (browser) client.
Or, another solution could be to insert some secret word in the call. Like
Code:
usr/bin/php /my/ci/folder/crons/my-cron/mysecretcronpassword
and only allow the code to be executed if that 'password' is in there. But of course, that is not real protection as the script could still be called using
Code:
htttp://example.com/crons/my-cron/mysecretcronpassword