Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# syntax=docker/dockerfile:1

ARG BUILDER_CONFIGURATION="release"
FROM php:8.4-apache@sha256:51da594c844a97f31b1cd6b1ac6660982f40788f4fe13e75f7fd39e2f9b58651 AS composer-builder
ENV BUILDER_PLATFORM=docker-composer

# Install Zip to use composer
RUN apt-get update && apt-get install -y \
Expand All @@ -15,12 +18,29 @@ RUN composer self-update
USER www-data
WORKDIR /composer
COPY composer.* /composer/
RUN composer install

# Consume the build argment
ARG BUILDER_CONFIGURATION
RUN if [ "$BUILDER_CONFIGURATION" = "debug" ]; then \
# composer install --dev deprecated
COMPOSER_NO_DEV=0 composer install ; \
else \
COMPOSER_NO_DEV=1 composer install ; \
fi

# Site
FROM php:8.4-apache@sha256:51da594c844a97f31b1cd6b1ac6660982f40788f4fe13e75f7fd39e2f9b58651
ENV BUILDER_PLATFORM=docker

COPY resources/keyman-site.conf /etc/apache2/conf-available/
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

ARG BUILDER_CONFIGURATION
RUN if [ "$BUILDER_CONFIGURATION" = "debug" ]; then \
cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini ; \
else \
cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini ; \
fi

RUN echo memory_limit = 1024M >> /usr/local/etc/php/php.ini
RUN chown -R www-data:www-data /var/www/html/

