alan
Members-
Posts
854 -
Joined
-
Last visited
-
Days Won
1
Everything posted by alan
-
Oh nos... I was convinced I had ruled out any chance it could be session data, browser cache, etc, for example opening the same URL in a browser I don't use for dev. But I think it was somehow polluted session from using the CodeKit url `http://myMacName.local:5757/` rather than the LAMP url that I tell CodeKit is where my site is running in one tab, and the LAMP (non-CodeKit) url in another tab. tl;dr: $user may not behave as expected when previewing on a CodeKit URL, or if you do and another tab is open at the non-CodeKit URL. Takeaway, check this first and/or if I insist on keeping both Admin and end-user view open, at different URLs, use two different browsers.
-
Thanks @tpr, I wondered if I had too and so previously had done a `print_r($user)` and got a dump that looked convincingly like an array of user info, so I assumed I had not overwritten it. But I now see I get the same dumped output whether logged in or not... So that seems to suggest it's not null, is an array but looks like maybe it's an array of stuff that is not the $user object! Thanks for the pointer, I will go back and look harder at that now and report back here, cheers!
-
Thanks @Mustafa-Online - I was pretty certain it was good, now the worse bit, working out what else I have here that's causing this
-
Thanks @Soma for confirming that. I'm confused in that case as I have a site where this test is failing. I'll go back and re-re-check to see if I am missing something else.., thanks again for the sanity check ?
-
Sorry folks if this is obvious to most and I missed something in the docs or here in the forum, but, I have cheerfully used code such as: if($user->isLoggedin()) { echo " loggedIn"; } else { echo " notLoggedIn"; } in PW 2.x sites. Now on a v3 site I am finding even the most basic test to see if the viewer is logged in or `isSuperuser()` is not giving an error but simply doing nothing - not evaluating. For example, the top of a typical template reads: <?php namespace ProcessWire; if($user->isLoggedin()) { echo " loggedIn"; } else { echo " notLoggedIn"; } I have `debug` turned on. Is there something obvious I have missed, perhaps a step required for v3 that's not required for v2 to allow access to $user data? Thanks for any pointers.
-
That's made me think - I could set up a generic domain, like Campaign Monitor use createsend.com, and send all emails from that. May do that if I need the emails to be more anonymous for any reason ?
-
I am sure I have 'bigged' them up before here yes (it was so lovely meeting them after the bottom fell out of Mandrill when then went for DaftPricing™️. I would like to have individual SPF and DKIM records for each client. A few have asked about why emails though apparently from "noreply at Example Inc." are clearly actually from me@mycorps domain if they reply to one. I've told them all that to save them money the emails come from my DKIM'd and SPF'd email address, but I can do the same for them if they pay for my time setting it up. So far all have said "Oh.., that's why eh? Never mind, leave it as is". One day I will go tell each of them they must get their records setup, but it's just one of those things that's on the ToDo that's not shouting to be done 'today'
-
I've no experience with Sendgrid but just in case helpful, I used to use Mandril until they changed their pricing model from reasonable to insane (for small users), at that time I went with Postmark https://postmarkapp.com/ and have had a faultless experience with them for over year over multiple sites (I'm not on a commission ;))
-
Ah! I'd not joined the dots—didn't realize that was you Yep, hear you about the frustrating of getting this type of stuff working when it's not core and you have other stuff you need to be doing. Yep, can't complain that Apple has moved to php 7, and v. glad the clamp dev is about to address this with a fix, better than my hack
-
TL;DR; Selecting a new Radio and saving, the previous one was getting reselected upon refresh. Fix, cleared all browser cache. I had just created the field, so maybe I had a somehow polluted cache, weird. My setup, in case relevant, using clamp and Chrome on a Mac, after creating a set of Radio's, all worked AOK, no errors or odd behaviour, except, usually changing radio and saving the page the Radio was reverting back to the one it had been before. Cleared Chrome cache and totally fixed. Edit: DOH! I think this may have been due to Admin being signed in on another tab—how embarrassing...
-
I've been using clamp http://jide.github.io/clamp/ for a while now, rather than installing MAMP or MAMP PRO. Like MAMP, it delivers Apache, MySQL (via MariaDB), and PHP. Unlike MAMP it runs from the command line (the 'c' in clamp). Also unlike MAMP, all settings and data (database), sit alongside the website files in a .clamp folder (you need to add this to .gitignore to stop dev environment leaking into production). Apart from being free, it's just brilliant to use. If you get errors or stuck, check the logs, the docs are brief but excellent. Enjoy!
-
Thanks @kongondo for that The project has gone to sleep for a bit but I am hoping it will wake up soon and as soon as it does I will use your suggestions (thank you) and/or provide more info here. Cheers! -Alan
-
Has anyone installed Processwire on Amazon EC2?
alan replied to modifiedcontent's topic in General Support
I plan to I am not there yet, but I have PW working and am just hunting down a bug, if that proves trivial and other tests work OK then I will certainly write it up. Thanks @LostKobrakai for your comments, you are clearly way ahead of me in this department—it's very helpful to hear from someone with your knowledge. Re: I did look at both of these a little, but it seemed they were principally aimed at people who routinely take bare Linux and get LAMP running, I may be wrong. But based on that assumption and guessing the docs on Amazon were perhaps going to encompass me (someone who'd heard of `yum` but hardly ever used it) I returned to Amazon. I tried Amazon Lightsail but fell off the process when it looked like I had to use the bitnami LAMP bundle (see below), or use Amazon tuts written for EC2, not Lightsail, and using those with Lightsail did not work and I was on too thin knowledge-ice to keep going. So I simply decided to try EC2 + the Amazon tuts written for getting EC2 LAMP, and so far, so good. Re: Thanks for noting this, I did understand that I was almost 'misusing' EC2 by looking to simply make a tiny VPS in the cloud and almost certainly not using any of the amazing features AWS offers, but I am not coming to AWS for the reasons most would and it's helpful to note that as I don't want to mislead . I'm coming to AWS from a weird angle, where I want to make a solid, modest cloud VPS equivalent, where I can host 10 sites or so, needing no elastic redundancy or power-up capabilities BUT wanting to take advantage of paying for use (low) rather than a flat monthly fee that I pay a traditional hoster, where my low consumption of resources is not reflected in my fixed monthly bill. I should have stated that earlier Aside I was put off when looking at Amazon + bitnami by reviews of the bitnami LAMP bundle. Conversely I have so far been left confident about the Amazon Linux distro and the tutorial for getting LAMP up. It's not been quite as simple as following a tutorial, but I've not had to search too far to keep proceeding and I feel less intimidated logging into AWS than I used to, so that's one take away at least One of the review that made me stop looking at Amazon + bitnami: I was also concerned that I may end up paying bitnami for LAMP (per month?) plus Amazon and yet one of my motivations for this exercise was trying to lower my VPS costs (which due to currency changes is about 50% up on what I used to pay). -
Has anyone installed Processwire on Amazon EC2?
alan replied to modifiedcontent's topic in General Support
I've assumed that I can use Amazon in place of a traditional VPS, such as Servint (who I like), for a significant saving. Maybe I'm wrong in that assumption..? To test that assumption and learn I've been working with Amazon EC2 to see if I can teach myself how to host multiple sites. So far so good. -
Has anyone installed Processwire on Amazon EC2?
alan replied to modifiedcontent's topic in General Support
@LostKobrakai I was intrigued by your comment: and have been tinkering with PW + git + heroku without having fully RTFM on heroku... I was weirded-out by my PW install almost working but eventually realized it was due to Heroku’s ephemeral filesystem": Actually, to give myself a bit of credit, I think heroku ought really to have written the above more 'honestly'; something like: > AWS S3, or similar storage services, are important when architecting applications that need any files to persist or for scale and are a perfect complement to Heroku’s ephemeral filesystem. Anyway, it looks, ATM, like I need to follow this Amazon-shaped rabbit hole... Off to do that plus asked their support people if it looks like I am doing the right thing there. I wonder, if this proves a little complex, might it be as easy/hard to simply emulate a minimal set of the steps PW's own sites have followed and forget heroku and just go Amazon for all aspects of trying to replace a traditional hosting env' (which is what I am researching)? -
This is probably a basic question and I've failed to spot the answer in the docs, in which case, many apologies... Using an example such as example-recursive-function3.php is there an easy/built-in way of outputting only a portion of a deep menu, from part-way into that menu? I need a menu like: - food -- cheese -- fruit --- apples --- grapes - energy -- solar -- wind so at times I can output all of its items. But at other times I need to render only from say `fruit` down, e.g.: - fruit -- apples -- grapes Thanks in advance for any pointers
-
Ah, the todo list... I can see a Module now.., Tailer—it tails your log files. You tailor the rules and leave it to Tailer to alert you tor any phrase or limit that interests you
-
Hey @arjen, sorry for the slow response. At the time I was only thinking of the server logs, but it makes total sense (thanks for the suggestion) to log/parse PW logs also, for things I want to know about. Sadly I have not moved forward with this at all :/ This seems an area (logs reporting themselves to you when a condition/keyword occurs) ripe for automation and likely to be highly beneficial, I am surprised I've not yet bumped into a great pan-log solution. Something I'd like to return to researching when time allows
-
Thanks @adrian, I looked in the Modules list but totally missed your module (what am I like...). Bookmarked ✔
-
Thanks @Soma, I just created an array in Sublime Text in 3mins and then used a for loop and a modified version your code to create 62 pages in a click, continually amazed by the simple power of PW. PS: This was my code, it's obvious/simple, but just in case there's someone looking for a simple example (caution, only call the function once as it just blasts new pages into creation function make_pages() { $out =''; $mypages = array("1st Degree", "2nd Degree", "3rd Degree", "Abdomen", "Allergic Reaction", "Anger And Indignation", "Animal Bites", "Back", "Bad Fish", "Bad Meat", "Beesting", "Blow To Eardrum", "Blow To Eyes", "Blow To Orbit", "Blow To Outer Ear", "Blow/whiplash", "Body Injury", "Breathway Constriction", "Bruises", "Burns", "Cold", "Crushed Fingers", "Dizziness and Vertigo", "Dog Bites", "Ear", "Emotional Upset", "Extremeities", "Eye", "Fainting/collapse", "Fall On Mouth/teeth", "Fear And Fright", "Food Poisoning", "Fractures", "Frostbite", "General", "Grief And Betrayl", "Head", "Heat", "Heatstroke", "Insect Bites", "Joint Sprain", "Mouth", "Muscular Strains", "Neck", "Nerve Injury", "Nose", "Nosebleed", "Overeating", "Overuse Of Alcohol, Drugs, Tabaco, Food", "Physical Injury", "Poison Ivy", "Puncture Wounds", "Rich Food", "Shock And Loss Of Love", "Skin Rash, Swells", "Snake Bites", "Splinters", "Stomach", "Sunburn/burns", "Teeth", "Throat", "Wounds, Cuts"); $out = count($mypages); for ($counter = 0; $counter < count($mypages); $counter++) { $np = new Page(); // create new page object $np->template = "app_nav"; $np->parent = "/app_nav/"; // or id or page object $np->title = $mypages[$counter]; $np->save(); } return $out; }
-
Ditto szabesz; I would love to get into that lower-level approach and one day maybe I will get there, until then I have CodeKit to keep me warm
-
In case anyone else encounters this, I am developing a site and using CodeKit.app. Under some circumstances CodeKit was re-processing files once per 2 seconds when it should do it only when it sees an edit made by me to a .scsss or .js file etc. The answer was to get CodeKit to ignore /site/assets/ As usual the dev for CodeKit was super-fast to make suggestions and one of those lead me to the fix. Thanks Bryan @ CodeKit Edit 2017-09-07 TL;DR; alt-click folder `assets` and choose 'Skip This Folder' (LH pane) not 'Set Output Actions' (RH pane). I was getting this happening again but wasn't able to stop it - it turned out I was attempting to tell CodeKit to ignore files the wrong way(?) or at least in a way that failed. With the `assets` folder selected in CK I was clicking 'Set Output Actions' in the RH column and it appeared to stop the constant refreshing but actually that was a 'red herring'; actually what I needed to do was alt-click the `assets` folder (LH panel) and choose `Skip This Folder'. Solved ?