REQUEST
Craft::$app->getRequest()
Craft::$app->getRequest()->getAcceptsJson()
$this->asJson();
CURRENT USER
Craft::$app->getUser()->getIdentity()
{ | |
"name": "Example", | |
"version": "0.0.1", | |
"description": "Example workflow", | |
"author": "You <[email protected]>", | |
"license": "MIT", | |
"postcss": { | |
"plugins": { | |
"postcss-easy-import": {}, | |
"postcss-preset-env": { |
# To enable CORS you should add lines with CORS rules below to your valet.conf file | |
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx | |
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory | |
# after you edit your valet.conf do not forget to execute `valet restart` | |
server { | |
listen 80 default_server; | |
root /; | |
charset utf-8; | |
client_max_body_size 128M; |
<?php | |
namespace middleware\multilanguage; | |
class Language { | |
protected $language; | |
public function __construct($default) { | |
if (!is_string($default)) { | |
throw new \Exception('Not a string.'); |
<?php | |
/* | |
* Get the Blog ID of the main site in a multisite network. | |
* | |
* @return int The blog_id of the main site. | |
*/ | |
function km_get_main_site_blog_id() { | |
return get_network()->site_id; | |
} |
REQUEST
Craft::$app->getRequest()
Craft::$app->getRequest()->getAcceptsJson()
$this->asJson();
CURRENT USER
Craft::$app->getUser()->getIdentity()
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
This is a quick (rough) guide on how to protect a Serverpilot pilot app with auth basic
!browser-sync-ui/lib/plugins/history | |
!svgo/.svgo.yml |
<?php | |
class ProcessWireValetDriver extends BasicValetDriver | |
{ | |
private $possibleDirectories = [ | |
'', // PW in root, do not remove except you're sure you never use it | |
'/dist', | |
'/public' | |
]; |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-l | |
RewriteRule . /index.html [L] |