-
Posts
472 -
Joined
-
Last visited
-
Days Won
1
Everything posted by FrancisChung
-
Bootstrapping Processwire in PHPUnit
FrancisChung replied to FrancisChung's topic in General Support
I've turned on debugging on PW, and this was the stack trace returned. --------- /Applications/MAMP/bin/php/php5.5.26/bin/php /private/var/folders/m4/x0zynvp96jx6tndn0f5k2jc40000gn/T/ide-phpunit.php --configuration /Users/FrancisChung/Sites/Develop/site/templates/php/tests/phpunit.xml Test\ImageTest /Users/FrancisChung/Sites/Develop/site/templates/php/tests/ImageTest.php Testing started at 19:39 ... Fatal error: Exception: SQLSTATE[HY000] [2002] No such file or directory (in /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php line 186) #0 /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php(76): ProcessWire->load(Object(Config)) #1 /Users/FrancisChung/Sites/Develop/index.php(238): ProcessWire->__construct(Object(Config)) #2 /Users/FrancisChung/Sites/Develop/site/templates/php/tests/ImageTest.php(3): include_once('/Users/FrancisC...') #3 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php(56): include_once('/Users/FrancisC...') #4 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php(38): PHPUnit_Util_Fileloader::load('/Users/FrancisC...') #5 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php(39): PHPUnit_Util_Fileloader::checkAndLoad('/Users/FrancisC...') #6 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/p in /Users/FrancisChung/Sites/Develop/index.php on line 253 Call Stack: 0.0022 360216 1. {main}() /private/var/folders/m4/x0zynvp96jx6tndn0f5k2jc40000gn/T/ide-phpunit.php:0 0.0196 1189816 2. IDE_Base_PHPUnit_TextUI_Command::main() /private/var/folders/m4/x0zynvp96jx6tndn0f5k2jc40000gn/T/ide-phpunit.php:552 0.0196 1196856 3. PHPUnit_TextUI_Command->run() /private/var/folders/m4/x0zynvp96jx6tndn0f5k2jc40000gn/T/ide-phpunit.php:294 0.0356 1882640 4. PHPUnit_Runner_BaseTestRunner->getTest() /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/TextUI/Command.php:123 0.0356 1882688 5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php:67 0.0365 1906040 6. PHPUnit_Runner_StandardTestSuiteLoader->load() /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php:123 0.0370 1947752 7. PHPUnit_Util_Fileloader::checkAndLoad() /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php:39 0.0370 1947952 8. PHPUnit_Util_Fileloader::load() /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php:38 0.0376 1987008 9. include_once('/Users/FrancisChung/Sites/Develop/site/templates/php/tests/ImageTest.php') /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php:56 0.0384 2035400 10. include_once('/Users/FrancisChung/Sites/Develop/index.php') /Users/FrancisChung/Sites/Develop/site/templates/php/tests/ImageTest.php:3 0.0768 3906672 11. trigger_error() /Users/FrancisChung/Sites/Develop/index.php:253 Error: Exception: SQLSTATE[HY000] [2002] No such file or directory (in /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php line 186) #0 /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php(76): ProcessWire->load(Object(Config)) #1 /Users/FrancisChung/Sites/Develop/index.php(238): ProcessWire->__construct(Object(Config)) #2 /Users/FrancisChung/Sites/Develop/site/templates/php/tests/ImageTest.php(3): include_once('/Users/FrancisC...') #3 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php(56): include_once('/Users/FrancisC...') #4 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Util/Fileloader.php(38): PHPUnit_Util_Fileloader::load('/Users/FrancisC...') #5 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php(39): PHPUnit_Util_Fileloader::checkAndLoad('/Users/FrancisC...') #6 /Users/FrancisChung/Sites/Develop/site/templates/composer/vendor/phpunit/p This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. Process finished with exit code 255 -
Hi there, I'm having trouble getting Processwire to boostrap into PHPUnit. It used to work but it's stopped working for some inexplicable reason. I'm getting the following error message. Error: Exception: SQLSTATE[HY000] [2002] No such file or directory (in /Users/FrancisChung/Sites/Develop/wire/core/ProcessWire.php line 186) I have included one of the tests that uses Processwire boostrapping.ImageTest.php My other tests are working fine, just the ones that need Processwire bootstrapping is broken. FYI, I've tried bootstrapping externally using --boostrap option using phpunit in CLI, but it did not work.
-
Trouble Debugging ProcessWire using XDebug + PHPStorm
FrancisChung replied to FrancisChung's topic in General Support
I seem to recall this could fix in the next release, but don't quote me on that as my recollection is rather hazy at the moment. -
Did a deployment today where I did a backup of the live environment first, but the backup script skipped copying .htaccess. Had to abort the install and redid the deployment and I started to get an error message saying "The requested URL was not found on this server". Funny enough, the home page would load perfectly though. After 15m of doing my best headless chicken impression, I realise the .htaccess file was missing. Luckily I managed to find a copy from a backup several versions back. Thought I'd share this in case people didn't fancy doing the chicken dance in the office ...
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
FrancisChung replied to Nico Knoll's topic in Modules/Plugins
You're right about the head & body tags gone AWOL. Looks like Pro-Cache is removing them(!!) as they returned when I turned it off I will get on the appropriate forum. Danke LostKobrakai -
MarkupSEO - The all-in-one SEO solution for ProcessWire.
FrancisChung replied to Nico Knoll's topic in Modules/Plugins
Hi there, I've discovered a bug yesterday that only seem to affect the Module in certain conditions. MarkupSEO seems to work ok on our site but when crawlers or SEO Profilers tries to profile our site, the module seems to encounter an error in a class construction stage and stops. For a long time, I actually thought this was due to the Blog Module I had installed (Long story short i had lots of installation issues) and there's a particular error message that started occurring around that time in our system that I always attributed to the Blog Module Installation. Everything was working as far as I know, so I dismissed the errors as not something critical. We kept getting messages from profilers/crawlers that stated they couldn't read our Meta Tags (which is produced by MarkupSEO) but when we would inspect our HTML on our servers and also on test servers, we could see all its presence. So it baffled us for a quite a while. Then I stumbled on a SEO Profiling tool that actually showed the HTML it was using to profile, and I couldn't see any tags MarkupSEO produced. That's when I realised there must have been an error with the Module instantiating and doing its task, when it was crawlers or profilers using the site. So when I had a look at our error logs I realised that this reoccurring mysterious error was in fact originating from MarkupSEO. My guess for the cause of the error is a change in how they implemented class construction in one of the different PHP versions. I'm still running on PHP 5.5 on our server and my guess is that crawlers and SEO Profilers are on a newer PHP version and there's some problems instantiating on a newer version. This was the profiling tool I used to discover the error: http://www.seocentro.com/tools/search-engines/metatag-analyzer.html This is an example error log 55 minutes ago 2015-12-21 10:14:29 guest / SQLSTATE[HY000]: General error: could not call class constructor [pageClass=Page, template=] Happy to provide any additional info that you might need. The site I'm working on is called sprachspielspass.de just in case if it works on other test sites you've chosen -
Thanks for the feedback Adrian. I've had some mixed results with the Migrator. It worked for some of our content but it didn't seem to work for Blog Articles i was trying to export. But I've realised the Blog are complex objects that have a lot of dependencies and I may have not specified them correctly. The Blog articles i'm using are part of the ProcessBlog module. All in all it's been positive overall and I think it's probably best for me to stick to simple pages or objects when it comes to the Migrator. I look forward to the bug fixes and I hope it gets the love and attention it deserves.
-
Thanks Ivan for the quick reply. Looks promising. Will check it out and update on progress.
-
Hi there, I was wondering if there's a module that allows me to copy certain pages or content from one instance of Processwire to another instance? Unfortunately, I can't copy a whole instance across as there needs to be some major cleanup job performed and it won't get done in time. Otherwise, if anyone has any code samples that would be much appreciated.
-
Any PHPStorm users here who uses phpUnit? Setup question
FrancisChung replied to FrancisChung's topic in General Support
After spending hair pulling hours & days, I've figured it out. I basically had to create a seperate phpunit.xml configuration file and go from there. The details are in : http://stackoverflow.com/questions/34225720/keep-getting-you-cannot-serialize-or-unserialize-pdo-instances-in-phpunit-usin/34231873#34231873 -
Any PHPStorm users here who uses phpUnit? Setup question
FrancisChung replied to FrancisChung's topic in General Support
I'm revisiting this question again as I haven't had time to tackle it until now. I've managed to get it working via the Composer route. Here are some links I used in case others are having issues. http://stackoverflow.com/questions/18310259/cannot-find-phpunit-in-include-path-phpstorm (last answer) https://jtreminio.com/2013/03/unit-testing-tutorial-introduction-to-phpunit/ https://www.jetbrains.com/phpstorm/help/enabling-phpunit-support.html (2nd item) You may also need to mark your test directories under preferences -> project -> directory Now I'm stuck on this error message "You cannot serialize or unserialize PDO instances" when running my tests. It appears when I bootstrap the test to Processwire index.php. Various publications have stated that I need to disable process isolation but it hasn't worked for me so far. I was wondering if there's any other settings I need to do to make this work? Edit: Now a Stackoverflow Question as well http://stackoverflow.com/questions/34225720/keep-getting-you-cannot-serialize-or-unserialize-pdo-instances-in-phpunit-usin -
It turned out to be a line break in some of the rows which I couldn't spot with the various text editors I was using .... Aaargh .... I'll probably have to strip them out before I process the file again. Again, thanks for the prompt responses. You guys are the best!
- 6 replies
-
- $Page
- Bulk Upload
-
(and 5 more)
Tagged with:
-
Unfortunately, it seems to be an encoding issue. The file was encoded in UTF8-BOM which has been fine reading German Umlaut characters up until now. But it seems the newest entries are returning blanks when there's entries in the tab delimited file.
- 6 replies
-
- $Page
- Bulk Upload
-
(and 5 more)
Tagged with:
-
I've tried setting ini_set('max_execution_time', 600); Unfortunately it hasn't fixed my issue. I will try and add more debugging info into the code and try and get to the bottom of it. I did a rough count of the rows and the rows in logs does not match the rows in the tsv files. I will have to take a closer look. Thanks for the heads up about the execution script time and the row count
- 6 replies
-
- $Page
- Bulk Upload
-
(and 5 more)
Tagged with:
-
Hi there, I've got some code that bulk uploads the contents of Tab Delimited files into our Processwire CMS. It looks like the $page->save functionality stops working after a certain number has been processed. Haven't worked out where it starts failing yet but all the rows towards the bottom have certainly failed. Unfortunately, there isn't anything in the error logs (at least the php error log) to see if there is an issue. I have tested the rows that were not working by putting them individually in seperate tsv files to prove that the code works, the data is clean and it actually updates the CMS. I was wondering if there's an internal limit on how many page saves the CMS can handle? Thanks in advance. Below is the copy of the code I'm using to do a bulk upload. I'm using a 3rd party module called SimpleExcel to help with the reading and processing of the tab delimited files. $_rowStart = 13; $_colTitle = 1; //A $_colMeta = 10;//J Meta Title = SEO Title $_colDesc = 11;//K $_colURL = 12;//L $_colURLnew = 13;//M $_colCanonical = 14;//N $_colAlt = 15;//O $_colKeywords = 16;//P $excel = new SimpleExcel('TSV'); $excel->parser->loadFile(__DIR__."/{$file}"); //$url = $excel->parser->getCell($_rowStart, $_colURL ); $row= $_rowStart; do { $title = $excel->parser->getCell($row, $_colTitle ); $meta = $excel->parser->getCell($row, $_colMeta ); $desc = $excel->parser->getCell($row, $_colDesc ); $url = $excel->parser->getCell($row, $_colURL ); $urlnew = $excel->parser->getCell($row, $_colURLnew ); $canonical= $excel->parser->getCell($row, $_colCanonical ); $alt = $excel->parser->getCell($row, $_colAlt ); $keywords= $excel->parser->getCell($row, $_colKeywords ); $internal= str_replace("http://sprachspielspass.de",'',$url); $page = wire(pages)->get("path=$internal"); //TODO: Error handling and logging if (!IsNullPage($page)) { $page->setOutputFormatting(false); $page->title = $title; $page->seo_title = $meta; $page->seo_description = $desc; $page->url = $urlnew; $page->seo_canonical = $canonical; $page->image_alt = $alt; $page->seo_keywords = $keywords; $page->Save(); WriteLog("{$internal} saved"); } else { WriteLog("{$internal} NOT FOUND!"); } $row++; } while (!IsNullOrEmptyString($url));
- 6 replies
-
- $Page
- Bulk Upload
-
(and 5 more)
Tagged with:
-
Hi Kongondo, Is there a way of copying or preserving the blog posts on 1 database to another? My users want the ability to auto-publish the blog articles, and it looks like it's possible but I would need to reinstall the Blog Module again with some pre-requisite modules preinstalled first? I'm guessing reinstalling the Blog Module would result in the loss of the blog articles.
-
Could this module be extended to have an offline mode, something we can use whilst we do an upgrade or install of the site?
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
FrancisChung replied to Nico Knoll's topic in Modules/Plugins
I've just noticed that removing the GA Code from MarkupSEO and saving the settings results in all the SEO data previously entered being deleted. Is this by design, or more likely a bug? Luckily, we bulk upload our SEO settings via Spreadsheet/PW Custom code so it was easy to restore the values. I've had several of these messages logged for the different SEO fields "Deleted field "seo_tab_END" data in 0 row(s) from 0 page(s). [page-by-page]" -
Howto: add a banner that rotates pictures ?
FrancisChung replied to motionmindz's topic in Getting Started
Well when the day comes when I have to look back, I'll certainly give jssor & process slider a serious look. Thanks. -
Howto: add a banner that rotates pictures ?
FrancisChung replied to motionmindz's topic in Getting Started
Stumbled upon here whilst looking for some sort of Ad Banner Module for Processwire. Figured I might as well share some of my experiences. I've used Slick and Owl Carousel before. Chose Slick as it was recommended by Foundation when they deprecated their Orbit slider. Slick was nice until I realised the slider arrows didn't look very nice in Mobile and couldn't work out how to readjust or disable it. There was another visual bug which I can't recall at the moment which lead me to switch to Owl. Haven't looked back since. BXSlider looks interesting and perhaps it'll save the day if Owl plays up in the future. -
Hi fellow Processwirers (?), I was wondering if anyone here uses PHPStorm in conjunction with PhpUnit? In particular, I'm trying to get it to work with Processwire so I can incorporate the Pages & other intrinsic Processwire objects into the testing. Any example or real life configuration examples would be most welcome. Thanks in advance.
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
FrancisChung replied to Nico Knoll's topic in Modules/Plugins
Just a small feature request. Any chance of added an option to do Enhanced Link Attribution? All it requires is an additional line of code to the Google Analytics code that is already generated (highlighted in Red) I will probably modify my local MarkupSEO module code for now but it would be great to see it as part of the official code branch. P/S I'm a fan of the module. Would happy to buy some beers to show my appreciation. ga('create', 'UA-XXXX-X'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); -
+1 and Christmas is coming up ...
-
Hi, I've noticed the following entries in my PW error log SQLSTATE[HY000]: General error: could not call class constructor [pageClass=Page, template=] The following is the associated link that is logged as well. http://localhost:8888/processwire/page/list/?id=id&render=render&start=start〈=lang&open=open&mode=mode Any ideas where I can look to get to the bottom of this?
-
- Page Renderer
- Page
-
(and 5 more)
Tagged with:
-
Thanks for the valuable advice, Mr-Fan! The custom admin module and the Batch Child Editor looks really useful. Especially the Batch Child Editor. Just looked at some PW showcase websites featuring ListerPro and definitely on the shopping list