public static function init_files() { // Don't let the process run multiple times... if (pts_config::$init_process_ran) { return false; } pts_config::$init_process_ran = true; // The main PTS user client config pts_config::user_config_generate(); // Generate the graph config $json_pre = null; if (is_file(PTS_USER_PATH . 'graph-config.json')) { $json_pre = file_get_contents(PTS_USER_PATH . 'graph-config.json'); } else { if (PTS_IS_CLIENT && is_file($t = PTS_CORE_STATIC_PATH . 'graph-config-template-' . phodevi::read_property('system', 'vendor-identifier') . '.json')) { $json_pre = file_get_contents($t); } else { if (is_file(PTS_CORE_STATIC_PATH . 'graph-config-template.json')) { $json_pre = file_get_contents(PTS_CORE_STATIC_PATH . 'graph-config-template.json'); } } } $json_graph = array(); pts_Graph::set_default_graph_values($json_graph); if ($json_pre != null) { $json_pre = json_decode($json_pre, true); if (is_array($json_pre)) { $json_graph = array_merge($json_graph, $json_pre); } } pts_Graph::init_graph_config($json_graph); file_put_contents(PTS_USER_PATH . 'graph-config.json', pts_arrays::json_encode_pretty_string($json_graph)); }
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/>. */ // TODO: performance optimizations... // OpenBenchmarking.org 1107247-LI-MESACOMMI48 is a good large data set test to render to look for speed differences // Other tests: // 1201120-BY-MESA80GAL31 // TODO: elimiante need for some of the pts_* classes called inside here, instead build them in or find other efficient ways of handling... // Setup main config values, should only be needed once since the configuration values should never be over-written within pts_Graph* pts_Graph::init_graph_config(); abstract class pts_Graph { // Graph config protected static $c = array(); // user-configurable data. no pts_Graph* should ever over-write any of this data... should be read-only. protected static $color_cache = array(); protected $d = array(); // the data from the test result / whatever... important data protected $i = array(); // internal data, pts_Graph* can read-write public $svg_dom = null; // TODO: Convert below variables to using $this->[XXX] protected $graph_data = array(); protected $graph_data_raw = array(); protected $graph_data_title = array();