Jump to content

flydev

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by flydev

  1. On my side, from what I understand (and what I would like to see implemented) is something like the following : - in config.php set $config->restapi = [ 'endpoint' => 'api', 'enabled' => true]; then use simples built-in functions to get data from api (eg, home page) GET /api/1 Anyway, even if it could/should be easy to use, things are a bit more complex than what we can see here in this thread. I mean, almost all functionalities of AppApi should definitely exists.
  2. Good post @Ivan Gretsky, I recently asked something similar about ProcessWire it-self there and forgot to mention modules's authors. Shame on me and I also suggest @adrian (and others) to give the possibility to not only to send a coffee or a simple donation, but a monthly donation. What's is "cool" about it on Github - it could be taken a bit as narcissism but it's not - it's to show that we are sponsoring a project on our page and make us proud of it.
  3. Correct - let find an argument then, it was more fun to write, I like chaining things ?
  4. Result, it crashed two times, but managed to delete 2 millions of pages in about ~15 hours ?? RockFinder really helped here - it reduce the code that should be written and the server overhead of getting the millions of record through a loop.
  5. Hi @Laegnur and welcome here. Your issue come from the fact that your translated strings are on the same line (I admit it could be tricky to spot on first instance if you are not used with ProcessWire). To understand better, please read this sentence : So to get it working, write the first line on two lines lol : <?php // i18n - copyright echo _x('All rights reserver', 'copyright'); ?> <!-- html markup - separator --> | <?php // i18n - developer echo _x('Developed by', 'developer'); ?> You can use of course the syntax you want, just keep in mind that the strings need to be on two lines. For more information about: https://processwire.com/docs/multi-language-support/code-i18n/
  6. Thanks, it's running on batch of 5000 records and I will see how much time it take. I guess I still have the benefit of not crashing the server while getting all the candidate pages. $end = strtotime( "2021-02-27 23:59:59"); // loop $database->beginTransaction(); $result = $rockfinder ->find("template=receipt, numChildren=0, created<$end, limit=5000") ->each(function($row, $finder) use ($database) { $finder->pages->delete($finder->pages->get($row->id)); }); $database->commit();
  7. @bernhard How you would have started to delete more than 4 millions pages ? $end = strtotime( "2021-02-27 23:59:59"); $result = $rockfinder ->find("template=receipt, numChildren=0, created<$end, limit=25000") ->each(function($row, $finder) { $finder->pages->delete($finder->pages->get($row->id)); });
  8. Eh nothing, all is ready, we have even more with JWT implementation. It's just missing a function which return the pages tree. Something like less than 10 lines of code. Already shipped with : - Authentication - Three different authentication-mechanisms are ready to use. - Access-management via UI - Multiple different applications with unique access-rights and authentication-mechanisms can be defined And you can generate your own routes dynamically by just adding a simple hook. Installation will/should be required in every case, even with a core module. But you should give a try to the AppApi module, you can start in less than two minutes, check : Enregistrement #27.mp4
  9. I admit that this functionality could/should be included in the kernel (but disabled by default) as I personally use it for every installation, but still I didn't feel the need for it (getting it in the core) as I find the flexibility provided by the module AppApi made by @Sebi more interesting. Just include this module in your setup and you are ready. Anyway the argument is really good about that it will excite new users who have not yet tried ProcessWire but want to give a try when they see that they can use/build an API out-of-the-box.
  10. @wbmnfktr this module is for you : https://processwire.com/modules/blackhole/ Then add the 3 `wp-` magics folders and you will get rid of most bots :
  11. If you are interested I can take the time to publish a draft of a profile which you could use as starting point, and IMO it's better and easily than other solution that I could have tested. Basically it use a modified version of InertiaAdapter made by @clsource and let you code your app inside ProcessWire's template and using pages for everything fetched dynamicaly and internally, as JSON. You can see it "in action" in this example url: https://blog.sekretservices.com/ (Do not take care of the issue while refreshing the blog post due to hanna codes, it's an old version) For example, from your template you build the page properties as a simple PHP array, let's say I want to fetch the title of the page: $component = "Home/BlogPost"; $properties = [ // accessible from app components with $page.props 'name' => $page->name, 'title' => $page->title, 'subtitle' => $page->subtitle, 'content' => $page->body, 'author' => ucFirst($page->createdUser->fullname[0])."."." ".ucFirst($page->createdUser->surname), 'date_created' => $page->created, 'date_relative' => $datetime->relativeTimeStr($page->created) ]; Then from a component BlogPost.`{svelte, vue, react}` (or whatever) you can simply retrieve the page's props like: (Svelte example) <script> import {inertia, page} from '@inertiajs/inertia-svelte'; export const { title:title, body:body } = $page.props </script> <div class="blog-post"> <h1 class="font-sans mt-8 text-center font-bold">{@html title}</h1> <div>{@html body}</div> </div> Look at this sample, at the page's tree and the routes prop from the console : About the workflow, it's not really different from what you should be used to. You write your logic in template in PHP then write some HTML/JS in your component. Also, hot module replacement (HMR) is working ? A word about server side rendering (called SSR and which is needed to get best SEO results), it's working for React and VUE, still a WIP for Svelte ? Get a note of ?on every lighthouse performance. Bundled with ViteJS, powered by ProcessWire, I am glad to say that it's the best stack I have ever built and used ?? Edit: A small note, but the better one. You don't have to build your app again on every change on the backend, I mean for example when you add a new page, it's work out-of-the-box, you create and page, and it's available to your JS components. Edit2: To understand better, here we can achieve what you already used/saw with Laravel. Having a `src` folder with the JS things, another folder with the Laravel `app` and running artisan and some npm command. Here, in dev mode, you run `yarn dev` and you are ready. Simple as that.
  12. I missed the point you are using caddy. You can also show us the webserver error.log, php.log and an output of phpinfo().
  13. What could be helping here is the PHP logs. From experience when you do an upgrade after verifying compatibilties, issues can arise from access permissions. 1. empty manually the mysql table session_login_throttle 2. get php version (php8 got patched last month, addressing an issue in session serialization, might not be related) php -v ... paste output php -m ... paste output (you should check that every mod required by processwire is installed) 3. reload caddy sudo systemctl caddy reload 4. verify php-fpm sudo systemctl status php8.1-fpm ... paste output 5. check the logs cat /var/log/fpm-php.log ... paste output
  14. Hi everyone ?? I hope everyone is doing well here. @ryan It's something I have in mind for months, even if am not actively participating to the community (?), I am still using this tool for quite everything and I know that we can support the project by buying license of Pro Modules. That's said, personnaly I am not using them as I mostly build custom modules, or even use it as is. I would like to have the ability to financially support you and people whish maintain this tool. Eventually, Github's Sponsors could be a good choice; You could choose a one-time payment or a recuring one. What do you think about it ?
  15. Recently @Wanze starred a free app on Github, just awesome : https://github.com/responsively-org/responsively-app It's a browser modified that show how a website work in all selected devices. I think a lot of people will fall in love for this soft - give them a star on github ?
  16. Welcome here Seema, you just spot a damn good community, ready to help and share in a professional fashion ? Where are you from (if its ok) ?
  17. Just a heads-up on this, Really strange, when using nested hannacode, each nested hannacode add 100ms to TTFB. I saw old issue on Github and a commit about nested hannacode but I ask myself if it was tested with a lot of content and something than more than 30 hannacode in the same body field. I used RockReplacer from @bernhard and the whole page load in 200ms instead of 1.8s. It was used like: [[tag element="div" class="row"]] [[tag element="div" class="col-6"]] $content [[end-tag]] [[end-tag]]
  18. @Bike welcome on the forum. Use this search/tool : https://cse.google.com/cse?cx=014789015761400632609:fxrf0rj4wr4 Then check theses threads : Then come back here after some read ?
  19. I found what I was trying to remember. Try what is said in this thread, last answer, it seems it's a related issue (I have the same one in a setup). Direct answer: Modules order in the db.
  20. after a backup, I would delete session files in site/assets/sessions and clean entries in the db, table `session_login_throttle` before going further.
  21. @adrian I spotted something quite "annoying". Check the line number on the bottom of panel. It doesn't show anymore. Before : After : The line is shown only when I over the link with the mouse.
  22. I thought I was in Tracy's thread sorry ?‍♂️?
  23. Oke thanks @Klenkes Then he should also verify namespaces on the templates / modules following the stack-trace. I have an issue like this on an install, due to a namespace error, I have to rename each modules called then installing it again.
×
×
  • Create New...