This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Plus, README & composer fixes [iet:3785103]
- Loading branch information
Showing
8 changed files
with
71 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,15 @@ | |
/* | ||
http://translate.google.com/#en|fr|Player+controls.+Play.+Pause.+Rewind.+Fast+forward.+Current+time.+Loading.+Loaded.+Seek+bar.+Total+time.+Mute.+Un-mute.+Volume.+Quieter.+Louder.+New+window.+Captions. | ||
*/ | ||
if('cli'!=php_sapi_name()) die(basename(__FILE__).": Must run as cli."); #Security. | ||
|
||
if ('cli'!=php_sapi_name()) { | ||
die(basename(__FILE__).": Must run as cli."); #Security. | ||
} | ||
$xgettext = array( | ||
'mac' => "/Applications/Poedit.app/Contents/MacOS/xgettext", | ||
'win' => "C:/apps/GnuWin32/bin/xgettext.exe", | ||
'win' => "C:/apps/GnuWin32/bin/xgettext.exe", | ||
'win' => "C:/Program Files/Poedit/bin/xgettext.exe", | ||
); | ||
$OS = NULL; | ||
$OS = null; | ||
foreach ($xgettext as $label => $path) { | ||
if (file_exists($path)) { | ||
echo "OK, $label it is!".PHP_EOL; | ||
|
@@ -29,7 +30,7 @@ | |
break; | ||
} | ||
} | ||
$files_from = win_dir(str_replace('.php','', __FILE__).".txt", $quote=FALSE); | ||
$files_from = win_dir(str_replace('.php', '', __FILE__).".txt", $quote = false); | ||
$sys_dir = dirname(dirname(dirname(__FILE__))); | ||
$out_dir = win_dir("$sys_dir/application/language/"); #_templates_/"); | ||
|
||
|
@@ -39,15 +40,15 @@ | |
$domains = array('application/'); | ||
|
||
foreach ($domains as $path) { | ||
$domain = basename($path); | ||
$directory = win_dir("$sys_dir/$path"); | ||
$domain = basename($path); | ||
$directory = win_dir("$sys_dir/$path"); | ||
|
||
$exclude = ".|..|.svn|.po|.DS_Store|cli|about|config|Zend|phpmailer|index.html|- Copy."; | ||
$files = file_array($directory, $directory, $exclude); | ||
$bytes = file_put_contents($files_from, $files); #implode(PHP_EOL, $files)); | ||
$exclude = ".|..|.svn|.po|.DS_Store|cli|about|config|Zend|phpmailer|index.html|- Copy."; | ||
$files = file_array($directory, $directory, $exclude); | ||
$bytes = file_put_contents($files_from, $files); #implode(PHP_EOL, $files)); | ||
|
||
/*@todo --keyword=plural' doesn't work :( --keyword=t:1, plural:1,2 --flag=plural:1:pass-c-format */ | ||
$command = <<<EOF | ||
$command = <<<EOF | ||
"$xgettext" | ||
--default-domain=$domain | ||
--directory=$directory | ||
|
@@ -65,54 +66,58 @@ | |
--debug | ||
EOF; | ||
|
||
if ('win' != $OS) { | ||
# The Windows builds don't have these options :( | ||
$command .= <<<EOF | ||
if ('win' != $OS) { | ||
# The Windows builds don't have these options :( | ||
$command .= <<<EOF | ||
--copyright-holder="2011 The Open University. All rights reserved." | ||
--package-name=ouplayer-$domain | ||
--package-version="1.0" | ||
--msgid-bugs-address="[email protected]" | ||
EOF; | ||
} | ||
} | ||
|
||
$command = str_replace(array("\r","\n"), '', $command); | ||
$command = str_replace(array("\r","\n"), '', $command); | ||
|
||
# A return of '0' is good. | ||
$st = system($command, $return); | ||
$count = count(explode(PHP_EOL, $files)); | ||
echo "Domain: $domain | Files parsed: $count | Status: $return".PHP_EOL; | ||
$st = system($command, $return); | ||
$count = count(explode(PHP_EOL, $files)); | ||
echo "Domain: $domain | Files parsed: $count | Status: $return".PHP_EOL; | ||
} | ||
# Security: truncate file. | ||
#$r = file_put_contents($files_from, ''); | ||
|
||
|
||
function win_dir($input, $quotes=TRUE) { | ||
global $OS; | ||
if ('win'==$OS) { | ||
$quotes = /*($quotes) ? '"' :*/ ''; | ||
return ltrim(str_replace(array('Documents and Settings', "/"), array('DOCUME~1', "\\"), $input), "\\"); | ||
} | ||
return $input; | ||
function win_dir($input, $quotes = true) | ||
{ | ||
global $OS; | ||
if ('win'==$OS) { | ||
$quotes = /*($quotes) ? '"' :*/ ''; | ||
return ltrim(str_replace(array('Documents and Settings', "/"), array('DOCUME~1', "\\"), $input), "\\"); | ||
} | ||
return $input; | ||
} | ||
|
||
// Open a known directory, and proceed to read its contents | ||
function file_array($path, $rel, $exclude = ".|..|.svn|.DS_Store", $recursive = true) { | ||
function file_array($path, $rel, $exclude = ".|..|.svn|.DS_Store", $recursive = true) | ||
{ | ||
$path = rtrim($path, "/") . "/"; | ||
$folder_handle = opendir($path); | ||
$exclude_array = explode("|", strtolower($exclude)); | ||
$result = ''; #array(); | ||
while(false !== ($filename = readdir($folder_handle))) { | ||
if(!in_array(strtolower($filename), $exclude_array)) { | ||
if(is_dir($path . $filename . "/")) { | ||
while (false !== ($filename = readdir($folder_handle))) { | ||
if (!in_array(strtolower($filename), $exclude_array)) { | ||
if (is_dir($path . $filename . "/")) { | ||
// Need to include full "path" or it's an infinite loop | ||
if($recursive) $result .= file_array($path . $filename . "/", $rel, $exclude, true); #[]. | ||
if ($recursive) { | ||
$result .= file_array($path . $filename . "/", $rel, $exclude, true); #[]. | ||
} | ||
} else { | ||
$result .= win_dir(str_replace($rel,'', $path).$filename.PHP_EOL); #[], $path. | ||
$result .= win_dir(str_replace($rel, '', $path).$filename.PHP_EOL); #[], $path. | ||
} | ||
} | ||
} | ||
closedir($folder_handle); | ||
return $result; | ||
} | ||
|
||
#End. | ||
#End. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,14 @@ | |
"minimum-stability": "dev", | ||
"authors": [ | ||
{ "name": "Nick Freear (@nfreear)", "role": "developer" }, | ||
{ "name": "Peter Devine (@peterdevinegmd", "role": "designer", "homepage": "http://devine.co.uk/peter/" } | ||
{ "name": "Peter Devine (@peterdevinegmd)", "role": "designer", "homepage": "http://devine.co.uk/peter/" }, | ||
{ "name": "& many others", "homepage": "https://github.com/IET-OU/open-media-player/blob/2.x/docs/CREDITS.txt" } | ||
], | ||
"support": { | ||
"email": "[email protected]", | ||
"forum": "https://groups.google.com/forum/#!forum/ou-media-player", | ||
"issues": "https://github.com/IET-OU/ouplayer/issues", | ||
"source": "https://github.com/IET-OU/ouplayer" | ||
"forum": "https://groups.google.com/forum/#!forum/open-media-player", | ||
"issues": "https://github.com/IET-OU/open-media-player/issues", | ||
"source": "https://github.com/IET-OU/open-media-player" | ||
}, | ||
"require": { | ||
"php": ">=5.3.3", | ||
|
@@ -50,9 +51,6 @@ | |
"mkdir _data", | ||
"php application/bin/cpn application/config/.env-generic .env" | ||
], | ||
"X--pre-install-cmd": [ | ||
"php application/bin/boot-comp-merge" | ||
], | ||
"post-install-cmd": [ | ||
"php application/bin/cpn application/config embed_config.dist.php embed_config.php", | ||
"php application/bin/cpn application/config oup_site.dist.php oup_site.php", | ||
|
@@ -63,26 +61,23 @@ | |
], | ||
"env-suggest": "Nfreear\\Composer\\Suggest::dotEnvTemplate", | ||
"test": [ | ||
"php index.php build/revision", | ||
"composer validate --no-interaction", | ||
"composer validate --no-interaction --working-dir composer-shared", | ||
"#parallel-lint application/*", | ||
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/core/*" | ||
], | ||
"test-cs": [ | ||
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/*" | ||
], | ||
"test-v": [ | ||
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/views/vle_d*" | ||
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/views/*" | ||
], | ||
"fix-oump": [ | ||
"phpcbf --standard=./phpcs.xml -n -l --encoding=utf-8 --extensions=php application/help*" | ||
] | ||
}, | ||
"config": { | ||
"preferred-install": "source" | ||
}, | ||
"extra": { | ||
"X--merge-plugin": { | ||
"include": [ | ||
"./composer-shared/composer.json" | ||
] | ||
} | ||
} | ||
} |