当前位置: 首页>>代码示例>>PHP>>正文


PHP Tinebase_Helper::getDevelopmentRevision方法代码示例

本文整理汇总了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));
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:5,代码来源:HelperTests.php

示例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');
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:11,代码来源:Core.php

示例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));
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:70,代码来源:langHelper.php


注:本文中的Tinebase_Helper::getDevelopmentRevision方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。