FrancisChung

Members
  • Content count

    252
  • Joined

  • Last visited

Community Reputation

127 Excellent

About FrancisChung

  • Rank
    Sr. Member

Profile Information

  • Gender
    Male
  • Location
    Berlin

Recent Profile Visitors

1,791 profile views
  1. @Sérgio, you post made me think that it would be really great if there was a website where you answered some (or many?) multiple questions about your project and it would recommend a combo of frameworks based on your answers, as well as some alternatives. Of course, it may not be the best combination in all scenarios but it would save you a ton of time researching or thinking about it. And of course, Processwire would always be the recommended CMS of choice hehe.
  2. If you look at the manual setup steps of Foundation, you'll see they ask you to install bower. So I assume it must be part of the Auto setup somewhere not visible to the user. For reference, I have my bower_components folder under the templates folder. Perhaps, you should just leave alone the folders as eventually you'll have to update components over time and unless you want to tinker with extra steps during the update process best just to leave it as it is.
  3. Wow quick reply! If only Guetzil was as speedy and compact like your response, @AndZyk That post was ace. Thanks.
  4. Just realised most of PW tables are MyISAM so the -single-transaction flag is kinda useless absolutely futureproof.
  5. Out of interest, how much would the TinyJPG compressed image be ?
  6. @szabesz @pwired : Sorry for the late response. Been very busy with a deadline that inevitably dragged on and on ... For those who are interested, I've got the following for automating my deployment. By all means, it's not perfect nor is it complete but it does the job with a minimal investment of my time. I have structured my DB scripts into 2 categories. The dump_<xxx> scripts and the restore_<yyy2zzz> scripts. The dump scripts are to dump the DB contents as a whole where <xxx> signifies an identifier to the DB you're dumping (e.g. Dev, UAT, Live etc). So my dump_local.sh script looks like #!/bin/bash _now=$(date +"%Y%m%d") _file="../dumps/Dump$_now-LOCAL.sql" echo "Starting Dump to $_file..." /Applications/MAMP/Library/bin/mysqldump -h localhost -P 8889 -u root -p'PasswordHereWithTheQuotes' --single-transaction [DBNAME] "$_file" echo "Dump to $_file finished" Key things to note here is : 1) 1st line of code generates a datestamp 2) It then creates a path of the dump file in the dump folder 3) Then it calls MySQLDump using the predefined parameters. Obviously this is for my local installation, so for a server dump file you'll want to change the dump suffix (from LOCAL to DEV,UAT,LIVE or whatever), the hostname, user, password, port (which will be different to 8889 most likely. Mine is 3306 on our service provider) and DBName. If you;re wondering what the single transaction flag is ... The restore files are similar except for my scripts, I've chosen to do a specific one for each XXX2YYY variation. Not the most efficient, but I'm not a bash script ninja either. XXX being Source, YYY being destination in case your'e wondering. So my restore_local2dev.sh looks like : #!/bin/bash _now=$(date +"%Y%m%d") _file="../Dumps/Dump$_now-LOCAL.sql" echo "Starting restoring from $_file to dev ..." /Applications/MAMP/Library/bin/mysql -h [HostDBServerAddress] -P [HostDBServerPort] -u [HostDBUserLogin] -p'[HostDBUserPwdInSingleQuotes]' [HostDBName] < "$_file" echo "Restoring from $_file to dev finished" Notes : 1) I'm using mysql instead of mysqldump here 2) I'm assuming you already created a dump today of the DB file you're uploading (line 2 & 3) 3) There's a bit more involved here with the parameters but I hope the long descriptive labels are self explanatory. Feel free to contact me on this forum if you're unsure. By all means these should cover the basics that you need. Things to improve upon are obviously in the security side of things. There's -ssl options and SSL certificate options that I haven't looked in at detail. If anyone is using them and willing to give us a quick primer ....
  7. I <3 PW but I'm definitely not in love with PHP
  8. I just wanted to update saying the module doesn't work. The problem is that the actual PHP module it depends on, mobiledetect.php is using $_SERVER['HTTP_USER_AGENT'] which is an outdated way of detecting devices from the server. It failed on Safari where it couldn't distinguish whether you were using it from the Desktop or a mobile device. (You could argue PHP is probably not the way to go, compared to JS but that's another post ) I must have tried every PHP based solution out there in the last couple of weeks. The only thing that has worked for me is UserAgentInfo. I'm posting an example here, in case some one wants to update this module function IsMobile() { $ua = UserAgentInfoPeer::getMy(); $mobile = $ua->isMobile(); return $mobile; } P/S You will need to add a reference to this class (You may need to change the path to suit your code structure) require_once(__DIR__.'/../vendor/UserAgentInfo/UserAgentInfoPeer.class.php'); and then you may need to configure UserAgentInfoConfig class if the caching mechanism (Redis by default) is not what you want. Just change the CACHE_CLASS_NAME to the class you want. //const CACHE_CLASS_NAME = 'UaiCachePhpredis'; //Not installed locally //const CACHE_CLASS_NAME = 'UaiCacheMemcached'; //Not installed on Provider //const CACHE_CLASS_NAME = 'UaiCacheAPC'; //Not installed on Provider const CACHE_CLASS_NAME = 'UaiCacheDebug'; FYI I had to go for the non cached version (UaiCacheDebug) because of the hosting solution we currently have (i.e. el cheapo solution)
  9. I have some automated scripts that dump the whole database into a file and uploads that to a dbserver and db of choice. I use this to do my deployments for testing and going live. I normally don't touch config.php unless there's been a version upgrade of PW. Let me know if you're interested and I can post it here.
  10. Are you using a VPN or anything that is changing your IP Address? I normally see this when my IP address has changed and I try to login to the backend again.
  11. @adrian, it was failing on this 1 particular call. All the other calls were working fine. In any case, I will change it to "pages" as it's the correct method.
  12. I've used wire(pages) everywhere on my codebase. This was the first time I've had an issue with it. I probably will leave it alone but I'll keep your post it mind. Thanks for the pointer, @Christophe. Much appreciated.
  13. The problem turned out to be a bug in PW 2.6.1. I didn't realise my local PW version was on 2.8.35 and not 2.6.1. The bug was in $ad = wire(pages)->get("/ads/")->children->getRandom(); It was not returning an object in PW 2.6.1 despite data being present. Live and (hopefully) learn ....
  14. Hi there, I'm having a weird issue with the instanceof operator where it works locally and not on my server. I'm using PW3 + PHP7. I've posted the question on Stackoverflow but I was wondering if anyone here have seen it? http://stackoverflow.com/questions/42552855/php-instanceof-works-locally-but-not-on-host-server Thanks in advance.
  15. I've just installed it on a PW 3.x site. It seems to detect Desktop correctly but I think it's returning an empty string for mobile. Haven't tested for Tablet but for my purposes I can live with this as I'm only interested in whether it's Desktop or not. Will update if it can't detect Desktops correctly. if (wire(config)->mobileDetect->deviceType<>'desktop') { .... }