Jump to content

LostKobrakai

PW-Moderators
  • Content Count

    4,901
  • Joined

  • Last visited

  • Days Won

    99

LostKobrakai last won the day on August 4

LostKobrakai had the most liked content!

Community Reputation

5,154 Excellent

6 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

19,291 profile views
  1. In PHP functions do not inherit variables from the parent scope. Even closures (unlike many other languages) don't do so unless explicitly stated by `function() use ($var, …) {}`
  2. Since sessions are maintained by cookies and cookies are bound to domains the answer is no – you cannot share a session between domains. What you can do is have only a single domain handle authentication, and all other domains fetch information from that service. See for example oauth or openid connect systems. That‘s rather complex though and not something available in processwire as is.
  3. The spec for http 1.1 (rfc 7231) only specifies the behaviour of the location header for http 201 and 3xx. I'm not sure it's a good idea to depend on undocumented behaviour of not setting a proper 3xx status code. Especially as this seems to happen even when explicitly calling: $session->redirect($url, 302); This not setting a http status code is waiting to cause people trouble. One isn't always dealing with browsers, which are usually quite forgiving.
  4. Using / as dividers signifies an American date format of MM/DD/YYYY, which makes only the latter invalid.
  5. It's neither. Pages are objects and field values are stored within that object. If the field was not yet accessed it will be loaded and stored. After that it'll directly use the value in memory. Most often people wouldn't even refer to that as caching as it's still just stored in memory and for the current request only – but tech. it is a form of caching.
  6. That's because the file input field uses ajax requests for the files. So each request only holds a single file.
  7. Imo the most important part missing in conversations about one language vs. the other is context. Just using features for comparison is useful mostly to fanboys. One needs to look at existing knowledge, time to learn, amount of benefit from the learned language (short term and long term), team dynamics (hiring, on-boarding, finding devs already fluent), existing code, …. There's a reason there's so much PHP written for things objectively much simpler done in other languages – because all the above things often outweigh changing away from PHP. Like everything async/stateful (even just websockets) is a pain in the ass in php, because the common way to deploy php is stateless. Does that stop people from doing that with PHP? Nope, people take on a bunch of complexity to do it even with languages/runtimes out there much more suited to the task. Take the leap from webdev to ML and the context is completely different. Suddenly things like existing code don't exist anymore, ML is "new". ML needs to be learned anyway, so existing PHP knowledge is vain. Other people mostly use python for ML, so it makes sense to use them. Short term there's a clear benefit in moving to python for ML. The same should apply to green field projects, but what today is actually properly green field (including team knowledge and such).
  8. Wouldn't it make sense to use PRs on GitHub for such suggestions?
  9. $this is a special variable within classes to refer to the current instance. It's simply not available in hooks. But $event->object should refer to the current object instance, but I'd expect you'll only have access to public methods and properties that way. So because of the context switch (within the class vs. outside) you might still need to change things.
  10. In MySQL `NULL` is always less then any non-null value. Therefore you either need to sort at runtime, somehow make the sql query issued sort by `ISNULL(col), col` with different directions or use my paginator module for paginating though multiple different selectors: https://github.com/LostKobrakai/Paginator
  11. If you have highly variable load I'd suggest going with something like heroku for manual scaling (if planable) or even solutions, which can automatically scale. No need to run a super beefy server for a whole month if only a single day has actual load. 25k/hour is around 7req/s (likely higher for varying load over the duration of the hour), so either requests must be served in <1/7s or you need more server instances.
  12. Or a time column instead of a datetime one, removing the complexity all together.
  13. Is this documented somewhere? Feels like a gross implementation detail bound to change at any given point in time. Using this would imo be the proper solution:
  14. There are three parts from my perspective: Filesystem => Have wordpress and processwire in separate folders URLs => You need to find a (likely .htaccess) way to move certain paths away from wordpress to processwire Migration => How do you deal with migration needs to be clarified. Can you have downtime between taking wordpress content down and pushing the pw replacement up? How much downtime is ok? All of those are solvable problems. The complexity of the last part mostly depends on how much downtime you're allowed. The less time the more automated things need to be.
  15. Yes and no. It might pre-compile some pages like e.g. all the category listings of blog posts. But those are not dynamic by something the user requests, but those are added by a developer to be created at buildtime. Say your SSG has access to all your blogposts. It can easily aggregate them by tags and create pages for "/blog/tag/static-site-generator". But it can't precompile a site where a user searched for "Static Site" in a search box and showing results.
×
×
  • Create New...