<commit_before><?php

require_once('Controller.php');
require_once('Request.php');

require_once('photos.php');

class HealthController extends Controller
{
    public function __construct( $config )
    {
        parent::__construct( false, $config );
    }
	
    public function get( $request )
    {
        echo 'error';
    }
    
    public function post( $request )
    {
        if( count($request->args) == 1 && is_numeric($request->args[0]) )
        {
            $photoFrameId = $request->args[0];

            $errors = "no";
            if( !empty($request->post) )
            {
                $errors = $request->post;
            }
            
            $item['photo_frame'] = $photoFrameId;
            $item['errors'] = $errors;
            
            $db = getDb();
            $row = $db->health_monitor()->insert( $item );<commit_msg>Health monitor now records the app version<commit_after><?php

require_once('Controller.php');
require_once('Request.php');

require_once('photos.php');

class HealthController extends Controller
{
    public function __construct( $config )
    {
        parent::__construct( false, $config );
    }
	
    public function get( $request )
    {
        echo 'error';
    }
    
    public function post( $request )
    {
        if( count($request->args) == 1 && is_numeric($request->args[0]) && is_numeric($request->params['version']) )
        {
            $photoFrameId = $request->args[0];
			
			$photoFrameVersion = $request->params['version'];

            $errors = "no";
            if( !empty($request->post) )
            {
                $errors = $request->post;
            }
            
            $item['photo_frame'] = $photoFrameId;
			$item['version'] = $photoFrameVersion;
            $item['errors'] = $errors;
            
            $db = getDb();
            $row = $db->health_monitor()->insert( $item );
{'fraction_non_alphanumeric': 0.1525065963060686, 'fraction_numerical': 0.0031662269129287598, 'mean_word_length': 1.9764521193092621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7297926', 'n_tokens_mistral': 549, 'n_tokens_neox': 531, 'n_words': 103}