/** * * @param string $street * @param string $zip * @param string $city * @param string $country * @param string $state * @throws Exception */ public function lookupGeoCodeCached($street, $zip, $city, $country, $state = '') { if (!tx_rnbase_util_Extensions::isLoaded('wec_map')) { throw new Exception('wec_map not loaded'); } return tx_wecmap_cache::lookup($street, $city, $state, $zip, $country); }
function test_logger() { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $minLog = tx_rnbase_configurations::getExtensionCfgValue('devlog', 'minLogLevel'); if ($minLog === FALSE) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertTrue($ret, 'Notice funktioniert nicht.'); } if ($minLog == 1) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertTrue($ret, 'Notice funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isWarningEnabled(); $this->assertTrue($ret, 'Warning funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isFatalEnabled(); $this->assertTrue($ret, 'Fatal funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isInfoEnabled(); $this->assertFalse($ret, 'Info funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isDebugEnabled(); $this->assertFalse($ret, 'Debug funktioniert nicht.'); } if ($minLog == 3) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertFalse($ret, 'Notice funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isWarningEnabled(); $this->assertFalse($ret, 'Warning funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isFatalEnabled(); $this->assertTrue($ret, 'Fatal funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isInfoEnabled(); $this->assertFalse($ret, 'Info funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isDebugEnabled(); $this->assertFalse($ret, 'Debug funktioniert nicht.'); } } }
* (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ tx_rnbase::load('tx_rnbase_util_SimpleMarker'); tx_rnbase::load('tx_rnbase_util_TYPO3'); if (!tx_rnbase_util_TYPO3::isTYPO60OrHigher()) { if (tx_rnbase_util_Extensions::isLoaded('dam')) { require_once tx_rnbase_util_Extensions::extPath('dam') . 'lib/class.tx_dam_db.php'; } } /** * Diese Klasse ist für das Rendern von DAM/FAL-Media Dateien verantwortlich */ class tx_rnbase_util_MediaMarker extends tx_rnbase_util_SimpleMarker { private static $damDb = NULL; /** * @param array $wrappedSubpartArray das HTML-Template * @param array $subpartArray das HTML-Template * @param string $template das HTML-Template * @param Tx_Rnbase_Domain_Model_RecordInterface $item * @param tx_rnbase_util_FormatUtil $formatter der zu verwendente Formatter
/** * @param int $level * @return boolean */ private static function isLogLevel($level) { if (self::$minLog === FALSE) { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $minLog = tx_rnbase_configurations::getExtensionCfgValue('devlog', 'minLogLevel'); self::$minLog = $minLog !== FALSE ? $minLog : -1; } } $isEnabled = $level >= self::$minLog; return $isEnabled; }
/** * Wrapper function for tx_rnbase_util_Extensions::isLoaded() * @param string $_EXTKEY */ public static function isExtLoaded($_EXTKEY) { return tx_rnbase_util_Extensions::isLoaded($_EXTKEY); }
/** * Indiziert eine Datei mit DAM. * * ACHTUNG: wenn die Feld Collation der DB-Felder file_name und file_path * in der tx_dam Tabelle auf *_ci (utf8_general_ci) stehen, * wird bei der Prüfung Gruß-/Kleinschreibung ignoriert, * was bei unix-Systemen zu Fehlern führt! * Die einfache Lösung ist, die Collation der beiden Felder * auf *_bin (utf8_bin) zu setzen! * * @param string $file * @param int $beUserId * @return uid */ public static function indexProcess($file, $beUserId) { if (!tx_rnbase_util_Extensions::isLoaded('dam')) { return 0; } require_once tx_rnbase_util_Extensions::extPath('dam', 'lib/class.tx_dam.php'); $mediaUid = tx_dam::file_isIndexed($file); if (!$mediaUid) { // process file indexing self::initBE4DAM($beUserId); $damData = tx_dam::index_process($file); $mediaUid = $damData[0]['uid']; } return $mediaUid; }
* (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ tx_rnbase::load('tx_rnbase_maps_BaseMap'); tx_rnbase::load('tx_rnbase_util_Extensions'); tx_rnbase::load('tx_rnbase_util_Strings'); if (!tx_rnbase_util_Extensions::isLoaded('wec_map')) { throw new Exception('Extension wec_map must be installed to use GoogleMaps!'); } require_once tx_rnbase_util_Extensions::extPath('wec_map') . 'map_service/google/class.tx_wecmap_map_google.php'; /** * Implementation for GoogleMaps based on extension wec_map. */ class tx_rnbase_maps_google_Map extends tx_rnbase_maps_BaseMap { static $PROVID = 'GOOGLEMAPS'; static $mapTypes = array(); /* @var $map tx_wecmap_map_google */ private $map, $conf, $confId; public function init(tx_rnbase_configurations $conf, $confId) { $this->conf = $conf;
/** * @param int $pageId * * @return void */ protected function deleteDevlogEntriesByPageId($pageId) { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $this->getDatabaseConnection()->doDelete($this->getDevlogTableName(), 'pid = ' . intval($pageId)); } }
/** * @group unit */ public function testDeleteDevlogEntriesByPageId() { if (!tx_rnbase_util_Extensions::isLoaded('devlog')) { self::markTestSkipped('devlog muss installiert sein'); } $dataHandler = $this->getMock('Tx_Mklog_Hooks_DataHandler', array('getDatabaseConnection', 'getDevLogTableName')); $databaseConnection = $this->getMock('Tx_Rnbase_Database_Connection', array('doDelete')); $databaseConnection->expects(self::once())->method('doDelete')->with('devlog_table', 'pid = 123'); $dataHandler->expects(self::once())->method('getDatabaseConnection')->will(self::returnValue($databaseConnection)); $dataHandler->expects(self::once())->method('getDevLogTableName')->will(self::returnValue('devlog_table')); $this->callInaccessibleMethod($dataHandler, 'deleteDevlogEntriesByPageId', 123); }
/** * Load the class file, return the classname or the ux_classname * * This is an extension to t3lib_div::makeInstanceClassName. The advantage * is that it tries to autoload the file. In combination with the shorter * notation it simplyfies the finding of the classname. * * @param string classname * @return string classname or ux_classsname (maybe service classname) * @see tx_div::makeInstance * @see tx_lib_t3Loader * @see tx_lib_pearLoader * @deprecated use makeInstance() with optional parameters for constructor */ public static function makeInstanceClassName($inputName) { $outputName = FALSE; if (!$outputName) { $outputName = self::makeInstanceClassNameT3($inputName); } if (!$outputName && tx_rnbase_util_Extensions::isLoaded('lib')) { require_once tx_rnbase_util_Extensions::extPath('lib') . 'class.tx_lib_pearLoader.php'; $outputName = tx_lib_pearLoader::makeInstanceClassName($inputName); } return $outputName; }