R/zzz.R

.onLoad <- function(libname, pkgname) {
  op <- options()
  op.pack <- list(
    # please keep this list in order. highest to lowest
    # pfs.testedVersions = c("3.0.4", "3.0.3", "2.8.1", "2.7.1"),
    pfs.testedVersions = packageDescription(pkgname)$PfsCompatibility,
    pfs.untestedVersionMessage = "The version of PFS you are connecting to
                                  has not been explicitly tested with this 
                                  package. Proceed with caution.",
    pfs.tested = FALSE
  )
  toset <- !(names(op.pack) %in% names(op))
  if (any(toset)) options(op.pack[toset])
  invisible()
}

.onAttach <- function(libname, pkgname) {
  if ("CoreAPIV2" %in% (.packages())) {
    packageStartupMessage("Please detach CoreAPIV2 from the environment (via detach() or unloadNamespace()).")
  }
}
ajwtech/pfsrsdk documentation built on June 14, 2019, 10:34 a.m.