<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Quick way to determine if php is running at the command line</title>
	<atom:link href="http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:39:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Rob</title>
		<link>http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/comment-page-1/#comment-1953</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Fri, 21 May 2010 00:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=1294#comment-1953</guid>
		<description>Jorge: empty() will act in the same way as isset() with regards to indices not being set.
if (empty($_SERVER[&#039;non_existant&#039;])) will not cause an error to be thrown.</description>
		<content:encoded><![CDATA[<p>Jorge: empty() will act in the same way as isset() with regards to indices not being set.<br />
if (empty($_SERVER['non_existant'])) will not cause an error to be thrown.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge</title>
		<link>http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/comment-page-1/#comment-1791</link>
		<dc:creator>Jorge</dc:creator>
		<pubDate>Sat, 03 Apr 2010 17:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=1294#comment-1791</guid>
		<description>$_SERVER[&#039;REMOTE_ADDR&#039;] would throw a warning if it&#039;s not set.  Check to see if it exists before checking it&#039;s value.

Either way, this was helpful, thanks!</description>
		<content:encoded><![CDATA[<p>$_SERVER['REMOTE_ADDR'] would throw a warning if it&#8217;s not set.  Check to see if it exists before checking it&#8217;s value.</p>
<p>Either way, this was helpful, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/comment-page-1/#comment-1302</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 26 Jul 2009 21:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=1294#comment-1302</guid>
		<description>Aren&#039;t you also able to check the count of argc? If called from the command line, it will exist in the $_SERVER superglobal and its count will be at least one (the first item being the name of the file):

$using_cli = (@$_SERVER[&#039;argc&#039;] &gt;= 1);</description>
		<content:encoded><![CDATA[<p>Aren&#8217;t you also able to check the count of argc? If called from the command line, it will exist in the $_SERVER superglobal and its count will be at least one (the first item being the name of the file):</p>
<p>$using_cli = (@$_SERVER['argc'] &gt;= 1);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kureikain</title>
		<link>http://www.codediesel.com/php/quick-way-to-determine-if-php-is-running-at-the-command-line/comment-page-1/#comment-1300</link>
		<dc:creator>kureikain</dc:creator>
		<pubDate>Sat, 25 Jul 2009 18:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=1294#comment-1300</guid>
		<description>Great! Thank you!
But i think we can make it shorter with this command:
return (php_sapi_name() == &#039;cli&#039; &amp;&amp; empty($_SERVER[&#039;REMOTE_ADDR&#039;]))</description>
		<content:encoded><![CDATA[<p>Great! Thank you!<br />
But i think we can make it shorter with this command:<br />
return (php_sapi_name() == &#8216;cli&#8217; &amp;&amp; empty($_SERVER['REMOTE_ADDR']))</p>
]]></content:encoded>
	</item>
</channel>
</rss>

