本文整理汇总了PHP中Tinebase_Helper::getDevelopmentRevision方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Helper::getDevelopmentRevision方法的具体用法?PHP Tinebase_Helper::getDevelopmentRevision怎么用?PHP Tinebase_Helper::getDevelopmentRevision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Helper
的用法示例。
在下文中一共展示了Tinebase_Helper::getDevelopmentRevision方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetDevelopmentRevision
public function testGetDevelopmentRevision()
{
$rev = Tinebase_Helper::getDevelopmentRevision();
$this->assertFalse(empty($rev));
}
示例2: setupBuildConstants
/**
* initializes the build constants like buildtype, package information, ...
*/
public static function setupBuildConstants()
{
$config = self::getConfig();
define('TINE20_BUILDTYPE', strtoupper($config->get('buildtype', 'DEVELOPMENT')));
define('TINE20_CODENAME', Tinebase_Helper::getDevelopmentRevision());
define('TINE20_PACKAGESTRING', 'none');
define('TINE20_RELEASETIME', 'none');
}
示例3: statistics
/**
* generate statistics
*
* @param bool $_verbose
* @return void
*/
function statistics($_verbose)
{
global $tine20path;
$statsFile = "{$tine20path}/langstatistics.json";
$locale = new Zend_Locale('en');
$langStats = array();
$poFilesStats = array();
foreach (Tinebase_Translation::getTranslationDirs() as $appName => $translationPath) {
if (!checkAppName($appName, $_verbose)) {
continue;
}
if ($_verbose) {
echo "Entering {$appName} \n";
}
$appStats[$appName] = array();
foreach (scandir($translationPath) as $poFile) {
if (substr($poFile, -3) == '.po') {
if ($_verbose) {
echo "Processing {$appName}/{$poFile} \n";
}
$langCode = substr($poFile, 0, -3);
$langLocale = new Zend_Locale($langCode);
$statsOutput = `msgfmt --statistics {$translationPath}/{$poFile} 2>&1`;
$statsParts = explode(',', $statsOutput);
$statsParts = preg_replace('/^\\s*(\\d+).*/i', '$1', $statsParts);
$translated = $fuzzy = $untranslated = $total = 0;
switch (count($statsParts)) {
case 1:
$translated = $statsParts[0];
break;
case 2:
$translated = $statsParts[0];
$untranslated = $statsParts[1];
break;
case 3:
$translated = $statsParts[0];
$fuzzy = $statsParts[1];
$untranslated = $statsParts[2];
break;
default:
echo "Unexpected statistic return \n";
exit;
}
$total = array_sum($statsParts);
$poFileStats = array('locale' => $langCode, 'language' => $locale->getTranslation($langLocale->getLanguage(), 'language'), 'region' => $locale->getTranslation($langLocale->getRegion(), 'country'), 'appname' => $appName, 'translated' => (int) $translated, 'fuzzy' => (int) $fuzzy, 'untranslated' => (int) $untranslated, 'total' => array_sum($statsParts));
$poFilesStats[] = $poFileStats;
// sum up lang statistics
$langStats[$langCode] = isset($langStats[$langCode]) || array_key_exists($langCode, $langStats) ? $langStats[$langCode] : array('locale' => '', 'language' => '', 'region' => $locale->getTranslation($langLocale->getRegion(), 'country'), 'translated' => 0, 'fuzzy' => 0, 'untranslated' => 0, 'total' => 0);
$langStats[$langCode]['locale'] = $langCode;
$langStats[$langCode]['language'] = $locale->getTranslation($langLocale->getLanguage(), 'language');
$langStats[$langCode]['region'] = $locale->getTranslation($langLocale->getRegion(), 'country');
$langStats[$langCode]['appname'] = 'all';
$langStats[$langCode]['translated'] += $poFileStats['translated'];
$langStats[$langCode]['fuzzy'] += $poFileStats['fuzzy'];
$langStats[$langCode]['untranslated'] += $poFileStats['untranslated'];
$langStats[$langCode]['total'] += $poFileStats['total'];
}
}
}
// clean up unwanted messages.mo
`rm messages.mo`;
$results = array('version' => Tinebase_Helper::getDevelopmentRevision(), 'langStats' => array_values($langStats), 'poFilesStats' => $poFilesStats);
file_put_contents($statsFile, Zend_Json::encode($results));
}