jenkins-bot has submitted this change and it was merged.
Change subject: Migrate to use Intuition as a library
......................................................................
Migrate to use Intuition as a library
Instead of relying on a local installation.
This is the more modern way of using Intuition,
and paves the way to have messages used locally.
This also makes it easier to have a local
development environment.
- Add Intuition as a dependency in composer.json
- Change loader in common.php to load from the vendor
directory rather than relative to the $tsI18nDir variable
(which points to an hardocoded path on ToolLabs NFS)
- Remove tsI18nDir variable from Defaults.php
Bug: T134565
Change-Id: I6feac5712065d61e967eefdacb4206fe663ff9ef
---
M api/common.php
M api/includes/Defaults.php
M composer.json
3 files changed, 15 insertions(+), 13 deletions(-)
Approvals:
Lokal Profil: Looks good to me, but someone else must approve
Jean-Frédéric: Looks good to me, approved
jenkins-bot: Verified
diff --git a/api/common.php b/api/common.php
index e669644..f8c3ea3 100644
--- a/api/common.php
+++ b/api/common.php
@@ -20,19 +20,19 @@
require dirname( dirname( __FILE__ ) ) . "/{$config_override}";
}
-/* Localization */
-if ( $tsI18nDir ) {
- require_once( "$tsI18nDir/ToolStart.php" );
- $opts = array(
- 'domain' => 'MonumentsAPI', // name of your main text-domain
here
- 'globalfunctions' => true, // defines _(), _e() and _g() as
shortcut for $I18N->msg( .. )
- 'suppresserrors' => false, // Krinkle heeft het stukgemaakt
- );
- $I18N = new TsIntuition( $opts );
-} else {
- $I18N = null;
-}
+/* Localization
+ * We are loading Intuition as a library via Composer
+ */
+require_once __DIR__ . '/../vendor/autoload.php';
+$opts = array(
+ 'domain' => 'MonumentsAPI', // name of your main text-domain here
+ 'globalfunctions' => true, // defines _(), _e() and _g() as shortcut
for $I18N->msg( .. )
+ 'suppresserrors' => false, // Krinkle heeft het stukgemaakt
+ );
+$I18N = new Intuition( $opts );
+
+/* Database */
$dbStatus = Database::define($dbServer, $dbDatabase, $dbUser,
isset( $toolserver_password )? $toolserver_password : $dbPassword );
if (!$dbStatus) {
diff --git a/api/includes/Defaults.php b/api/includes/Defaults.php
index a266e72..fa826ab 100644
--- a/api/includes/Defaults.php
+++ b/api/includes/Defaults.php
@@ -5,7 +5,6 @@
$dbDatabase = 's51138__heritage_p';
$dbPassword = '<set password in database.inc';
$dbMiserMode = false;
-$tsI18nDir = '/data/project/intuition/src/Intuition';
$cacheDir = '/data/project/heritage/temp';
$cldrPath = false;
$subdivisionsPath = false;
diff --git a/composer.json b/composer.json
index 533ddd2..e2e31bb 100644
--- a/composer.json
+++ b/composer.json
@@ -8,5 +8,8 @@
"parallel-lint . --exclude vendor",
"phpunit api/tests"
]
+ },
+ "require": {
+ "Krinkle/intuition": "^0.2.3"
}
}
--
To view, visit https://gerrit.wikimedia.org/r/291776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6feac5712065d61e967eefdacb4206fe663ff9ef
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric <[email protected]>
Gerrit-Reviewer: Jean-Frédéric <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Lokal Profil <[email protected]>
Gerrit-Reviewer: Multichill <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits