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
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ RUN yes | pecl install xdebug && docker-php-ext-enable xdebug \
\
# Configuring PHP \
&& touch "/usr/local/etc/php/conf.d/custom.ini" \
&& echo "display_errors = on" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "display_errors = 1" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "memory_limit = 256m" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "upload_max_filesize = 256m" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "max_execution_time = 60" >> /usr/local/etc/php/conf.d/custom.ini \
Expand Down Expand Up @@ -163,7 +163,8 @@ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& touch "/usr/local/etc/php/conf.d/custom.ini" \
&& echo "memory_limit = 256m" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "upload_max_filesize = 256m" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "max_execution_time = 60" >> /usr/local/etc/php/conf.d/custom.ini
&& echo "max_execution_time = 60" >> /usr/local/etc/php/conf.d/custom.ini \
&& echo "display_errors = 0" >> /usr/local/etc/php/conf.d/custom.ini

USER www-data
# ----END----
4 changes: 0 additions & 4 deletions ci/server/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@
fwrite(STDERR, "Failed to initialize database: " . $e->getMessage());
exit(-1);
}

$load = file_get_contents($envPath . "src/inc/startup/load.php");
$load = str_replace('ini_set("display_errors", "0");', 'ini_set("display_errors", "1");', $load);
file_put_contents($envPath . "src/inc/startup/load.php", $load);
3 changes: 2 additions & 1 deletion doc/faq_tips/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,15 @@ If there is enough RAM available, it is possible to raise PHP's memory limit in
1. **Create a file `custom.ini` next to your `docker-compose.yml`**

Adjust your desired memory limit (`M` for Megabytes, or `G` for Gigabytes).
The other two values are optional to adjust, but need to remain in there, as otherwise they are overwritten with the new `custom.ini` not containing them.
The other three values are optional to adjust, but need to remain in there, as otherwise they are overwritten with the new `custom.ini` not containing them.


```ini
; custom.ini
memory_limit = 256M
upload_max_filesize = 256M
max_execution_time = 60
display_errors = 0
```


Expand Down
2 changes: 1 addition & 1 deletion src/api/v2/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

date_default_timezone_set("UTC");
error_reporting(E_ALL ^ E_DEPRECATED);
ini_set("display_errors", '1');

/**
* Treat warnings as error, very useful during unit testing.
* TODO: How-ever during Xdebug debugging under VS Code, this is very
Expand Down
3 changes: 3 additions & 0 deletions src/inc/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,12 @@ public static function sendMail($address, $subject, $text, $plaintext) {
$htmlMessage .= $text;
$htmlMessage .= "\r\n\r\n--" . $boundary . "--";

set_error_handler(function() { error_log("Error sending mail"); });
if (!mail($address, $subject, $plainMessage . $htmlMessage, $headers)) {
restore_error_handler();
return false;
}
restore_error_handler();
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/inc/apiv2/common/AbstractModelAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ public static function getManyResources(object $apiClass, Request $request, Resp
$primary_cursor_key = key($primary_cursor);
// Special filtering of id to use for uniform access to model primary key
$primary_cursor_key = $primary_cursor_key == 'id' ? array_column($aliasedfeatures, 'alias', 'dbname')[$apiClass->getPrimaryKey()] : $primary_cursor_key;
$secondary_cursor = $decoded_cursor["secondary"];
$secondary_cursor = array_key_exists("secondary", $decoded_cursor) ? $decoded_cursor["secondary"] : null;
if ($secondary_cursor) {
$secondary_cursor_key = key($secondary_cursor);
$secondary_cursor_key = $secondary_cursor_key == '_id' ? array_column($aliasedfeatures, 'alias', 'dbname')[$apiClass->getPrimaryKey()] : $secondary_cursor_key;
Expand Down
3 changes: 0 additions & 3 deletions src/inc/startup/include.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php

// set to 1 for debugging
use Hashtopolis\inc\Lang;

ini_set("display_errors", "0");

define("APP_NAME", "Hashtopolis");

/* Set this to true to restrict access to API keys to their individual owners.
Expand Down
3 changes: 0 additions & 3 deletions src/inc/startup/load.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

// set to 1 for debugging
use Hashtopolis\dba\Factory;
use Hashtopolis\inc\CSRF;
use Hashtopolis\inc\Login;
Expand All @@ -11,8 +10,6 @@
use Hashtopolis\inc\Util;
use Hashtopolis\inc\utils\AccessControl;

ini_set("display_errors", "0");

session_start();

require_once(dirname(__FILE__) . "/include.php");
Expand Down
3 changes: 0 additions & 3 deletions src/inc/startup/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
use Hashtopolis\inc\Util;
use Hashtopolis\inc\utils\AccessUtils;

// set to 1 for debugging
ini_set("display_errors", "0");

session_start();

require_once(dirname(__FILE__) . "/include.php");
Expand Down