Expand Down
3 changes: 3 additions & 0 deletions script/developer/14.0/update/DeveloperUpdateCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
class DeveloperUpdateCheck {
const SETUP_REGEX = '/^keymandeveloper-.+\.exe/';

private $mssql;
private $isManual;
private $currentTime; // used mainly for unit testing

public $DownloadVersions;

public function execute($mssql, $tier, $appVersion, $isManual, $currentTime = null) {

$this->mssql = $mssql;
Expand Down
1 change: 1 addition & 0 deletions script/search/1.0/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class KeyboardSearchResult {
public $search; // search query has been entered
public $rangematch, $isomatch, $allmatch, $regionmatch;
public $text, $textparts, $searchtext, $region;
public $legacy;
}

class KeyboardSearch {
Expand Down
2 changes: 2 additions & 0 deletions script/search/2.0/search.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class KeyboardSearchResult {
public $platform;

public $keyboards;

public $rangetext;
}

class KeyboardSearch {
Expand Down
5 changes: 4 additions & 1 deletion script/windows/14.0/update/WindowsUpdateCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ class WindowsUpdateCheck {
const BOOTSTRAP_REGEX = '/^setup\.exe$/';
const BUNDLE_REGEX = '/^keyman(desktop)?-.+\.exe/';

private $mssql;
private $isManual;
private $currentTime; // used mainly for unit testing

public $DownloadVersions = null;

public function execute($mssql, $tier, $appVersion, $packages, $isUpdate, $isManual, $currentTime = null) {

$this->mssql = $mssql;
Expand All @@ -43,7 +46,7 @@ public function execute($mssql, $tier, $appVersion, $packages, $isUpdate, $isMan

return json_encode($desktop_update, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
}
// RepairVersionCheck works around an issue where Keyman for Windows 18.0.235-236
// RepairVersionCheck works around an issue where Keyman for Windows 18.0.235-236
// would not upgrade to a newer version; see the links below for more details.
// https://downloads.keyman.com/windows/stable/18.0.240/repair-14586/README.md
// https://github.com/keymanapp/keyman/issues/13831
Expand Down
4 changes: 3 additions & 1 deletion tests/TestDBBuild.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ final class TestDBDataSources extends \DBDataSources
function __construct()
{
foreach($this as $field => $value) {
$this->$field = $this->fileFromTestDataDir($this->$field);
if(!empty($this->$field)) {
$this->$field = $this->fileFromTestDataDir($this->$field);
}
}
$this->mockAnalyticsSqlFile = $this->fileFromTestDataDir("analytics.sql");
}
Expand Down
2 changes: 1 addition & 1 deletion tools/2020/ReleaseSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ReleaseSchedule {
* @param int currentTime Unix timestamp of current time
* @return bool true if the request should be presented with the upgrade
*/
public static function DoesRequestMeetSchedule(string $releaseDate, int $currentTime = null): bool {
public static function DoesRequestMeetSchedule(string $releaseDate, ?int $currentTime = null): bool {
// This is an arbitrary schedule; see for example Chrome's release schedule:
// https://chromium.googlesource.com/chromium/src/+/master/docs/process/release_cycle.md
$schedule = [
Expand Down
22 changes: 11 additions & 11 deletions tools/db/build/build.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ function BuildDatabase($DBDataSources, $schema, $do_force) {

$this->sqlrun(dirname(__FILE__)."/search.sql");
$this->sqlrun(dirname(__FILE__)."/langtags.sql");
$this->sqlrun("${data_path}langtags.json.sql");
$this->sqlrun("${data_path}language-subtag-registry.sql");
$this->sqlrun("${data_path}iso639-3.sql");
$this->sqlrun("${data_path}iso639-3-name-index.sql");
$this->sqlrun("${data_path}ethnologue_language_codes.sql");
$this->sqlrun("${data_path}ethnologue_country_codes.sql");
$this->sqlrun("${data_path}ethnologue_language_index.sql");
$this->sqlrun("${data_path}keyboards.sql");
$this->sqlrun("${data_path}models.sql");
$this->sqlrun("{$data_path}langtags.json.sql");
$this->sqlrun("{$data_path}language-subtag-registry.sql");
$this->sqlrun("{$data_path}iso639-3.sql");
$this->sqlrun("{$data_path}iso639-3-name-index.sql");
$this->sqlrun("{$data_path}ethnologue_language_codes.sql");
$this->sqlrun("{$data_path}ethnologue_country_codes.sql");
$this->sqlrun("{$data_path}ethnologue_language_index.sql");
$this->sqlrun("{$data_path}keyboards.sql");
$this->sqlrun("{$data_path}models.sql");

$this->sqlrun(dirname(__FILE__)."/search-prepare-data-1.sql");
$this->sqlrun(dirname(__FILE__)."/search-prepare-data-2.sql");
Expand Down Expand Up @@ -105,7 +105,7 @@ function BuildDatabase($DBDataSources, $schema, $do_force) {
if(file_exists($DBDataSources->mockAnalyticsSqlFile))
$this->sqlrun($DBDataSources->mockAnalyticsSqlFile);

$this->sqlrun("${data_path}dbdatasources.sql");
$this->sqlrun("{$data_path}dbdatasources.sql");
return true;
}

Expand Down Expand Up @@ -151,7 +151,7 @@ function buildDBDataSources($data_path, DBDataSources $DBDataSources) {
$sql .= "\nINSERT t_dbdatasources SELECT ".sqlv($DBDataSources, $field).", ".sqlv(null, basename($DBDataSources->$field)). ", " . $DBDataSources->downloadDate($value) ."\n";
}

file_put_contents("${data_path}dbdatasources.sql", $sql);
file_put_contents("{$data_path}dbdatasources.sql", $sql);
}

function download($url) {
Expand Down
6 changes: 3 additions & 3 deletions tools/db/build/cjk/build.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ function BuildCJKTables($DBDataSources, $schema, $do_force) {

$this->schema = $schema;

$this->sqlrun("${data_path}cjk_database.sql");
$this->sqlrun("{$data_path}cjk_database.sql");

$builder = new build_cjk_data($DBDataSources, $schema);
$builder->execute($data_path, $do_force) || fail("Unable to build cjk data");

$this->sqlrun("${data_path}chinese_pinyin_import.sql");
$this->sqlrun("${data_path}japanese_import.sql");
$this->sqlrun("{$data_path}chinese_pinyin_import.sql");
$this->sqlrun("{$data_path}japanese_import.sql");

return true;
}
Expand Down
Loading