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
<?php | |
namespace Utils; | |
class Strings | |
{ | |
public static function substringsCount($string, $dots) | |
{ | |
str_replace($dots, '#\#\#', strip_tags($string), $val); | |
return $val; |
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
<?php | |
function isValidFirefoxDownload() { | |
if (!isset($_GET['product'])) { | |
return false; | |
} | |
global $config; | |
$versionDetails = (int) str_replace('firefox-', '', $_GET['product']); |
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
#!/usr/bin/env php | |
<?php | |
// Transliteration to Serbian requires ICU library >= 5.0 | |
if (php_sapi_name() != 'cli') { | |
die('Nope'); | |
} | |
$targetFolder = (isset($argv[1])) ? $argv[1] : 'sr-Latn'; // target folder |
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
<?php | |
function getBugsFromCSV($csv, $full = false) | |
{ | |
$shortBugs = $fullBugs = $temp = []; | |
if (($handle = fopen($csv, 'r')) !== false) { | |
while (($data = fgetcsv($handle, 300, ',')) !== false) { | |
if ($data[0] == 'bug_id') { |
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
<?php | |
function isUTF8($filename) | |
{ | |
$info = finfo_open(FILEINFO_MIME_ENCODING); | |
$type = finfo_buffer($info, file_get_contents($filename)); | |
finfo_close($info); | |
return ($type == 'utf-8' || $type == 'us-ascii') ? true : false; | |
} |
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
<?php | |
function cleanEntity($entity) | |
{ | |
$component = explode('/', $entity); | |
array_pop($component); // suppress entity | |
$component = array_filter( | |
$component, | |
function($val) { return $val != 'chrome'; } | |
); |
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
<?php | |
// Script should not be called from the Web | |
if (php_sapi_name() != 'cli') { | |
die('Nope'); | |
} | |
$settings = parse_ini_file(__DIR__ . '/../config/config.ini'); | |
if(! isset($settings['l10nwebservice'])) { | |
error_log('L10n Web service variable in config.ini is not defined'); |
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
<?php | |
function getSVNCommitTimestamp($file) | |
{ | |
exec("svn info --xml ${file} 2>/dev/null", $output, $return_code); | |
if ($return_code) { | |
return false; | |
} |
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
diff --git a/classes/Langchecker/LangManager.php b/classes/Langchecker/LangManager.php | |
index ce450ad..bdebe36 100644 | |
--- a/classes/Langchecker/LangManager.php | |
+++ b/classes/Langchecker/LangManager.php | |
@@ -385,4 +385,16 @@ class LangManager | |
return $result; | |
} | |
+ | |
+ public static function importTransvisionEntity($repository, $english, $entity) |
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
<?php | |
/* Webhook to update a repo for each push on GitHub. */ | |
date_default_timezone_set('Europe/Paris'); | |
$header_match = 'HTTP_X_HUB_SIGNATURE'; | |
$secret_key = 'my_secret_key_in_github_webhook'; | |
$branch = 'master'; | |
function logHookResult($message , $success = false) { |
OlderNewer