<?php

/**
 * Summary
 *
 * Project: twlProject
 * File: checkForNewTWLFiles.php
 * Created: 3/16/2016 12:15 PM
 *
 * @author Richard Snell <*****@*****.**>
 */
include_once 'includes/globalConfig.php';
TwlFile::setDatabaseCredentials($twlProjectCredentials);
TwlFile::checkForNewFTPFiles();
Example #2
0
 /**
  * @param null|int $fileId The database ID for the time-series to load TwlData Points for.
  *
  * @throws InvalidOperationException If database credentials have not been set.
  */
 public final function loadTwlTimeSeries($fileId = NULL)
 {
     if (is_null(self::$databaseCredentials)) {
         throw new InvalidOperationException('Database credentials must be set at the class level to allow this action to take place.');
     }
     TwlFile::setDatabaseCredentials(self::$databaseCredentials);
     TwlTimeSeries::setDatabaseCredentials(self::$databaseCredentials);
     if (is_null($fileId)) {
         $fileData = TwlFile::getLatestFileData($this->getSiteName());
         $fileId = (int) $fileData['file_id'];
     }
     $timeSeriesId = (int) TwlTimeSeries::findClosestTimeSeries($this->position);
     $this->timeSeries = TwlTimeSeries::loadTimeSeries($fileId, $timeSeriesId);
 }