<?php

class  Project
{
    public static $projectFile;

    public static function saveProperty($name, $value)
    {
        $content = file_exists(self::$projectFile) ? file_get_contents(self::$projectFile) : '';

        $registry = new JRegistry();
        $registry->loadString($content, 'JSON');
        $registry->set($name, $value);

        file_put_contents(self::$projectFile, $registry->toString());
    }

    public static function getProperty($name)
    {
        $content = file_exists(self::$projectFile) ? file_get_contents(self::$projectFile) : '';

        $registry = new JRegistry();
        $registry->loadString($content, 'JSON');
        return $registry->get($name, '');
    }
}

Project::$projectFile = realpath(dirname(__FILE__)) . '/project.json';