Check if EE version or CE by code

Since CE 1.7 you have Mage::getEdition() that gives this information:

/**
 * Magento edition constants
 */
const EDITION_COMMUNITY    = 'Community';
const EDITION_ENTERPRISE   = 'Enterprise';
const EDITION_PROFESSIONAL = 'Professional';
const EDITION_GO           = 'Go';

/**
 * Current Magento edition.
 *
 * @var string
 * @static
 */
static private $_currentEdition = self::EDITION_COMMUNITY;



/**
 * Get current Magento edition
 *
 * @static
 * @return string
 */
public static function getEdition()
{
   return self::$_currentEdition;
}