Indefero

Indefero Commit Details


Date:2012-04-24 13:37:23 (13 years 9 days ago)
Author:Thomas Keller
Branch:develop, release-1.3
Commit:e8882292b5f085e5bab6f307a627360fbdcfe2cb
Parents: bca3eb332e371601bc0f10d9829b8ffc34282d25
Message:Improve the error we throw at the user if no configuration is found to calculate the project activities.

Changes:

File differences

src/IDF/ActivityTaxonomy.php
4444
4545
4646
47
48
49
50
51
52
4753
4854
4955
50
5156
5257
5358
......
5964
6065
6166
62
6367
6468
6569
{
    public static function recalculateTaxnomies(DateTime $date)
    {
        $sectionWeights = Pluf::f('activity_section_weights', null);
        $lookback = Pluf::f('activity_lookback', null);
        if ($sectionWeights === null || $lookback === null) {
            throw new LogicException('activity configuration is missing in idf.php');
        }
        //
        // query and normalize the section weights
        //
        $sectionWeights = Pluf::f('activity_section_weights', array());
        $allWeights = array_sum($sectionWeights);
        if ($allWeights == 0) {
            throw new LogicException('the sum of all "activity_section_weights" must not be 0');
        //
        // determine the date boundaries
        //
        $lookback = Pluf::f('activity_lookback', 0);
        if ($lookback < 1) {
            throw new LogicException('lookback must be greater or equal to 1');
        }

Archive Download the corresponding diff file

Page rendered in 0.19025s using 13 queries.