-
Posts
418 -
Joined
-
Last visited
-
Days Won
4
Everything posted by WireCodex
-
Today I found out that querying WireArray is a lot slower than querying the database. First I implemented the first piece of code, and after that I wanted to optimize it thinking that consulting the database only once and then searching in the Wirearray will be better, but I discover that this is not an optimization, instead it's slower 2/3 times! $today = strtotime('today'); $month = strtotime('first day of this month'); /* DATABASE QUERY = FASTER */ $shipments_active = count($pages->find("template=page-shipment,ship_status=1")); $shipments_today = count($pages->find("template=page-shipment,created>$today")); $shipments_month = count($pages->find("template=page-shipment,created>$month")); /* WIREARRAY QUERY = SLOWER */ $shipments = $pages->find("template=page-shipment"); $shipments_active = $shipments->find("ship_status=1")->count(); $shipments_today = $shipments->find("created>$today")->count(); $shipments_month = $shipments->find("created>$month")->count(); Is this normal? Is there something I'm doing wrong?
-
Check here: https://www.gethalfmoon.com
-
Free Postman alternative: https://chrome.google.com/webstore/detail/apidebug-http-test/ieoejemkppmjcdfbnfphhpbfmallhfnc https://chrome.google.com/webstore/detail/postwoman-http接口调试插件/hoeapaidnfedjfbdghipliboclcighij PS: same extension, different name
-
Looks interesting: https://pinegrow.com/tailwind-visual-editor
- 1 reply
-
- 2
-
-
I have this implemented as a REST service and not as a script. I just tested the task scheduler on the server by calling the endpoint and it worked perfectly, the app did not freeze. I have read that this happens when you make the curl call (I use wirehttp) from the browser. I was testing the app using a Chrome extension very similar to Postman, perhaps it is the cause of the problem.
-
Hi @androbey and @Craig thanks for your support! I finally found the bottleneck and it's not in the database itself. So I'll rollback to MyISAM, because I can't limit the system to search in the DB using the customers email. Already tested write speeds on both engines and it's very similar, at least in the order of the 100s of pages. The problem really is PHP, specifically curl, fopen, etc. when you execute a http request, these commands block php until it receives a response. Additionally, some of the web services that I use have a rate limit, which sometimes slows down the service responses. This really doesn't worry me if it happens in the background, because I don't need to have the data in real time. But when you join curl limitations and the rate limit together, the entire app stops, sometimes up to 30 sec! that is inadmissible. I will look for a solution, and I will let you know here. I think PHP should improve this if it wants to remain as an application development option. It must be updated to the new times, now almost everything is based on third-party services and the iterations between platforms, and everything flows through http calls.
-
https://bugs.mysql.com/bug.php?id=74042 https://stackoverflow.com/questions/25088183/mysql-fulltext-search-with-symbol-produces-error-syntax-error-unexpected https://stackoverflow.com/questions/8961148/mysql-match-against-when-searching-e-mail-addresses You found a solution? @ryan this is a comment from the second link: I fixed this same issue, (not a syntax error either - only occurs when string has '@' in it) and i fixed by changing to NATURAL LANGUAGE MODE instead of BOOLEAN MODE
-
I checked other parts of the app and everything looks good, only that template file have the problems, this is the code in the file: $data = $page->page_information; // this is a YAML field // more code here $warranties = $pages->find("template=page-warranty, page_information*=customer_email: {$data->customer->email}"); That working before on MyISAM version.. here I want to find product warranties related to the current email address
-
This is the query string that Tracy show: queryString => "SELECT pages.id,pages.parent_id,pages.templates_id,MATCH(field_page_information.data) AGAINST('customer_email: user@domain.com') AS _score_field_pa ... " This email is a parameter I asked for, to find other related pages, I just discovered that the error is not on saving is when I try to show the page on the front-end
-
I'm in big trouble, I'm almost finished a big project (about whole year of work) and now when I'm preparing it for production, I find that if I create a lot of pages in bulk, the site hangs until the transactions are finished. This is a webservice that imports information in background from third parties. I had always done the tests with little information, but now in real use it's a big problem because every time the script runs the whole site halt. The problem is when I start the project I leave the database Engine in MyISAM default setting without predicting the problem and now I need to change it to InnoDB, I already converted all the tables using the mysql ALTER TABLE command and add $config->dbEngine = 'InnoDB'; In site/config.php .. Now the site loads perfectly and the administration also, but when I try to save a new page occur an error of type: SQLSTATE [42000]: Syntax error or access violation: 1064 syntax error, unexpected '@', expecting $end .. inside the function "execute" in WireDatabasePDO.php What can I do to solve this? I really need to use InnoDB to be able to write to the DB without blocking the users!
-
Hi @Mats thanks for your module!.. very useful for quick blog posting or a lading page / blocks builder.. and will be perfect if integrate something like this https://glide.thephpleague.com/ ?
- 15 replies
-
- 1
-
-
- media
- stock photo
-
(and 2 more)
Tagged with:
-
https://modules.processwire.com/modules/process-wire-upgrade/
- 2 replies
-
- update site
- update automatically
-
(and 1 more)
Tagged with:
-
This could be a block builder option? https://grapesjs.com/ https://github.com/artf/grapesjs Newsletter demo: https://grapesjs.com/demo-newsletter-editor.html Webpage demo: https://grapesjs.com/demo.html Usage: <link rel="stylesheet" href="path/to/grapes.min.css"> <script src="path/to/grapes.min.js"></script> <div id="gjs"></div> <script type="text/javascript"> var editor = grapesjs.init({ container : '#gjs', components: '<div class="txt-red">Hello world!</div>', style: '.txt-red{color: red}', }); </script> That's it.. I try it before, but I don't know how to build a module ?
-
If you have access to ProFields, it should be easier to use the Table field: https://processwire.com/store/pro-fields/table/
-
In the Items template you can use a Repeater field (Ingredients) with two or three fields: Ingredient (Page reference) + Quantity (Float) + Unit (Dropdown) .. for ml, mg, oz, etc.
-
I suggest you check this website that Ryan created to show the potential of PW, you can see the Frontend, the Backend and the source code on Github: https://processwire.com/about/demo/
-
A piece a cake! ?
-
Check this: https://github.com/blynx/TextformatterFunkyFunctions
-
Oh! ... put it here: https://processwire-recipes.com/about/contribute/
-
RockMigrations1 - Easy migrations from dev/staging to live server
WireCodex replied to bernhard's topic in Modules/Plugins
The Github Sponsors program is still in beta. We need to put a link for donations in each profile of the Developer Directory. -
Yes!.. here: https://processwire-recipes.com/
- 5 replies
-
- autoload
- namespaces
-
(and 2 more)
Tagged with: