Jump to content

Hector Nguyen

Members
  • Content Count

    20
  • Joined

  • Last visited

Everything posted by Hector Nguyen

  1. @MoritzLost Do you encountered any issue with the autoloader? I used this inside public/site/init.php require __DIR__ . '/../vendor/autoload.php'; But the autoloader cannot work properly, it is saying my namespace is undefined 2021-04-14 08:38:10 nntoan http://xxx.test/ Fatal Error: Uncaught Error: Call to undefined function QFramework\Phrase() in /srv/users/capima/webapps/xxx/releases/1/public/site/templates/home.php:10 Stack trace: #0 /srv/users/capima/webapps/xxx/releases/1/public/wire/core/TemplateFile.php(318): require() #1 /srv/users/capima/webapps/xxx/releases/1/public/wire/
  2. @ryan I'm afraid not, fget() in PHP will return one string (a line) but fgetcsv() will return an indexed array. An array in PHP is not very friendly with big dataset because it's still saved into the memory! The main difference is in memory usage. In the first case all the data are in memory when you return the array. Because of no matter what, if you "returns" values, that will be save in memory. In the second case you get a lazy approach, and you can iterate the values without keeping all of them in memory. This would be a great benefit when memory is a constraint compared to the s
  3. I think you could try the generators here while you are playing with CSV. For .eg <?php function getRows($file) { $handle = fopen($file, 'rb'); if ($handle === false) { throw new Exception('open file '.$file.' error'); } while (feof($handle) === false) { yield fgetcsv($handle); } fclose($handle); } // allocate memory for only a single line in the csv file // do not need the entire csv file is read into memory $generator = getRows('../data/20_mil_data.csv'); // foreach ($it as $row) {print_r($row);} while ($generator->valid()) { print_r(
  4. Will all plugins from 2.7.x or 2.8.x will works on 3.x version? In the plugin directory I saw only few plugins compatiable with 3.x, that is why I asked 3.x or 2.x. Another question is can I manage my own plugin via composer? Or can we install ProcessWire via composer? For some not so secret reasons, I marriaged with Composer
  5. Regarding to #5 (config files), ProcessWire does store database configuration in site/config.php, isn't it?
  6. Hi @szabesz, thanks for your interesting. I've created poor documentation here: https://magephp.github.io I'm using GitLab and GitLab CI for all projects I had. So the purpose of the tool is, whenever I have a new push or accept merge request to production branch (master) or staging branch on GitLab. GitLab CI will start building my project and execute Magallanes deploy command. The repo changes content will be pulled to my server as a new release, and that release directory will be symlink to my `public_html` directory. I'm using 2 environments: production and staging.
  7. Hello everyone, I didn't play much with ProcessWire, my project has just started and I have no experience about how ProcessWire will be when go live. I'm using a tool to deploy my code automatically to production server after build passed (Magallanes). Please give me the answers for the questions below: Which folders/files will be created by the application after installed ? Which folders/files usually be overwritten? Which folders/files using as cache, as session, as temporary? Do ProcessWire supports logs? If so, where is it? Which files are using as c
  8. One more question, which version I should use? PW 2.7 or 3.0? Is there any comparison between 2 version above? I tried myself both of them and see no differences at all.
  9. I'm sorry if content is duplicated, but I'm wondering if it work with 3.0 version?
  10. Thanks to @mr-fan and the others It's more clearly to me now, so I may have Categories/Category, Books/Book but Chapter will standalone? I also taking a note and stick it into my screen: "Pages is everything in PW". Thank you (all of you and yes you) once again, I'm trying it right now and will come back soon
  11. Hi @szabesz, As my understanding, you recommend me to use one-to-many to solve relationship in my case, right? But there are two things confusing me right now: How does Chapters/Chapter make sense in my case? Because there are thoudsand of chapters for a book, so if I use relationship like Chapters/Chapter, it mean one "Chapters" template contains million of "Chapter" templates. How can I living among them? Quite confused to me
  12. I know that package, but seems people forgot about them nowadays so I pick that name
  13. I'm using NodeQuery to monitor all servers I have. It is SaaS and quite useful to me.
  14. Actually, mobile shell is what I'm using at this moment not mine script. But mosh is in heavily development and it denied to work with mouse scroll then in few hosting providers, they doesn't allow you to white list port range (scaleway.com for example). That is why I have to write this to use it in few case. Like SSH tunneling or NAT....
  15. Hello there, If you are the guy who is living in terminal like me, then I assume that you will love this script If you usually SSH-ing to servers, then I believe you used to have headache when you are trying to keep your SSH sessions alive. Most of them can resolve by adding this to your ~/.ssh/config Host * ServerAliveInterval 60 But if you are working in a company or you are connecting to Interet through VPN/Proxy, then your SSH sessions are really unstable. Like this: Write failed: broken pipe packet_write_wait connection to: XXXXX To use this script, you c
  16. Let me explain it quickly, Your original bash script need to be modify whenever you want to backup other database or same database but different server or the damn path. I really do hate it, it will take me over than 30 seconds. That is why I wrote this one to automate that. The purpose of this script is let you enter all needed information to the shell (I also added history to this script, then next time if you still using credential, just press up or down to navigate among them) instead of open the script with vim editor, change them one by one. Of course it is slower if you h
  17. I added interactive mode into your script, hope it helped to someone is too lazy like me #!/bin/bash #---------------------------------------------- # INTERACTIVE REMOTE DATABASE DUMP SCRIPT #---------------------------------------------- # This work is licensed under a Creative Commons # Attribution-ShareAlike 3.0 Unported License; # see http://creativecommons.org/licenses/by-sa/3.0/ # for more information. #---------------------------------------------- SCRIPT=${0##*/} IFS=$'\n' HISTFILE="$HOME/.remotedump.history" # Use colors, but only if connected to a terminal, and that termin
  18. Hello @szabesz, Thanks for replying to my topic, as far as my understanding now. All fields are belong to a template, so I can add as much as possible fields to the template right? And in my case, I may have 2 templates, one is book and the other is chapter. I may have template to manage the categories too, because book should be manage under categories. So it will look like this in my imagine: CATEGORY TEMPLATE Category ├── Title ├── Static Block └── Thumbnail BOOK TEMPLATE Book ├── Title ├── Author ├── Publisher ├── ISBN ├── Type (traditional or comic) ├── Rating └─
  19. Hello PW-ers, I'm a newbie to this CMF, and totally fallen in love with this sexy framework. I knew that ProcessWire documented very well, but nothing is faster to handle a new framework than building a new project. The application (reading online book) I want to build will be same like normal CMS but, It should have fields / entities like this: Books Books > Chapters (a book may have over thoudsand of chapters) Authors Publishers Posters (Book may be uploaded by any registered members) Images (Thumbnail, it should be picked and uploaded vi
  20. There's nothing in my mind.

  21. Hello fellers, I've just arrived to this adorable and beautiful CMF. I tried to find a section which contains all general settings like admin themes, site name, site timezone..etc.. for 15 minutes. Could anyone else here please tell me how could I find it? And is there any resources like ebooks, video I need to dig-in? Thanks.
×
×
  • Create New...