From 8d547d0ad5787b0d3cbeedc09d9356b11202076c Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 9 Jun 2008 11:21:11 +0000 Subject: [PATCH] another function for cli scripts git-svn-id: file:///home/shish/svn/shimmie2/trunk@893 7f39781d-f577-437e-ae19-be835c7a54ca --- core/util.inc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/util.inc.php b/core/util.inc.php index e1372eb2..6a625727 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -128,6 +128,14 @@ EOD; } } +function check_cli() { + if(isset($_SERVER['REMOTE_ADDR'])) { + print "This script is to be run from the command line only."; + exit; + } + $_SERVER['REMOTE_ADDR'] = "127.0.0.1"; +} + function get_thumbnail_size($orig_width, $orig_height) { global $config;