Esempio n. 1
0
 /**
  * Returns a list of system information records.
  * 
  * Please note that it is not defined which information is returned; the result
  * should be seen as "informational" to the system operator, not for automated purposes.
  */
 public function getSystemInformation()
 {
     $aData = array();
     $aData[] = new SystemInformationRecord("Doctrine ORM", \Doctrine\ORM\Version::VERSION, "Libraries");
     $aData[] = new SystemInformationRecord("Doctrine DBAL", \Doctrine\DBAL\Version::VERSION, "Libraries");
     $aData[] = new SystemInformationRecord("PHP Version", phpversion(), "System");
     $os = new OperatingSystem();
     $aData[] = new SystemInformationRecord("Operating System Type", $os->getPlatform(), "System");
     $aData[] = new SystemInformationRecord("Operating System Release", $os->getRelease(), "System");
     $aData[] = new SystemInformationRecord("memory_limit", ini_get("memory_limit"), "PHP");
     $aData[] = new SystemInformationRecord("post_max_size", ini_get("post_max_size"), "PHP");
     $aData[] = new SystemInformationRecord("upload_max_filesize", ini_get("upload_max_filesize"), "PHP");
     $aData[] = new SystemInformationRecord("allow_url_fopen", ini_get("allow_url_fopen"), "PHP");
     $aData[] = new SystemInformationRecord("max_execution_time", ini_get("max_execution_time"), "PHP");
     $queryCache = get_class(PartKeepr::getEM()->getConfiguration()->getQueryCacheImpl());
     $metadataCache = get_class(PartKeepr::getEM()->getConfiguration()->getMetadataCacheImpl());
     $aData[] = new SystemInformationRecord("Query Cache Implementation", $queryCache, "PHP");
     $aData[] = new SystemInformationRecord("Metadata Cache Implementation", $metadataCache, "PHP");
     $aData[] = new SystemInformationRecord("PartKeepr Version", PartKeepr::getVersion(), "PartKeepr");
     foreach (Configuration::getOptions() as $key => $value) {
         // Hide passwords
         if ($key == "partkeepr.database.password" || $key == "partkeepr.migration.partdb.password") {
             $value = "<hidden>";
         }
         $aData[] = new SystemInformationRecord($key, $value, "PartKeepr Configuration Information");
     }
     return array("data" => $aData);
 }
Esempio n. 2
0
 /**
  * Checks against the versions at partkeepr.org.
  * 
  * If a newer version was found, create a system notice entry.
  */
 public static function doVersionCheck()
 {
     $data = file_get_contents("http://www.partkeepr.org/versions.json");
     $versions = json_decode($data, true);
     if (PartKeeprVersion::PARTKEEPR_VERSION == "{V_GIT}") {
         return;
     }
     if (substr(PartKeeprVersion::PARTKEEPR_VERSION, 0, 17) == "partkeepr-nightly") {
         return;
     }
     if (version_compare(PartKeepr::getVersion(), $versions[0]["version"], '<')) {
         SystemNoticeManager::getInstance()->createUniqueSystemNotice("PARTKEEPR_VERSION_" . $versions[0]["version"], sprintf(PartKeepr::i18n("New PartKeepr Version %s available"), $versions[0]["version"]), sprintf(PartKeepr::i18n("PartKeepr Version %s changelog:"), $versions[0]["version"]) . "\n\n" . $versions[0]["changelog"]);
     }
 }