LostKobrakai

PW-Moderators
  • Content Count

    4,672
  • Joined

  • Last visited

  • Days Won

    96

LostKobrakai last won the day on November 28

LostKobrakai had the most liked content!

Community Reputation

4,699 Excellent

3 Followers

About LostKobrakai

  • Rank
    Hero Member
  • Birthday 11/29/1991

Contact Methods

  • Website URL
    http://www.kobrakai.de

Profile Information

  • Gender
    Male
  • Location
    Munich, Germany

Recent Profile Visitors

15,475 profile views
  1. LostKobrakai

    Can we make the api a bit more flexible like: $options = [ 'additionalFormats': ['webp'], 'webp' => [ 'quality' => 80 ] ]; This way we can easily add any other formats, which might emerge and have the possibility to not only have a single additional format generated. And as soon as we might generate multiple formats / images per sizing operation I feel like namespacing options like quality might prevent an explosion of possible root level options.
  2. The crux here is that the file compiler usually takes care of older modules, which are not namespaced. Maybe those additional files are expected to be namespaced by the file compiler if your main module is namespaced.
  3. You namespaced the file containing the module, but not the two other files. Namespaces are always per file, therefore each one needs the namespace declaration.
  4. LostKobrakai

    Or just put that in the settings: { "files.associations": { "*.module": "php" } }
  5. Did you try: $cities = wire('pages')->find('template=city, children.children.created<"14 days ago", !children.children.created>"14 days ago"') Without the @ syntax the two selectors for children should work if they match on different children.
  6. For composer itself: interoperability and a far bigger ecosystem. For wrapping packages into pw modules: Please don't wrap packages for the sake of wrapping them. It's useful if you provide additional features like configuration through the modules or deeper integration in processwire classes, but that's work and needs to be maintained on top of the package by itself. The only backdraw a plain composer package has on top of a pw module without additional features, is that it can't be installed via the backend, but you need to use the composer cli (and that's more a restriction of composer than of pw). The same is actually also true for the few pw modules which install composer packages. Another problem of wrapping packages is that you cannot get updates without the wrapping module being updated. There is also lot's of tooling like checking for security issues around composer. For anyone not just doing php as a hobby I don't see a reason not to use composer just like nobody uses javascript without npm anymore for any serious work.
  7. That's what I was refering to. Afaik /vendor is not blocked by default just because there are packages out there containing assets, which need to be web-accessable. I'd personally also lean to just block it.
  8. Just to clarify the bit about "putting stuff outside the webroot" for security reasons: This is certainly a nice precaution, but processwire is not using it because there are way to many shared hosters, where it's simply not possible to go outside the webroot. I'd also say that if your webserver is not behaving correctly you've got bigger problems to deal with, so usually just adjusting your .htaccess file should be perfectly fine as well. Especially as your php process still needs to be able to read things even if they're not within the webroot to be able to execute them. There's not really a need for composer for that part as processwire has it's own psr-4 compatible classloader: https://processwire.com/api/ref/class-loader/
  9. LostKobrakai

    This seems to be an index page. Are you sure the error happens on the first item of the collection? In other words did you check all items for that key as you‘ve only posted one here.
  10. LostKobrakai

    There are three things to consider for load balancing: You need a central database, central file management (if people do upload things) and central session management (as the default also uses the filesystem). Each can be solved in various ways and depends mostly on your project's constraints. Database Probably as simple as running the db on it's own external server. File Management - Cloud storage (S3 or equivalent; minio for self hosted S3) - rsync (this is at best eventually consistent as you need to wait for the sync) - mount network share (I've not tried this and read a lot of bad things, but it might work) Session Management - Use the central db for session (SessionHandlerDB; might be slow) - Use a central redis server (can be done directly in php)
  11. LostKobrakai

    Hooks are the way to go for validating business requirements.
  12. LostKobrakai

    Because it's (loosely) based on the selectors engine you select pages by and because it was never intended to serve bigger validation purposes, but more of a convenience tool to quickly show/hide things based on some external data. Having that it was a quick thing to add "required if" as another option besides "show if". So all in all: historical reasons. Real validation needs to run on the server side, and while show if and required if is checked against on the server side the main functionality it added at the time is the client side in showing/hiding fields and or showing/hiding the required asterisk. So mixing both is in my opinion a ill fit without changes to implementation.
  13. LostKobrakai

    Afaik ryan's position on hard constraints in form validation is that they don't work and you should expect things to be off. Like what happens if you change a input field from min. 1 to min. 2 images. Suddenly all your pages are in an invalid state and there's no form validation, which can save you from that.
  14. LostKobrakai

    Yeah, there are ways to use webp as progressive enhancement, so there's no need to detect browser support on the server side.
  15. LostKobrakai

    You can look into the FieldMigration class to see what it does on migration/rollback. It should just remove the field itself. If that doesn‘t clean up the fieldgroup than it‘s expected behaviour. You can still override/add to that by putting your own upgrade/downgrade functions like e.g. I did it here: https://github.com/LostKobrakai/MigrationSnippets/blob/master/Reverse_Template_Migration_Type.php