* -------------------------------------------------------------------- *
* File : functions.php *
* -------------------------------------------------------------------- *
- * Short description : Many non-MySQL functions (also file access) *
+ * Short description : Many non-database functions (also file access) *
* -------------------------------------------------------------------- *
- * Kurzbeschreibung : Viele Nicht-MySQL-Funktionen (auch Dateizugriff) *
+ * Kurzbeschreibung : Viele Nicht-Datenbank-Funktionen *
* -------------------------------------------------------------------- *
* $Revision:: $ *
* $Date:: $ *
} // END - if
// Fix HTML parameter (default is no!)
- if (empty($isHtml)) $isHtml = 'N';
+ if (empty($isHtml)) {
+ $isHtml = 'N';
+ } // END - if
// Debug mode enabled?
if (isDebugModeEnabled()) {
// Generate a password in a specified length or use default password length
function generatePassword ($length = '0') {
// Auto-fix invalid length of zero
- if ($length == '0') $length = getConfig('pass_len');
+ if ($length == '0') $length = getPassLen();
// Initialize array with all allowed chars
$ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
}
// At least 10 numbers shall be secure enought!
- $len = getConfig('code_length');
+ $len = getCodeLength();
if ($len == '0') $len = $length;
if ($len == '0') $len = 10;
// Get data array with years/months/weeks/days/...
$data = createTimeSelections($stamp, '', '', '', true);
$ret = '';
- foreach($data as $k => $v) {
+ foreach ($data as $k => $v) {
if ($v > 0) {
// Value is greater than 0 "eval" data to return string
$ret .= ', ' . $v . ' {--_' . strtoupper($k) . '--}';
$message = str_replace("\r", '', str_replace("\n", '', $message));
// Log this message away
- $fp = fopen(getCachePath() . 'debug.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write logfile debug.log!');
- fwrite($fp, generateDateTime(time(), '4') . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message . "\n");
- fclose($fp);
+ appendLineToFile(getPath() . getCachePath() . 'debug.log', generateDateTime(time(), '4') . '|' . getModule(false) . '|' . basename($funcFile) . '|' . $line . '|' . $message);
} // END - if
}
// Remove both for extension name
$extName = substr($baseFile, strlen($prefix), -4);
- // Is the extension valid and active?
- if (isExtensionNameValid($extName)) {
- // Then add this file
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Extension entry ' . $baseFile . ' added.');
+ // Add file with or without base path
+ if ($addBaseDir === true) {
+ // With base path
$files[] = $fileName;
} else {
- // Add non-extension files as well
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Regular entry ' . $baseFile . ' added.');
- if ($addBaseDir === true) {
- $files[] = $fileName;
- } else {
- $files[] = $baseFile;
- }
+ // No base path
+ $files[] = $baseFile;
}
} else {
// We found .php file but should not search for them, why?
$GLOBALS['cache_instance'] = new CacheSystem();
// Did it work?
- if ($GLOBALS['cache_instance']->getStatus() != 'done') {
+ if ($GLOBALS['cache_instance']->getStatusCode() != 'done') {
// Failed to initialize cache sustem
addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_CANNOT_INITIALIZE--}');
} // END - if