openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 68496b15d48ee4af8091c85bdea77ce8a6b63468
parent f199acbd652165587eef1c7760c78abe86477d40
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 29 Dec 2017 23:23:19 +0100

Ordner mit Hilfsskripten umbenannt, damit der Ordnername sprechender wird.

Diffstat:
dev-helper/create-language.php | 43+++++++++++++++++++++++++++++++++++++++++++
dev-helper/create-output-files.sh | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
dev-helper/language-files-writable.sh | 8++++++++
dev-helper/update-language.php | 31+++++++++++++++++++++++++++++++
script/create-language.php | 43-------------------------------------------
script/create-output-files.sh | 55-------------------------------------------------------
script/language-files-writable.sh | 8--------
script/update-language.php | 31-------------------------------
8 files changed, 137 insertions(+), 137 deletions(-)

diff --git a/dev-helper/create-language.php b/dev-helper/create-language.php @@ -0,0 +1,42 @@ +<?php + +header('Content-Type: text/plain'); + + + +// error_reporting(E_ALL); +// $oldlang = parse_ini_file('../language/es.ini.php'); +// var_dump($oldlang); +// exit; + + + +include('../util/Spyc.class.php'); + +$lang = array(); + +foreach( explode(',','de,en,es,fr,it,ru,cn') as $iso ) +{ + $oldlang = parse_ini_file('../language/'.$iso.'.ini.php'); + //echo "ISO: $iso -Size:".count($oldlang)."\n"; + + foreach( $oldlang as $key=>$value ) + + { + $value = trim($value," '\""); + if (empty($value)) + continue; + + if ( @$lang[$key]['en'] == $value ) + continue; + + $lang[$key][$iso] = $value; + } + +} + +echo Spyc::YAMLDump($lang, false, 0, true); + +// file_put_contents('../language/language.yml',spyc_dump($lang)); + +?>+ \ No newline at end of file diff --git a/dev-helper/create-output-files.sh b/dev-helper/create-output-files.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# -- Only for OpenRat-Developers! -- +# +# Creating a minified/compiled version of CSS/LESS, JS and XML-Template files. +# Sets file permission bits to World-Readable that the CMS is able to write to these files! +# +# Do NOT use this in production environments! +# +# +echo "Start ("as `whoami` ")" +for jsfile in `find themes -name "*.js" -not -name "*.min.js"`; do + jsfile="${jsfile%.*}" + echo "JS found: $jsfile" + if [ ! -f $jsfile.min.js ]; then cp -v $jsfile.js $jsfile.min.js; + fi + chmod a+rw -v $jsfile.min.js; +done + +for jsfile in `find modules/editor/codemirror -name "*.js" -not -name "*.min.js"`; do + jsfile="${jsfile%.*}" + echo "JS found: $jsfile" + if [ ! -f $jsfile.min.js ]; then cp -v $jsfile.js $jsfile.min.js; + fi + chmod a+rw -v $jsfile.min.js; +done + + +for tplfile in `find themes -name "*.src.xml"`; do + + tplfile="${tplfile%.*}" + tplfile="${tplfile%.*}" + echo "Template found: $tplfile" + if [ ! -f $tplfile.out.php ]; then touch -d '2000-01-01' $tplfile.out.php; + fi + chmod a+rw -v $tplfile.out.php +done + +# CSS-Files +for lessfile in `find themes -name "*.less"`; do + lessfile="${lessfile%.*}" + echo "LESS found: $lessfile" + if [ ! -f $lessfile.css ]; then touch -d '2000-01-01' $lessfile.css; + fi + chmod a+rw -v $lessfile.css + if [ ! -f $lessfile.min.css ]; then touch -d '2000-01-01' $lessfile.min.css; + fi + chmod a+rw -v $lessfile.min.css +done + +touch themes/default/production/combined.min.css +chmod a+w themes/default/production/combined.min.css + +touch themes/default/production/combined.min.js +chmod a+w themes/default/production/combined.min.js diff --git a/dev-helper/language-files-writable.sh b/dev-helper/language-files-writable.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +for iso in de en es fr it ru cn; do + + touch ../language/lang-$iso.php + chmod -v a+w ../language/lang-$iso.php +done+ \ No newline at end of file diff --git a/dev-helper/update-language.php b/dev-helper/update-language.php @@ -0,0 +1,30 @@ +<?php + +header('Content-Type: text/plain'); + +include('../modules/util/Spyc.class.php'); + +$lang = Spyc::YAMLLoad('../language/language.yml'); + +foreach( explode(',','de,en,es,fr,it,ru,cn') as $iso ) +{ + $filename = '../language/lang-'.$iso.'.php'; + file_put_contents($filename, "<?php /* DO NOT CHANGE THIS GENERATED FILE */\n"); + foreach( $lang as $key=>$value ) + { + if ( isset($value[$iso] ) ) + $t = $value[$iso]; + else + $t = $value['en']; + $t = str_replace('"','\"',$t); + file_put_contents($filename, "\$lang['$key']=\"$t\";\n",FILE_APPEND); + } + $success = file_put_contents($filename, "?>",FILE_APPEND); + + if($success) + echo "File written: $filename\n"; + else + die("Failed write to $filename\n"); +} + +?>+ \ No newline at end of file diff --git a/script/create-language.php b/script/create-language.php @@ -1,42 +0,0 @@ -<?php - -header('Content-Type: text/plain'); - - - -// error_reporting(E_ALL); -// $oldlang = parse_ini_file('../language/es.ini.php'); -// var_dump($oldlang); -// exit; - - - -include('../util/Spyc.class.php'); - -$lang = array(); - -foreach( explode(',','de,en,es,fr,it,ru,cn') as $iso ) -{ - $oldlang = parse_ini_file('../language/'.$iso.'.ini.php'); - //echo "ISO: $iso -Size:".count($oldlang)."\n"; - - foreach( $oldlang as $key=>$value ) - - { - $value = trim($value," '\""); - if (empty($value)) - continue; - - if ( @$lang[$key]['en'] == $value ) - continue; - - $lang[$key][$iso] = $value; - } - -} - -echo Spyc::YAMLDump($lang, false, 0, true); - -// file_put_contents('../language/language.yml',spyc_dump($lang)); - -?>- \ No newline at end of file diff --git a/script/create-output-files.sh b/script/create-output-files.sh @@ -1,55 +0,0 @@ -#!/bin/bash -# -# -- Only for OpenRat-Developers! -- -# -# Creating a minified/compiled version of CSS/LESS, JS and XML-Template files. -# Sets file permission bits to World-Readable that the CMS is able to write to these files! -# -# Do NOT use this in production environments! -# -# -echo "Start ("as `whoami` ")" -for jsfile in `find themes -name "*.js" -not -name "*.min.js"`; do - jsfile="${jsfile%.*}" - echo "JS found: $jsfile" - if [ ! -f $jsfile.min.js ]; then cp -v $jsfile.js $jsfile.min.js; - fi - chmod a+rw -v $jsfile.min.js; -done - -for jsfile in `find modules/editor/codemirror -name "*.js" -not -name "*.min.js"`; do - jsfile="${jsfile%.*}" - echo "JS found: $jsfile" - if [ ! -f $jsfile.min.js ]; then cp -v $jsfile.js $jsfile.min.js; - fi - chmod a+rw -v $jsfile.min.js; -done - - -for tplfile in `find themes -name "*.src.xml"`; do - - tplfile="${tplfile%.*}" - tplfile="${tplfile%.*}" - echo "Template found: $tplfile" - if [ ! -f $tplfile.out.php ]; then touch -d '2000-01-01' $tplfile.out.php; - fi - chmod a+rw -v $tplfile.out.php -done - -# CSS-Files -for lessfile in `find themes -name "*.less"`; do - lessfile="${lessfile%.*}" - echo "LESS found: $lessfile" - if [ ! -f $lessfile.css ]; then touch -d '2000-01-01' $lessfile.css; - fi - chmod a+rw -v $lessfile.css - if [ ! -f $lessfile.min.css ]; then touch -d '2000-01-01' $lessfile.min.css; - fi - chmod a+rw -v $lessfile.min.css -done - -touch themes/default/production/combined.min.css -chmod a+w themes/default/production/combined.min.css - -touch themes/default/production/combined.min.js -chmod a+w themes/default/production/combined.min.js diff --git a/script/language-files-writable.sh b/script/language-files-writable.sh @@ -1,7 +0,0 @@ -#!/bin/bash - -for iso in de en es fr it ru cn; do - - touch ../language/lang-$iso.php - chmod -v a+w ../language/lang-$iso.php -done- \ No newline at end of file diff --git a/script/update-language.php b/script/update-language.php @@ -1,30 +0,0 @@ -<?php - -header('Content-Type: text/plain'); - -include('../modules/util/Spyc.class.php'); - -$lang = Spyc::YAMLLoad('../language/language.yml'); - -foreach( explode(',','de,en,es,fr,it,ru,cn') as $iso ) -{ - $filename = '../language/lang-'.$iso.'.php'; - file_put_contents($filename, "<?php /* DO NOT CHANGE THIS GENERATED FILE */\n"); - foreach( $lang as $key=>$value ) - { - if ( isset($value[$iso] ) ) - $t = $value[$iso]; - else - $t = $value['en']; - $t = str_replace('"','\"',$t); - file_put_contents($filename, "\$lang['$key']=\"$t\";\n",FILE_APPEND); - } - $success = file_put_contents($filename, "?>",FILE_APPEND); - - if($success) - echo "File written: $filename\n"; - else - die("Failed write to $filename\n"); -} - -?>- \ No newline at end of file