Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 6bfcb27

Browse files
authored
Merge pull request #1144 from huzergackl/develop
Added test for php module 'intl'
2 parents 520ded0 + 9a6cd23 commit 6bfcb27

File tree

2 files changed

+52
-7
lines changed

2 files changed

+52
-7
lines changed

core/src/core/tests/test.PHP_APC.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ public function __construct() { parent::__construct("PHP APC extension", "Pydio
3232
public function doTest()
3333
{
3434
$this->failedLevel = "warning";
35-
$v = @extension_loaded('apc');
36-
if (isSet($v) && (is_numeric($v) || strtolower($v) == "on")) {
35+
36+
if (extension_loaded('apc')) {
37+
$this->failedInfo = "PHP APC extension detected, this is good for better performances";
38+
$this->testedParams["PHP APC extension loaded"] = "Yes";
39+
return TRUE;
40+
} else {
3741
$this->testedParams["PHP APC extension loaded"] = "No";
38-
return FALSE;
39-
} else if (!isSet($v)) {
4042
$this->failedInfo = "Pydio framework loads a lot of PHP files at each query, and using a PHP accelerator is greatly recommanded.";
4143
return FALSE;
4244
}
43-
$this->failedInfo = "PHP APC extension detected, this is good for better performances";
44-
$this->testedParams["PHP APC extension loaded"] = "Yes";
45-
return TRUE;
4645
}
4746
}

core/src/core/tests/test.PHP_INTL.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/*
3+
* Copyright 2007-2016 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
4+
* This file is part of Pydio.
5+
*
6+
* Pydio is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Pydio is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* The latest code can be found at <http://pyd.io/>.
20+
*/
21+
defined('AJXP_EXEC') or die( 'Access not allowed');
22+
require_once('../classes/class.AbstractTest.php');
23+
24+
/**
25+
* Check that intl is enabled
26+
* @package AjaXplorer
27+
* @subpackage Tests
28+
*/
29+
class PHP_INTL extends AbstractTest
30+
{
31+
public function __construct() { parent::__construct("PHP INTL extension", "Pydio used intl to localize month names."); }
32+
public function doTest()
33+
{
34+
$this->failedLevel = "warning";
35+
36+
if (extension_loaded('intl')) {
37+
$this->failedInfo = "PHP INTL extension detected. Month names can be localized depending on the users language.";
38+
$this->testedParams["PHP INTL extension loaded"] = "Yes";
39+
return TRUE;
40+
} else {
41+
$this->failedInfo = "PHP INTL extension missing. English month names will be used for all languages.";
42+
$this->testedParams["PHP INTL extension loaded"] = "No";
43+
return FALSE;
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)