Closed humanjpg closed 8 years ago
@jpgdcl, have a look at your statamic/vendor
folder and check to make sure that the addon dependency has been installed. If it's installed properly, you should see jenssegers
folder in it (see screenshot below)
This code
<blockquote>
Browser: {{ useragent:browser slugify="false" }}<br />
Languages: {{ useragent:languages slugify="false" }}<br />
Device: {{ useragent:device slugify="false" }}<br />
Platform: {{ useragent:platform slugify="false" }}<br />
Is Mobile?: {{ useragent:is_mobile }}<br />
Is Tablet?: {{ useragent:is_tablet }}<br />
Is Desktop?: {{ useragent:is_desktop }}<br />
Is Robot?: {{ useragent:is_robot }}<br />
Robot Name: {{ useragent:robot_name slugify="false" }}<br />
</blockquote>
should output like this
Ah, that would be it :) - No jessengers
folder present, sadly.
Is there a way to run the php please addon:refresh
command so it updates my mamp setup, rather than my OS?
I'm thinking of doing this: https://gist.github.com/kkirsche/5710272 and then running the php please addon:refresh
command again...
But totally out of my depth, so not sure it's the right thing to do?
Yeah, you could do that. That's what I did when I was still using MAMP pro
Run which php
before and after the process to make sure you're on the right track.
For anyone with the same problem, this is not an ideal solution, but in the end I used the following workaround outlined below. Not ideal, but seemed to work for me.
Disclaimer: This is not my area of expertise whatsoever, so follow this at your own risk
A. Firstly, I followed this guide but for version php 5.6.10
: https://gist.github.com/kkirsche/5710272
B. Then in terminal, I setup MAMP so its used as the default php rather than the OS:
cd
on its own so you're in the root nano ~/.bash_profile
export PATH="/Applications/MAMP/bin/php/php5.6.10/bin:$PATH"
(replacing 5.6.10
with whatever version of php you're running / want to runctrl+x
to save, then Y
, and then hit Return
source ~/.bash_profile
which php
it should show: /Applications/MAMP/bin/php/php5.6.10/bin/php
php -v
command should now show: PHP 5.6.10
etc...C. Then cd
to your project directory and...
"lesaff/useragent": "*@dev"
to statamic/composer.json
’s require
array if it isn't already therephp composer.phar update lesaff/useragent --no-dev —optimize-autoloader --prefer-dist
Props to https://github.com/jasonvarga and https://github.com/lesaff for their time and help.
OK, just tried this again on another Statamic instance. Found it didn't work. The workaround I had to use was to remove Useragent from my addons
folder and the line from the statamic/composer.json
file.
The Statamic upgrader then seem to install the dependencies in the CP... But then it just paused and I got was that the Statamic folder didn't exist. When I checked it just the composer stuff was in there.
So I dropped the statamic
folder in manually from the latest version in the local/temp
folder. Cleared the cache that did the trick.
Hello
This add-on looks really good, so I'm keen to get it working :)
When I use the example list provided:
I get the following error:
I also get it when using just
{{ useragent:is_mobile }}
I tried running
php please addon:refresh
in terminal, but I then get a load of errors, which I believe I've seen before and are something to do with my terminal using a different version of php to my mamp server. I'm running php version 5.6.1.0 in mamp.Thanks in advance