Differences From Artifact [a6a2b8cd25]:

To Artifact [fc1698f7ac]:


878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896

897

898
899
900
901
902
903
904

    static private function compile_store($tpl, $content)
    {
        $path = self::compile_get_path($tpl);

        if (!file_exists(dirname($path)))
        {
            mkdir(dirname($path), 0777, true);
        }

        file_put_contents($path, $content);
        return true;
    }

    static public function compile_clear($tpl)
    {
        $path = self::compile_get_path($tpl);

        if (file_exists($path))

            unlink($path);


        return true;
    }

    protected function getVariable($var)
    {
        if (isset($this->current[$var]))







|











>
|
>







878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906

    static private function compile_store($tpl, $content)
    {
        $path = self::compile_get_path($tpl);

        if (!file_exists(dirname($path)))
        {
            Utils::safe_mkdir(dirname($path), 0777, true);
        }

        file_put_contents($path, $content);
        return true;
    }

    static public function compile_clear($tpl)
    {
        $path = self::compile_get_path($tpl);

        if (file_exists($path))
        {
            Utils::safe_unlink($path);
        }

        return true;
    }

    protected function getVariable($var)
    {
        if (isset($this->current[$var]))
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
    static public function resetSource($template)
    {
        if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!i', $template))
            return false;

        if (file_exists(DATA_ROOT . '/www/squelettes/' . $template))
        {
            return unlink(DATA_ROOT . '/www/squelettes/' . $template);
        }

        return false;
    }

    static public function listSources()
    {
        if (!file_exists(DATA_ROOT . '/www/squelettes'))
        {
            mkdir(DATA_ROOT . '/www/squelettes', 0775, true);
        }

        $sources = [];

        $dir = dir(ROOT . '/www/squelettes-dist');

        while ($file = $dir->read())







|









|







953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
    static public function resetSource($template)
    {
        if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!i', $template))
            return false;

        if (file_exists(DATA_ROOT . '/www/squelettes/' . $template))
        {
            return Utils::safe_unlink(DATA_ROOT . '/www/squelettes/' . $template);
        }

        return false;
    }

    static public function listSources()
    {
        if (!file_exists(DATA_ROOT . '/www/squelettes'))
        {
            Utils::safe_mkdir(DATA_ROOT . '/www/squelettes', 0775, true);
        }

        $sources = [];

        $dir = dir(ROOT . '/www/squelettes-dist');

        while ($file = $dir->read())