Jump to content

flydev

Members
  • Posts

    1,339
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by flydev

  1. Yes, in the first screenshot it show the two output files generated by xhprof and the second is a diff tool to compare the two files. Using a diff tool make easier to see the differences at a glance.
  2. @MarkE I read the other posts, I do not see any code chunk about how you are calling your hooks. As you said it's working on /site/init.php .. .. you have to remember that calling hooks implies also a context, I mean $wire/wire() vs $this, just a thought. Please confirm / insert coin 🙂 edit: And you might also test hook priority option, check there: Edit 2: I made you a small preview of a diff running debug true vs false, on a almost blank website, there is only one user modue installed:
  3. @MarkEby reproducible example I mean we could reproduce the issue. You could for example just publish/paste your module structure without all the business logic. Without code it’s not easy to help in this case. Without insisting, profiling your setup will speed also the debug process, as you will see instantly when your module is initialized and maybe also spotting where the glitch happen between the dev and prod. Maybe we are also going too far and might be a simple permission issue. Idk.
  4. Also, when you say it isn't working on live environment and everything is identique, does this sentence imply $debug is set to true and tracydebugger is enabled? Just asking as it make the env not the same, and then hooks order is likely not the same. To make things easier, publish or send via pm a reproducible example 🙂
  5. Can you share a reproducible sample we can copy paste for testing on our side?
  6. @MarkE in order to get rid of any frustration, I suggest you try to understand the order of execution of pw, as suggested by @BrendonKoz profiling a fresh install, and then adding your module and starting profiling again, and then comparing each runs is your best bet and will make things clearer for you. If you dont have ProfilerPro, just tell us if you are running on windows or linux and I will write you a small tutorial to get a profiler with xhprof, it's easy and take 2 minutes.
  7. @heybran you will find the direct access to Duplicator's packages management from menu Setup > Duplicator On server, you can list packages under ls -lah /public_html/site/assets/backups And welcome to the forum 👋
  8. @PavelRadvan the module - from the PW Directory - is pulled from Github, so it's the same content / version. The update field you see on the PW Directory, is the last time of the pull.
  9. Hi @PavelRadvan thanks. What you read in VSCode is just a warning, so no problem. I just opened an issue on github to remind me of it, I will write the php 8.2 upgrade at the same time of wire-cli. About the PW Directory, no idea, I will look at it, but the last stable version is v1.5.2 👍
  10. Welcome @Alpina You can also find condensed informations on this - GPT - thread (I just posted a result to start a presentation slide). @Alpina do not miss Jonathan Lahijani signature link 😁
  11. A persuasive starter-slide-presentation and key features. version: GPT 4o 🤖 Why ProcessWire? Elevate Our Digital Projects Introduction to ProcessWire What is ProcessWire? ProcessWire is an open-source content management system (CMS) and framework. Known for its flexibility, scalability, and ease of use. Ideal for websites, applications, and digital experiences. Key Features Key Features of ProcessWire Flexibility: Create any content structure without limitations. Scalability: Suitable for small websites to large-scale applications. API First: Powerful API for developers to create custom solutions. Security: Robust security features to protect your data. Performance: Optimized for fast loading times and efficient resource usage. Benefits for Our Agency Why ProcessWire for Our Agency? Customizable Solutions: Tailor-made for client-specific requirements. Developer-Friendly: Simplifies complex projects with clean, well-documented code. User Experience: Intuitive admin interface for easy content management. Cost-Effective: Open-source nature reduces licensing costs. Success Stories with ProcessWire Case Studies Case Study 1: A multinational company improved their site performance by 40%. Case Study 2: A local business streamlined their content management process. Case Study 3: An e-commerce platform saw a 30% increase in user engagement. Community and Support Community and Support Active Community: Thousands of developers and users contributing. Extensive Documentation: Comprehensive guides and tutorials. Support Options: Community forums, professional support services. How to Get Started with ProcessWire Getting Started Installation: Easy to set up with minimal server requirements. Training: Availability of resources to get up to speed quickly. Demo: Interactive demos to explore features firsthand. Conclusion and Next Steps Conclusion and Next Steps Summary: Recap of key points about ProcessWire’s advantages. Call to Action: Schedule a workshop/demo to explore further. Contact Information: Details for further questions and support. Questions & Answers Questions & Answers Open floor for any questions from the team. Encourage discussion on how ProcessWire can meet specific needs. Notes for Presenter: Engage the Audience: Start with a brief personal anecdote about your experience with ProcessWire. Highlight Benefits: Focus on how ProcessWire can solve specific pain points your agency faces. Interactive Elements: Consider live demos or video clips showcasing ProcessWire in action. Follow-Up: Propose a follow-up meeting to discuss implementation steps. Best regards, ChatGPT (4o)
  12. Hi, @Ivan Gretsky effectively, I started to give little time again on an experimental project I started nine months ago where the goals is let a pw developers build a desktop application using php/pw knowledges without digging into advanced javascript/bindings or learning a native language. About the db, you want to work with statitcaly embedded mariadb versions, SQLite could be possible, but will require a lot of work.
  13. It can be confusing as the readme contain a typo in the given example, the right command is the shorter, without a dash: `wirecli`
  14. Hi, I personally dont remember how the whole thing works, I suggest you to try @Juergen form if you can’t afford the paid v2 maintained by Ryan.
  15. Ok, so would you need a feature that would allow you to customize asset paths during a backup?
  16. Hi @protro But does it work even if you upload the site manually? I am asking that because as the path is written in the body field raw data in the db, with or without duplicator, image paths should be corrupted in any way. As example and based on your setup, the data of a body field with an image should look - on dev and prod - something similar to (can you confirm ?) : <p>Sagittis turpis ad habitasse risus lorem phasellus platea imperdiet aenean, platea porta adipiscing dapibus velit eros purus malesuada laoreet vestibulum</p> <p><img src="/my-site/site/assets/files/1/44849-the-image-2016.897x0-is.jpg" alt="" width="897" /></p> <p>...</p>
  17. @Flashmaster82 can you give me details about the version you are trying to install and your php version please?
  18. Hi, it seem a server issue, but for now we cant see what is the root source of the disk being filled. Do get an access to ssh again, which is the most important thing for now, you could use à logged user, and then in the admin, delete all logs file, then SSH asap. Once in the server, check /var/log and remove some old *.gz or the bigger to get more space, then investigate. Try to make a backup or an image of the server if you can before doing root cmd.
  19. @James Morris I had fixed it in on the feature-encryption branch, I will need to finish the feature and merge it, but meanwhile, can you try this version and let me know and confirm ? there: https://github.com/flydev-fr/Duplicator/tree/feature-encryption direct-dl: https://github.com/flydev-fr/Duplicator/archive/refs/heads/feature-encryption.zip Edit: @James Morris please try instead the dev branch, It is based on the latest v1.5.1 and contain the S3 fixes. dev branch: https://github.com/flydev-fr/Duplicator/tree/dev direct download: https://github.com/flydev-fr/Duplicator/archive/refs/heads/dev.zip
  20. Yes I saw that, but it was in the commented line so I didn't fixed it instantly, will push the fix. Ok I see, in first instance I had in mind to put a button to get the template script copied in the clipboard in order to paste and modify it. I will push also the fix following your recommendation 👍 I was also thinking of pushing a new feature that would allow you to export and import module settings on other installations, what do you think, it could help?
  21. @adrian with v1.5.1 you can write your dump script in the custom shell script config field like that: #!/bin/sh # Custom Remote Dump # (1) Set up all the mysqldump variables FILE=%%FILE%% DBSERVER=%%SERVER%% PORT=%%PORT%% DATABASE=%%DATABASE%% USER=%%USER%% PASS=%%PASS%% CACHEPATH=%%CACHEPATH%% # Fix trailing slash in cache path if needed CACHEPATH="${CACHEPATH%/}/" OUTPUT="${CACHEPATH}${FILE}" # (2) in case you run this more than once a day, remove the previous version of the file unalias rm 2> /dev/null rm ${FILE} 2> /dev/null rm ${FILE}.zip 2> /dev/null # (3) do the mysql database backup dump (remote) mysqldump --opt --protocol=TCP --user=${USER} --password=${PASS} --host=${DBSERVER} --port=${PORT} ${DATABASE} > ${OUTPUT} You can of course also set hardcoded values.
  22. Hi, sorry for the delay guys. @adrian I made it configurable, it should also check for carriage return when a custom script is given, please check releases/tag/v1.5.0 and tell me if you need something more. Edit2: Rereading your post again, I just realized that I omitted a detail... it'll be ok on v1.5.1 sorry. @Boost Thanks 🙂 . You can check if mysqldump is avail. on the config page. And if needed, to be sure that mysqldump is found, you could run some tests, also make sure - with Duplicator 1.4.29 - that the binary zip is available. Duplicator v1.5.0 show you this information on the module configuration page, with some more friendly exec return code error when the script run (see link at the end of this post). Some suggestions/debug steps if needed: is mysql in env path and runnable? with normal user type `mysqldump` and `zip` if #1 is ok, try with user/group assigned to your web server, eg. with www-data: sudo su www-data -s /bin/sh mysqldump zip For `mysqldump` only - grab the dump script there and adjust variables in order to make a test cd /path/to/site/assets/cache sudo wget https://raw.githubusercontent.com/flydev-fr/Duplicator/v1.5.0/scripts/mysqldump.unix.sh sudo nano ./mysqldump.unix.sh and set correct or dummy values (or with vim, etc..) sudo chown www-data:www-data ./mysqldump.unix.sh sudo su www-data -s /bin/sh chmod +x ./mysqldump.unix.sh run a test: ./mysqldump.unix.sh Anyway, you should grab the last version I just release before messing with it, because if the issue is that zip isn't available, it will fallback using WireZipFile. Edit: Just a word, I got this issue and it was zip that was missing (about exit code 2). https://github.com/flydev-fr/Duplicator/blob/8d2ee3c0327baf4cee0128b12a0724d20dadfb53/Classes/BackupDatabase.php#L253-L270
  23. Hi @protro Rainbowkit is a really good package but last time I checked it (some months ago) I could see that it's built on wagmi, which is only working with React and then didn't paid so much attention to it as I am only coding on Svelte. Recently I saw popped a port of wagmi on svelte but still not tested it. FYI, the inertia module linked miss a little update, and the samples provided you will found are deprecated and are built using webpack. Did you have some experience with JS libs or frameworks (I mean vue, react or svelte) ? If not, I suggest you to start on Svelte as it's really the easier and natural frameworks to start on without experience. Anyway, as you said it, links above will helps you for sure. With any app sample you can find, you just have to send an ajax request to your ProcessWire page/template to get an answer with the required api keys/tokens/ whatever you need. Example: // 1. create a template called `web3` with a text field called `apikey` // 2. create php template in `site/web3.php` and leave it empty with no code // 3. create a page called `web3` with template `web3` // 4. in `init.php` write: // this function will help you to fight CORS issue between your app and pw site function cors() { // Allow from any origin if (isset($_SERVER['HTTP_ORIGIN'])) { // Decide if the origin in $_SERVER['HTTP_ORIGIN'] is one // you want to allow, and if so: header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); header('Access-Control-Allow-Credentials: true'); header('Access-Control-Max-Age: 86400'); // cache for 1 day } // Access-Control headers are received during OPTIONS requests if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) // may also be using PUT, PATCH, HEAD etc header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}"); exit(0); } } /** * Example of a simple router using ProcessWire's built-in URL hook system. * By appending /json to any page URL, you'll get a JSON representation of the page * * Require ProcessWire 3.0.173 or newer. * see: https://processwire.com/blog/posts/pw-3.0.173/#outputting-json-data-about-any-page-when-the-last-part-of-the-url-is-json * * Note that this is a very simple example. For more advanced routing, you might want to * use a Process module like AppApi made by @mauricio. * */ $wire->addHook('(/.*)/json', function($event) { $page = $event->pages->findOne($event->arguments(1)); // fight cors (for test purpose only) cors(); if($page->viewable()) return [ 'id' => $page->id, 'url' => $page->url, 'title' => $page->title, 'apikey' => $page->apikey ]; }); // from any javascript lib or framework, send a request and get an answer const response = await fetch("https://localhost.local/web3/json"); const data = await response.json(); console.log(data); // <-- contain json answer /** { id: 1000, url: "https://mywebsite.local/web3", title: "web3 page", apikey: "API-ABCD-0123" } */ I've fallen behind on the vite and inertia module release, but it's coming, it's a matter of days, I suggest you to wait for it and try the web3 sample coming.
  24. Hi and welcome @ryangorley 👋 1. give a read to: https://processwire.com/about/what/ and 2. refer to #1 3. the very first one tool you and the team need while working with ProcessWire is: https://adrianbj.github.io/TracyDebugger/#/ https://processwire.com/talk/forum/58-tracy-debugger/ ✨Suggestions: - keep an eye on @Robin S gems (modules) handy on every situation: https://github.com/Toutouwai - subscribe to weekly.pw - and do not hesitate to search and use the forum, even for "i will feel dumb" questions. Enjoy 😄
  25. Yes, and I misread your post, I didn’t paid attention that the site is served from MAMP through prepos proxy. And as you already spot, they are transformed in your bundle source. Keep in mind that all process calls are Node.js things and aren’t available in the browser. Anyway, on the example of Alchemy, the api key is made for you, what I mean is, the front app make a request to ProcessWire endpoint, then the needed requests are made from ProcessWire to alchemy endpoint using your api key stored on server side, eg. in template or module, db, .env file/process, then Alchemy answer your server, and finally, ProcessWire send back the response to the front app. It seem you got the idea. What is complicated on your side, if I can help? If is just to test and see external services like alchemy from local, just do not scratch your head to much, and use them as they are, included in the bundle. Using env variable on this case make things easier than going into the source code to change them.
×
×
  • Create New...