|
CMS Bridges
0.0.0
Multiple CMS platform module and theme development API
|
00001 <?php 00002 // $Id: 279c71e684d1464f4883aacb22e63ac266400915 $ 00020 class cbBase { 00024 private $platform = self::PLATFORM_UNKNOWN; 00025 00035 const PLATFORM_UNKNOWN = false; 00036 const PLATFORM_DRUPAL = 'drupal'; 00037 const PLATFORM_JOOMLA = 'joomla'; 00038 const PLATFORM_WORDPRESS = 'wordpress'; 00045 function __construct() { 00046 $this->platform = $this->_platform(); 00047 if ($this->platform === self::PLATFORM_UNKNOWN) { 00048 die('CMS Bridges cannot determine the platform. Contact the <a href="http://sourceforge.net/projects/cmsbridges">development team</a> giving them information about your platform.'); 00049 } 00050 } 00051 00061 private function _platform() { 00062 $platform = self::PLATFORM_UNKNOWN; 00063 if (defined('DRUPAL_CORE_COMPATIBILITY')) { 00064 $platform = self::PLATFORM_DRUPAL; 00065 } 00066 if (defined('JPATH_BASE')) { 00067 $platform = self::PLATFORM_JOOMLA; 00068 } 00069 if (isset($_GLOBALS['wp_version'])) { 00070 $platform = self::PLATFORM_WORDPRESS; 00071 } 00072 return $platform; 00073 } 00074 00086 public function platform() { 00087 return $this->platform; 00088 } 00089 } 00090 // vim: set et:ts=2:sts=2:bs=2:sw=2:ai:si
1.8.0