A short FAL tip. Delete file. Continue reading
Move TYPO3 media to external volume
Sometimes over the time, when more and more projects is coming to SSD disk the space is in slowly ending. On MacBook there is SD slot which can help us to extend harddrive possibilitues and move to this SD a files that do not need to be read fast – typically media files. For TYPO3 projects its fileadmin and uploads folders.
Indexing extension records with “Indexing Configuration”
If we use “indexed_search” extension in TYPO3 then there are two ways to index extensions records. First one is to create “Crawler Configuration” records. The second one is to create “Indexing Configuration” records.
The “Crawler Configuration” has a drawback that is crawl all records in frontend so whole TYPO3 is run to generate a page with single view of record. The “Indexing Configuration” way scans only selected fields from record and based on that creates records on indexed_search tables.
Realurl config for not existing slug (alias)
If you forget to configure realurl extension for records aliases well then if you will try to enter some fake record slug the this slug will be not mapped to uid by realurl and will be passed as string to extbase which will try to map this string to uid of record which ends up with php fatal error.
Autocomplete for deployer in phpStorm
From https://github.com/deployphp/deployer/issues/742#issuecomment-237638384
- rename /usr/local/bin/dep to /usr/local/bin/depployer.phar
mv /usr/local/bin/dep /usr/local/bin/deployer.phar
- Make a symbolic link for convenience back to dep
ln -s /usr/local/bin/deployer.phar /usr/local/bin/dep
- Add /usr/local/bin to include path under PHPStorm -> Preferences -> Language & Frameworks -> PHP
Moving repo to new repo with all branches and tags
Sometimes there is need to set up repo at new hoster and move existing repo to this new repo and keep all history, all branches and all tags. Here is the recipe how to do it.
Add deploy user for deployer
- Run this to add user “deploy” wiht home dir /deploy/
useradd -m deploy
- Run this to genereate ssh keys for “deploy” user
su deploy -c"ssh-keygen"
- Run this to add group “www-data” to user “deploy”
usermod -a -G www-data deploy
- Run this to check to what groups user “deploy” belongs to:
groups deploy
Clear available opcaches in php
Sometimes there is need to clear cache for opcaches but you can be not quite sure what cache is used for this hoster and you have no time to check it. For this case you can use following code.
Spam protection for TYPO3
TYPO3 has build in method to protect email links created with typolink API. This method protects only a href=”mailto:some@example.com” but does not protect the text inside link. So if the text itself is an email then protection is not working well. One solution is to always use <a>email</a> and not real email as link text. The second solution is to prepare tricky “email” html that the spider will be not able to parse correctly.
PhpStorm and GIT case sensitive on MacOS
PhpStorm < 10
Up to PhpStorm9 it was possible to set case sensitivity by adding:
idea.case.sensitive.fs=true
to idea.properties file, which you can open using “Help -> Edit Custom Properties” in PhpStorm itself.
PhpStorm >= 10
It Seems that in versions 10 and later you need to use idea.properties file from “Help -> Edit Custom Properties” but also need to add this line to another idea.properties file:
echo 'idea.case.sensitive.fs=true' >> /Applications/PhpStorm.app/Contents/bin/idea.properties
GIT case sensitivity
Remember also that GIT has it own setting for case sensitivity and it may be turned off on your environment, because MacOS does is not case sensitive by default. You can turn it on by:
git config core.ignorecase false
