Jump to content

LostKobrakai

PW-Moderators
  • Posts

    4,956
  • Joined

  • Last visited

  • Days Won

    100

Everything posted by LostKobrakai

  1. $coaches = $pages->get("/coaches/")->children($selector);
  2. How about that? https://processwire.com/api/ref/template/
  3. Yesterday I released 0.3.1 with the access migrations like described here: It does also include a fix to allow usage in multisite setups using $config->paths->site instead of hardcoding /site/….
  4. The sort value is only kept consistent per parent, therefore it doesn't do what you want it to do. You could try using "sort=parent, sort=sort", but this will only solve the issue for 1 level of nesting. For anything further you'd probably need to do some serious joining with pages_parents to even get the wanted sort order in mysql.
  5. These variables do still exist, but in their default states. As I said, processwire does not handle the webrequest if it's bootstrapped into another script. So if you want processwire to do so you need to bring your other php files into processwire as well even if you don't need the content manangement tools, but you need the session/user tools. The other method, which I really don't recommend, is to try to copy the user initialization from /wire/core/ProcessWire.php. It might work, but each processwire update can potentially break it.
  6. Bootstrapping processwire does skip the whole web request stuff, so theirs neither a current_user nor any $input items and other things dependent on a webrequest. It's only meant for api work and it cannot piggyback onto a webrequest of the php script pw was included into.
  7. If it's working then there shouldn't be any issue with it, but to be honest I'd personally prefer to simply use some.sh file. Just let it move though project folders and use the module's cli (e.g. migrate run -l) to invoke migrations separately. I'd be far to worried about the multi instance stuff mixing up something somewhere and potentially affecting all of the projects at once.
  8. Using blockchain technology is a way to not need trust in a distributed system. In a blockchain cluster you still don't trust instances of other people, but the system can weed out people trying to abuse it (more reliably the longer data was stored). Without the distribution in the equation it's just an overly complex immutable data (/event) store. So testing your core business idea first is probably a good idea. Also if you can avoid distribution you'll save yourself a lot of complexity in building the product.
  9. ListerPro does provide the feature to easily add custom listers instances to the backend. It can be done without it as well by creating custom modules, but surely not as comfortably.
  10. @PWaddict I'm not really sure why you would bind your translations to the page object. What if you want to use those in a context, where there's no $page variable present? Wouldn't it be better to just create a new WireData object (like $static_translations) and return that.
  11. The creation of new pages directly on the inputfield is just a convenience functionality, which does only work if your pages share a common parent. So no there isn't a way to define a custom parent in that workflow.
  12. If you host is tampering with emails I'd really suggest you to send mails via an smtp server – could be installed on the same host as well. Trying to fix such issues can easily cause you a lot more trouble as you can see and it's not even garanteed you can fix it from php.
  13. Simply do not blindly do that. PHP_EOL is using the linebreak of the OS your running the code on, whereas things like the email rfc do define a fixed linebreak notation, which can differ from your OS selected one.
  14. You could skip the removal with most WireArray instances, as duplications are prevented by the item keys (filename in this case). There's also insertBefore() and insertAfter() and you could use all the array sorting functions if really needed: $a = $wireArray->getArray(); sort($a) $wireArray->setArray($a);
  15. I'm using https://buddy.works/, but this might not be the best place to discuss CI options
  16. You can use the cli component of the module to run migrations from the shell. So you could easily add this to a custom script iterating through your projects. I'm letting my Continuous Delivery tool run migrations when deploying.
  17. I've recently started to use laravel mix which is again a laravel related tool, which is not limited to usage only with laravel. It's a quite nice wrapper around webpack, which hides all the tedious configuration without denying the ability to customize when needed. When using vuejs it's even better, because it supports .vue files out of the box.
  18. The docs in the module thread are quite well written, just use them. You can quite simply use php in there, as that's the whole purpose of it. Just make sure to return a html string like it's done in the various examples.
  19. If it works with pulling the selector out it's a different issue. My problem were literally missing rows in the table, which would make both your examples fail.
  20. You disabled everything for the fileCompiler, but wireCache and the fileCompiler are two totally different things. The first one is a multiple purpose cache for data you handle in your code. The fileCompiler is there to dynamically add the ProcessWire namespace needed in php files since pw 3.0, a.k.a. it's literally changing your php files and is not a cache for data at all. You could do this: // in config.php $config->cacheTimeMultiplier = 1 if($config->debug) $config->cacheTimeMultiplier = 0 // elsewhere echo $cache->get("hello-world", 3600 * $config->cacheTimeMultiplier, function() { echo "<p>Hello World</p>"; });
  21. I still don't fully understand what your platform should offer in the end, but to be honest I'm even more curious what you find so appealing in processwire compared to what you're writing about using a blockchain. ProcessWire is a quite nice, but comparatively simple CMS, whereas a blockchain implementation is a highly complex thing for decentralized and trustless computation/storage. The latter is something where experts develop a non trivial amount of time to just get it running (maybe not for the blockchain per se, but also the implementation and business logic around it). You should not miss one critical factor in the blockchain equation, which is the computational cycles needed to calculate new blockchain hashes. That's the reason, why this stuff does work, because it's so (mathematically proven) hard to abuse/break. So I'd really suggest you to ask yourself, what benefits you'd get from using a blockchain, because building that will be an investment and it'll certainly limit your base of potential customers if you don't fully hide the blockchain technology from them (e.g. most likely run your own servers again).
  22. What's your usecase, which a blockchain would solve? I doubt it's anywhere near worth the time/complexity if you don't have a specific problem to be solved by this technology.
  23. And to expand on @Zeka a bit: $jsonTemplates = $templates->find("contentType=json"); $jsonPages = $pages->find("template=$jsonTemplates");
  24. I'm not really sure if it's worth the hassle to care for own servers' email reputation. Especially when running on a shared hoster or any cloud service your ip is shared with others – on cloud services some other customer might have had the ip before yourself – so the reputation is not only in your own hands. And even if that' not the case it might be easier to pay a service than to spend hours trying to get to the cause of the bounces.
  25. $page->data is a "remnant" of subclassing the WireData class. It's there to store any value assigned to a page: $p = $pages->get(1) $p->someRandomWhatever = 'Hallo'; echo $p->someRandomWhatever; // Hallo echo $p->data; // {'someRandomWhatever' => 'Hallo', …} Some fields do use this, but especially the native fields (parent, children, …) or others are implemented in different ways. It's at least not in any way specific to fields.
×
×
  • Create New...