Save Output to a TXT file in Joomla and Drupal classes