Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis #437

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Redis #437

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/collections/classes/api-globalset.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GlobalSet::all(); // Returns GlobalCollection
GlobalSet::find($id); // Returns GlobalSet
```

## Get a global by handle (aka: slug).
## Get a global by handle.

``` php
GlobalSet::whereHandle($handle); // Returns GlobalSet
Expand Down
2 changes: 1 addition & 1 deletion content/collections/docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ If you'd like to support multiple languages, head over to [Localization][localiz

If you have used Statamic before and know what you're doing, you can choose to clear the default content, storage, settings, theme, assets, and/or users.

Run `php please clear:site` inside your Statamic directory to initiate the clear process. You will be prompted to choose which data you would like to clear.
Run `php please clear:site` inside your Statamic directory to initiate the clear process. You will be prompted to choose which data you would like to clear. If you want to delete everything and start fresh, it's also possible to skip the prompts and wipe everything using `php please clear:site --force`.
4 changes: 3 additions & 1 deletion content/collections/kb/redis-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ That's it. If you need to change the host, port, or database (not common, but us
```.language-env
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DATABASE=0
REDIS_DATABASE="0"
```

_Note: It's crucial that you wrap the 0 value of `REDIS_DATABASE` with quotes, otherwise it will evaluate it incorrectly, and result in an the error `\`SELECT\` failed: ERR invalid DB index BUG db is db0`._

You can also set a prefix by adding:

```.language-env
Expand Down
2 changes: 1 addition & 1 deletion content/collections/kb/redis-queue-for-multiple-sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ QUEUE_DRIVER=redis
For each site on your server, you want Redis to use it's own database, or you'll run into troubles. You can do this by adding the following to your `.env` file. Make sure you increase the database number for each site you're running:

```.language-env
REDIS_DATABASE=0
REDIS_DATABASE="0"
```

By default you have 16 Redis databases at hand.
Expand Down
21 changes: 21 additions & 0 deletions content/collections/modifiers/first.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ types:
- utility
id: 3ef1e731-742e-48c2-81f0-6fa916ecda0a
---

## String
Returns the first X characters of a string, where X is any positive integer.

```.language-yaml
Expand All @@ -18,3 +20,22 @@ title: 2015 Year Books Photos
```.language-output
2015
```

## Array

Returns the first item of an array.

```.language-yaml
meat:
- Bacon
- Steak
- Fillet
```

```
{{ meat | first }}
```

```.language-output
Bacon
```
17 changes: 17 additions & 0 deletions content/collections/tags/nav.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,23 @@ The `{{ *recursive children* }}` tag will repeat the contents of the entire `{{

It’s an admittedly weird concept, and might take some fiddling with to truly understand, but is very powerful when fully understood. Take the time. Learn to wield it. A powerful Jedi will you be.

## Children {#children}

If you want to take more control over your child menu, you can just loop through the `children` array within your menu, instead of repeating the contents of the child elements with `{{ *recursive children* }}`.

```
{{ if is_current || is_parent }}
{{ if children }}
<ul>
{{ children }}
<li><a href="{{ url }}">{{ title }}</li>
{{ /children }}
</ul>
{{ /if }}
{{ /if }}
```


## Hidden Pages {#hidden-pages}

A common use-case for navigation is to make some pages "hidden", which means to hide them from the nav, but keep them
Expand Down