file_exists($path)){ $fileNum += 1; $path = preg_replace('/(\.odt|' . $prepend . '\(\d+\)\.odt)$/', $prepend . '(' .$fileNum . ').odt', $path); }; return $path; } public static function getRandomColor(){ $str = dechex(floor(rand(0, 16777215))); return '#' . str_pad($str, 6, "0", STR_PAD_LEFT); } public static function debugLog($message){ self::log($message, \OCP\Util::DEBUG); } public static function warnLog($message){ self::log($message, \OCP\Util::WARN); } public static function errorLog($message){ self::log($message, \OCP\Util::ERROR); } public static function log($message, $level){ \OCP\Util::writeLog(self::APP_ID, $message, $level); } }