If you want to delete all rows from a table but exclude the last X rows (in this case 20), you can use this SQL statement: Another option would be to use this query to avoid a large list of IDs:
What’s the difference between new self() and new static() in PHP? Or is it the same? It is not the same. self refers the class in which the new keyword is actually written. static refers to the class in the hierarchy, where the method has been called. Look at the following example:
When restoring a blank Mail-in-a-Box, you may get this error: Solution to fix the problem is to run this command before running the restore: After deleting this directory, the restore should run without problems.
This tutorial guides you through the setup process of Sentry (onpremise / self hosted) using Ubuntu 18.04, nginx as webserver and LetsEncrypt certificates. First step is to get Ubuntu 18.04 up and running. In my case, I use a cloud server from Hetzner. You should use a server with at least 4GB or RAM, because […]
max_allowed_packetis a MySQL variable. If you wanto to increase max_allowed_packet, you can use the SQL statement below. First step is to check the current size of max_allowed_packet: Next step is to set max_allowed_packet – in this case to 16MB: Now, max_allowed_packet has been changed.
The default shell when using macOS is ZSH. If you want to add a directory to the PATH variable, you can create a file named ~/.zshenv: Now, you can use this file to add a directory to the path, in this case, ~/.composer/vendor/bin will be added to the PATH:
If you use macOS, you may use the following SQL statement to locate your MySQL logs: The output should be something like: Now you can use tail show old and new entries in the logs: Enable Logs If your logs are disabled, you can enable them by using these SQL statements:
If you are using macOS and want to reset PhpStorm to its default settings, you can use these commands (run them from a terminal): These commands remove configuration (in Preferences folder), caches (in Caches folder), plugins (in Application Support folder) and logs (in Logs folder). More information can be found here.
If you want to check the used version of Twig, you can enter this line to one of your template files: Another option is to check the file vendor/twig/twig/lib/Twig/Environment.php or vendor/twig/twig/src/Environment.php, depending of the version you use. In one of the two files, a there is a version constant: