Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package phoronix-test-suite for
openSUSE:Factory checked in at 2021-03-03 18:34:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/phoronix-test-suite (Old)
and /work/SRC/openSUSE:Factory/.phoronix-test-suite.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "phoronix-test-suite"
Wed Mar 3 18:34:57 2021 rev:10 rq:876401 version:10.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/phoronix-test-suite/phoronix-test-suite.changes
2020-06-25 15:07:35.609394644 +0200
+++
/work/SRC/openSUSE:Factory/.phoronix-test-suite.new.2378/phoronix-test-suite.changes
2021-03-03 18:34:57.815381518 +0100
@@ -1,0 +2,9 @@
+Fri Feb 26 08:25:53 UTC 2021 - [email protected]
+
+- version update to 10.2.2
+ * For detailed list of changes see ChangeLog
+- added patches [bsc#1175508] (internal)
+ fix https://github.com/phoronix-test-suite/phoronix-test-suite/issues/505
+ + phoronix-test-suite-phoronix-test-suite-9703b4b.patch
+
+-------------------------------------------------------------------
Old:
----
phoronix-test-suite-9.6.0.tar.gz
New:
----
phoronix-test-suite-10.2.2.tar.gz
phoronix-test-suite-9703b4b.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ phoronix-test-suite.spec ++++++
--- /var/tmp/diff_new_pack.zRvfgY/_old 2021-03-03 18:34:58.343381901 +0100
+++ /var/tmp/diff_new_pack.zRvfgY/_new 2021-03-03 18:34:58.343381901 +0100
@@ -1,7 +1,7 @@
#
# spec file for package phoronix-test-suite
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,15 @@
Name: phoronix-test-suite
-Version: 9.6.0
+Version: 10.2.2
Release: 0
Summary: Comprehensive test and benchmarking platform
License: GPL-3.0-only
Group: System/Benchmark
URL: http://www.phoronix-test-suite.com/
Source0:
https://phoronix-test-suite.com/releases/phoronix-test-suite-%{version}.tar.gz
+# https://github.com/phoronix-test-suite/phoronix-test-suite/issues/505
[bsc#1175508]
+Patch0: phoronix-test-suite-9703b4b.patch
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: shared-mime-info
@@ -56,6 +58,7 @@
%prep
%setup -q -n %{name}
+%patch0 -p1
find ob-cache -type f -name *.sh -exec chmod +x {} \;
%build
@@ -74,7 +77,7 @@
rm
%{buildroot}%{_datadir}/%{name}/pts-core/external-test-dependencies/scripts/install-macports-packages.sh
%pre
-%service_add_pre phoromatic-client.service phoromatic-server.service
+%service_add_pre phoromatic-client.service phoromatic-server.service
phoronix-result-server.service
%post
%if 0%{?suse_version} < 1330
@@ -82,10 +85,10 @@
%icon_theme_cache_post
%mime_database_post
%endif
-%service_add_post phoromatic-client.service phoromatic-server.service
+%service_add_post phoromatic-client.service phoromatic-server.service
phoronix-result-server.service
%preun
-%service_del_preun phoromatic-client.service phoromatic-server.service
+%service_del_preun phoromatic-client.service phoromatic-server.service
phoronix-result-server.service
%postun
%if 0%{?suse_version} < 1330
@@ -93,7 +96,7 @@
%icon_theme_cache_postun
%mime_database_postun
%endif
-%service_del_postun phoromatic-client.service phoromatic-server.service
+%service_del_postun phoromatic-client.service phoromatic-server.service
phoronix-result-server.service
%files
%defattr(-,root,root)
@@ -112,6 +115,7 @@
%{_sbindir}/rcphoromatic-server
%{_unitdir}/phoromatic-client.service
%{_unitdir}/phoromatic-server.service
+%{_unitdir}/phoronix-result-server.service
%{_datadir}/appdata/phoronix-test-suite.appdata.xml
%changelog
++++++ phoronix-test-suite-9.6.0.tar.gz -> phoronix-test-suite-10.2.2.tar.gz
++++++
++++ 77447 lines of diff (skipped)
++++++ phoronix-test-suite-9703b4b.patch ++++++
diff --git a/ChangeLog b/ChangeLog
index 0cb1d1db6b..31609b360f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
PHORONIX TEST SUITE CHANGE-LOG
+Phoronix Test Suite (Git)
+
+pts-core: Optimization to avoid re-parsing test profile definition multiple
times
+pts-core: Optimization to avoid re-parsing installed test metadata multiple
times
+pts-core: Allow longer HTTP timeouts on OpenBenchmarking.org result uploads if
needed
+
Phoronix Test Suite 10.2.2
17 February 2021
diff --git a/install_macos b/install_macos
new file mode 100755
index 0000000000..62dd9e12e5
--- /dev/null
+++ b/install_macos
@@ -0,0 +1,127 @@
+#!/bin/sh
+
+# Phoronix Test Suite
+# URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
+# Copyright (C) 2008 - 2019, Phoronix Media
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Generic Phoronix Test Suite installer
+
+# To install into a chroot, set $DESTDIR to the corresponding directory.
+
+die() {
+ printf '%s\n' "$1" >&2
+ exit "${2:-1}"
+}
+
+if [ "X$1" = "X" ]
+then
+ INSTALL_PREFIX="/usr"
+else
+ INSTALL_PREFIX="$1"
+fi
+
+# Ensure the user is in the correct directory
+if [ ! -f pts-core/phoronix-test-suite.php ]
+then
+ die '
+ To install the Phoronix Test Suite you must first change directories to
phoronix-test-suite/. For support visit: http://www.phoronix-test-suite.com/
+'
+fi
+
+mkdir -p "$DESTDIR$INSTALL_PREFIX"
+if [ ! -w "$DESTDIR$INSTALL_PREFIX" ]
+then
+ die "ERROR: $DESTDIR$INSTALL_PREFIX is not writable. Run this installer
as root or specify a different directory prefix as the first argument sent to
this script."
+fi
+
+rm -rf "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/
+rm -rf "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/bin/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/appdata/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/applications/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/icons/hicolor/48x48/apps/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/man/man1/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/../etc/bash_completion.d/
+#mkdir -p $DESTDIR$INSTALL_PREFIX/../usr/lib/systemd/system/
+#mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
+
+cp ChangeLog "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+cp COPYING "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+cp AUTHORS "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+
+cd documentation/ || exit
+cp -r * "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/
+cd ..
+rm -rf "$DESTDIR$INSTALL_PREFIX"/share/doc/phoronix-test-suite/man-pages/
+
+cp documentation/man-pages/*.1 "$DESTDIR$INSTALL_PREFIX"/share/man/man1/
+cp pts-core/static/bash_completion
"$DESTDIR$INSTALL_PREFIX"/../etc/bash_completion.d/phoronix-test-suite
+cp pts-core/static/images/phoronix-test-suite.png
"$DESTDIR$INSTALL_PREFIX"/share/icons/hicolor/48x48/apps/phoronix-test-suite.png
+cp pts-core/static/phoronix-test-suite.desktop
"$DESTDIR$INSTALL_PREFIX"/share/applications/
+cp pts-core/static/phoronix-test-suite-launcher.desktop
"$DESTDIR$INSTALL_PREFIX"/share/applications/
+cp pts-core/static/phoronix-test-suite.appdata.xml
"$DESTDIR$INSTALL_PREFIX"/share/appdata/
+
+mkdir -p "$DESTDIR$INSTALL_PREFIX"/../usr/lib/systemd/system/
+cp deploy/*-systemd/*.service
"$DESTDIR$INSTALL_PREFIX"/../usr/lib/systemd/system/
+
+# mkdir -p $DESTDIR$INSTALL_PREFIX/../etc/init/
+# cp pts-core/static/upstart/*.conf $DESTDIR$INSTALL_PREFIX/../etc/init/
+
+rm -rf "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core
+cp -r pts-core "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/
+cp -r ob-cache "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/
+cp -r deploy "$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/static/phoronix-test-suite.desktop
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/static/phoronix-test-suite-launcher.desktop
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/openbenchmarking.org/openbenchmarking-mime.xml
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/static/bash_completion
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/static/images/openbenchmarking.png
+rm -f
"$DESTDIR$INSTALL_PREFIX"/share/phoronix-test-suite/pts-core/static/images/%phoronix-test-suite.png
+
+
+sed -e 's:export PTS_DIR=$(actualpath "$(dirname "$0")"):export
PTS_DIR='"$INSTALL_PREFIX"'\/share\/phoronix-test-suite:g'
+chmod +x "$DESTDIR$INSTALL_PREFIX"/bin/phoronix-test-suite
+
+# sed 's:\$url = PTS_PATH . \"documentation\/index.html\";:\$url =
\"'"$INSTALL_PREFIX"'\/share\/doc\/packages\/phoronix-test-suite\/index.html\";:g'
pts-core/commands/gui_gtk.php >
$DESTDIR$INSTALL_PREFIX/share/phoronix-test-suite/pts-core/commands/gui_gtk.php
+
+# XDG MIME OpenBenchmarking support
+if [ "X$DESTDIR" = "X" ] && which xdg-mime >/dev/null && which
xdg-icon-resource >/dev/null
+then
+ #No chroot
+ xdg-mime install pts-core/openbenchmarking.org/openbenchmarking-mime.xml
+ xdg-icon-resource install --context mimetypes --size 64
pts-core/static/images/openbenchmarking.png application-x-openbenchmarking
+else
+ #chroot
+ mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/mime/packages/
+ mkdir -p "$DESTDIR$INSTALL_PREFIX"/share/icons/hicolor/64x64/mimetypes/
+ cp pts-core/openbenchmarking.org/openbenchmarking-mime.xml
"$DESTDIR$INSTALL_PREFIX"/share/mime/packages/
+ cp pts-core/static/images/openbenchmarking.png
"$DESTDIR$INSTALL_PREFIX"/share/icons/hicolor/64x64/mimetypes/application-x-openbenchmarking.png
+
+fi
+
+printf '%b\n' "\nPhoronix Test Suite Installation Completed\n
+Executable File: $INSTALL_PREFIX/bin/phoronix-test-suite
+Documentation: $INSTALL_PREFIX/share/doc/phoronix-test-suite/
+Phoronix Test Suite Files: $INSTALL_PREFIX/share/phoronix-test-suite/\n"
+
+if [ "X$DESTDIR" != "X" ]
+then
+ echo "Installed to chroot: $DESTDIR"
+ echo "Please update your desktop and mime-database manually"
+fi
diff --git a/pts-core/external-test-dependencies/xml/ubuntu-packages.xml
b/pts-core/external-test-dependencies/xml/ubuntu-packages.xml
index 61ae383a07..3ca27b4323 100644
--- a/pts-core/external-test-dependencies/xml/ubuntu-packages.xml
+++ b/pts-core/external-test-dependencies/xml/ubuntu-packages.xml
@@ -218,7 +218,7 @@
<Package>
<GenericName>blas-development</GenericName>
<PackageName>libblas-dev libopenblas-base
libopenblas-dev</PackageName>
-
<FileCheck>/usr/include/x86_64-linux-gnu/openblas_config.h OR
/usr/include/openblas/openblas_config.h</FileCheck>
+
<FileCheck>/usr/include/x86_64-linux-gnu/openblas_config.h OR
/usr/include/aarch64-linux-gnu/openblas_config.h OR
/usr/include/openblas/openblas_config.h</FileCheck>
</Package>
<Package>
<GenericName>lapack-development</GenericName>
@@ -320,7 +320,7 @@
<Package>
<GenericName>opencl</GenericName>
<PackageName>opencl-headers ocl-icd-libopencl1 clinfo
ocl-icd-opencl-dev</PackageName>
- <FileCheck>/usr/lib/x86_64-linux-gnu/libOpenCL.so,
/usr/bin/clinfo</FileCheck>
+ <FileCheck>/usr/lib/x86_64-linux-gnu/libOpenCL.so OR
/usr/lib/aarch64-linux-gnu/libOpenCL.so, /usr/bin/clinfo</FileCheck>
</Package>
<Package>
<GenericName>attr</GenericName>
diff --git a/pts-core/modules/perf_tips.php b/pts-core/modules/perf_tips.php
index 0035911748..2e1355c0bb 100644
--- a/pts-core/modules/perf_tips.php
+++ b/pts-core/modules/perf_tips.php
@@ -4,7 +4,7 @@
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
Copyright (C) 2017, Paolo Valente <[email protected]>
- Copyright (C) 2017 - 2020, Michael Larabel
+ Copyright (C) 2017 - 2021, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -120,7 +120,7 @@ public static function show_perf_tips($test_hardware_types
= false, $interactive
// BELOW ARE CHECKS TO MAKE IF WANTING TO SHOW FOR
'Processor' OR 'System' TESTS
$cpu_scaling_governor = phodevi::read_property('cpu',
'scaling-governor');
- if(stripos($cpu_scaling_governor, 'powersave') !==
false || stripos($cpu_scaling_governor, 'ondemand') !== false)
+ if(phodevi::is_linux() &&
stripos($cpu_scaling_governor, 'performance') === false)
{
$perf_tips[] = new pts_perf_tip_msg('The
powersave CPU scaling governor is currently in use. It\'s possible to obtain
greater performance if using the performance governor.', 'echo performance |
tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor',
'https://openbenchmarking.org/result/1706268-TR-CPUGOVERN32');
}
diff --git a/pts-core/objects/phodevi/sensors/cpu_power.php
b/pts-core/objects/phodevi/sensors/cpu_power.php
index 1929ad12e8..e73ec38982 100644
--- a/pts-core/objects/phodevi/sensors/cpu_power.php
+++ b/pts-core/objects/phodevi/sensors/cpu_power.php
@@ -86,7 +86,7 @@ private function cpu_power_linux()
self::$cpu_power_inputs = array();
foreach(pts_file_io::glob('/sys/class/hwmon/hwmon*/power*_label') as $hwmon)
{
- if(pts_file_io::file_get_contents($hwmon) ==
'CPU power')
+
if(in_array(pts_file_io::file_get_contents($hwmon), array('CPU power', 'IO
power')))
{
$hwmon = str_replace('_label',
'_input', $hwmon);
diff --git a/pts-core/objects/pts_network.php b/pts-core/objects/pts_network.php
index aea445c888..c6fa447b0b 100644
--- a/pts-core/objects/pts_network.php
+++ b/pts-core/objects/pts_network.php
@@ -3,8 +3,8 @@
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
- Copyright (C) 2008 - 2020, Phoronix Media
- Copyright (C) 2008 - 2020, Michael Larabel
+ Copyright (C) 2008 - 2021, Phoronix Media
+ Copyright (C) 2008 - 2021, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ public static function can_reach_phoronix_net()
{
return
pts_network::http_get_contents('http://phoronix.net/PTS') == 'PTS';
}
- public static function http_upload_via_post($url, $to_post_data,
$supports_proxy = true)
+ public static function http_upload_via_post($url, $to_post_data,
$supports_proxy = true, $http_timeout = -1)
{
if(!pts_network::network_support_available())
{
@@ -77,11 +77,11 @@ public static function http_upload_via_post($url,
$to_post_data, $supports_proxy
$http_parameters = array('http' => array('method' => 'POST',
'content' => http_build_query($to_post_data)));
if($supports_proxy)
{
- $stream_context =
pts_network::stream_context_create($http_parameters);
+ $stream_context =
pts_network::stream_context_create($http_parameters, false, false, false,
false, $http_timeout);
}
else
{
- $stream_context =
pts_network::stream_context_create($http_parameters, false, -1, -1);
+ $stream_context =
pts_network::stream_context_create($http_parameters, false, -1, -1, false,
$http_timeout);
}
$opened_url = fopen($url, 'rb', false, $stream_context);
$response = $opened_url ? stream_get_contents($opened_url) :
false;
diff --git a/pts-core/objects/pts_openbenchmarking.php
b/pts-core/objects/pts_openbenchmarking.php
index 5d2f0a75b6..86bed08298 100644
--- a/pts-core/objects/pts_openbenchmarking.php
+++ b/pts-core/objects/pts_openbenchmarking.php
@@ -3,8 +3,8 @@
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
- Copyright (C) 2010 - 2020, Phoronix Media
- Copyright (C) 2010 - 2020, Michael Larabel
+ Copyright (C) 2010 - 2021, Phoronix Media
+ Copyright (C) 2010 - 2021, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -503,7 +503,7 @@ public static function linked_repositories()
return $repos;
}
- public static function make_openbenchmarking_request($request, $post =
array())
+ public static function make_openbenchmarking_request($request, $post =
array(), $http_timeout_override = -1)
{
$url = pts_openbenchmarking::openbenchmarking_host() .
'f/client.php';
$to_post = array_merge(array(
@@ -518,7 +518,7 @@ public static function
make_openbenchmarking_request($request, $post = array())
$to_post = array_merge($to_post, $account);
}
- return pts_network::http_upload_via_post($url, $to_post);
+ return pts_network::http_upload_via_post($url, $to_post, true,
$http_timeout_override);
}
public static function is_repository($repo_name)
{
diff --git a/pts-core/objects/pts_openbenchmarking_upload.php
b/pts-core/objects/pts_openbenchmarking_upload.php
index 1a98ad0a26..c6a9ef1087 100644
--- a/pts-core/objects/pts_openbenchmarking_upload.php
+++ b/pts-core/objects/pts_openbenchmarking_upload.php
@@ -3,8 +3,8 @@
/*
Phoronix Test Suite
URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/
- Copyright (C) 2010 - 2020, Phoronix Media
- Copyright (C) 2010 - 2020, Michael Larabel
+ Copyright (C) 2010 - 2021, Phoronix Media
+ Copyright (C) 2010 - 2021, Michael Larabel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -166,14 +166,15 @@ public static function upload_test_result(&$object,
$return_json_data = false, $
$to_post['display_status'] =
pts_openbenchmarking_client::$client_settings['ResultUploadsDefaultDisplayStatus'];
}
- $json_response =
pts_openbenchmarking::make_openbenchmarking_request('upload_test_result',
$to_post);
+ $result_upload_timeout = 55;
+ $json_response =
pts_openbenchmarking::make_openbenchmarking_request('upload_test_result',
$to_post, $result_upload_timeout);
$json_response = json_decode($json_response, true);
if(!is_array($json_response) && !empty($system_logs))
{
// Sometimes OpenBenchmarking has issues with large
result files, so for now try uploading again with no logs
$to_post['system_logs_zip'] = null;
$to_post['system_logs_hash'] = null;
- $json_response =
pts_openbenchmarking::make_openbenchmarking_request('upload_test_result',
$to_post);
+ $json_response =
pts_openbenchmarking::make_openbenchmarking_request('upload_test_result',
$to_post, $result_upload_timeout);
$json_response = json_decode($json_response, true);
}
diff --git a/pts-core/objects/pts_test_profile.php
b/pts-core/objects/pts_test_profile.php
index b46e449933..b1c5104c47 100644
--- a/pts-core/objects/pts_test_profile.php
+++ b/pts-core/objects/pts_test_profile.php
@@ -23,6 +23,7 @@
class pts_test_profile extends pts_test_profile_parser
{
public $test_installation = false;
+ protected static $test_installation_cache;
public function __construct($identifier = null, $override_values =
null, $normal_init = true)
{
@@ -35,7 +36,12 @@ public function __construct($identifier = null,
$override_values = null, $normal
if($normal_init && PTS_IS_CLIENT && $this->identifier != null)
{
- $this->test_installation = new
pts_installed_test($this);
+ if(!isset(self::$test_installation_cache[$identifier]))
+ {
+ self::$test_installation_cache[$identifier] =
new pts_installed_test($this);
+ }
+
+ $this->test_installation =
&self::$test_installation_cache[$identifier];
}
}
public function validate()
diff --git a/pts-core/objects/pts_test_profile_parser.php
b/pts-core/objects/pts_test_profile_parser.php
index 0dcfa12c91..fa91a83442 100644
--- a/pts-core/objects/pts_test_profile_parser.php
+++ b/pts-core/objects/pts_test_profile_parser.php
@@ -30,9 +30,11 @@ class pts_test_profile_parser
protected $block_test_extension_support = false;
private $file_location = false;
public $no_fallbacks_on_null = false;
+ protected static $xml_file_cache;
public function __construct($read = null, $normal_init = true)
{
+ $original_read = $read;
$this->overrides = array();
$this->tp_extends = null;
@@ -41,8 +43,15 @@ public function __construct($read = null, $normal_init =
true)
$this->identifier = $read;
return;
}
+ if(isset(self::$xml_file_cache[$read]))
+ {
+ // Found in cache so can avoid extra work below...
+ $this->identifier = $read;
+ $this->file_location = $read;
+ $this->xml =
&self::$xml_file_cache[$this->file_location];
+ }
- if(!isset($read[200]) && strpos($read, '<?xml version="1.0"?>')
=== false)
+ if(!isset($read[200]) && strpos($read, '<?xml version="1.0"?>')
=== false && $read != null)
{
if(PTS_IS_CLIENT && (!defined('PTS_TEST_PROFILE_PATH')
|| !is_file(PTS_TEST_PROFILE_PATH . $read . '/test-definition.xml')))
{
@@ -87,10 +96,20 @@ public function __construct($read = null, $normal_init =
true)
$xml_options = LIBXML_COMPACT | LIBXML_PARSEHUGE;
//}
- if(is_file($read))
+ if(isset(self::$xml_file_cache[$read]))
{
$this->file_location = $read;
- $this->xml = simplexml_load_file($read,
'SimpleXMLElement', $xml_options);
+ $this->xml =
&self::$xml_file_cache[$this->file_location];
+ }
+ else if(is_file($read))
+ {
+ $this->file_location = $read;
+ self::$xml_file_cache[$this->file_location] =
simplexml_load_file($read, 'SimpleXMLElement', $xml_options);
+ if($read != $original_read &&
!isset(self::$xml_file_cache[$original_read]))
+ {
+ self::$xml_file_cache[$original_read] =
&self::$xml_file_cache[$this->file_location];
+ }
+ $this->xml =
&self::$xml_file_cache[$this->file_location];
}
else
{