Skip to content

Commit 8e48d1c

Browse files
mglamanlisastreeter
authored andcommitted
Update GravCMS (#305)
1 parent 9f398fc commit 8e48d1c

File tree

1,894 files changed

+134936
-30356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,894 files changed

+134936
-30356
lines changed

CHANGELOG.md

+423-6
Large diffs are not rendered by default.

README.md

+121-34
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,134 @@
1-
# Drupal Commerce Documentation
1+
# ![](https://avatars1.githubusercontent.com/u/8237355?v=2&s=50) Grav
22

3-
**Contents:**
4-
- [How to contribute to this documentation](#how-to-contribute-to-this-documentation)
5-
- [Before your first contribution](#before-your-first-contribution)
6-
- [Fast online contribution](#fast-online-contribution)
7-
- [Local setup](#local-setup)
3+
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
4+
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad/mini.png)](https://insight.sensiolabs.com/projects/cfd20465-d0f8-4a0a-8444-467f5b5f16ad)
5+
[![Discord](https://img.shields.io/discord/501836936584101899.svg?logo=discord&colorB=728ADA&label=Discord%20Chat)](https://chat.getgrav.org)
6+
[![Build Status](https://travis-ci.org/getgrav/grav.svg?branch=develop)](https://travis-ci.org/getgrav/grav) [![OpenCollective](https://opencollective.com/grav/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/grav/sponsors/badge.svg)](#sponsors)
87

9-
## How to contribute to this documentation
8+
Grav is a **Fast**, **Simple**, and **Flexible**, file-based Web-platform. There is **Zero** installation required. Just extract the ZIP archive, and you are already up and running. It follows similar principles to other flat-file CMS platforms, but has a different design philosophy than most. Grav comes with a powerful **Package Management System** to allow for simple installation and upgrading of plugins and themes, as well as simple updating of Grav itself.
109

11-
### Before your first contribution
10+
The underlying architecture of Grav is designed to use well-established and _best-in-class_ technologies to ensure that Grav is simple to use and easy to extend. Some of these key technologies include:
1211

13-
**Before contributing**, you should consider the following:
14-
- The documentation is written using [reStructuredText](http://docutils.sourceforge.net/rst.html) markup language. If you are not familiar with this format, read [this article](https://symfony.com/doc/current/contributing/documentation/format.html) for a quick overview of its basic features.
15-
- The documentation is hosted on [GitHub](https://github.com). You'll need a free GitHub user account to contribute to the documentation.
16-
- The documentation is published under a [Creative Commons BY-SA 4.0 License](https://github.com/drupalcommerce/commerce-docs/blob/master/LICENSE) and all your contributions will implicitly adhere to that license.
12+
* [Twig Templating](https://twig.sensiolabs.org/): for powerful control of the user interface
13+
* [Markdown](https://en.wikipedia.org/wiki/Markdown): for easy content creation
14+
* [YAML](https://yaml.org): for simple configuration
15+
* [Parsedown](https://parsedown.org/): for fast Markdown and Markdown Extra support
16+
* [Doctrine Cache](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html): layer for performance
17+
* [Pimple Dependency Injection Container](https://pimple.sensiolabs.org/): for extensibility and maintainability
18+
* [Symfony Event Dispatcher](https://symfony.com/doc/current/components/event_dispatcher/introduction.html): for plugin event handling
19+
* [Symfony Console](https://symfony.com/doc/current/components/console/introduction.html): for CLI interface
20+
* [Gregwar Image Library](https://github.com/Gregwar/Image): for dynamic image manipulation
1721

18-
### Fast online contribution
22+
# Requirements
1923

20-
If you're making a relatively small change - like fixing a typo or rewording something - the easiest way to contribute is directly on GitHub! You can do this while you're reading this documentation.
24+
- PHP 7.1.3 or higher. Check the [required modules list](https://learn.getgrav.org/basics/requirements#php-requirements)
25+
- Check the [Apache](https://learn.getgrav.org/basics/requirements#apache-requirements) or [IIS](https://learn.getgrav.org/basics/requirements#iis-requirements) requirements
2126

22-
1. Click on the **Edit on GitHub** button on the upper right corner and you'll be redirected to GitHub: ![GitHub edit](./images/contributing/github-edit.png)
23-
2. Click the **edit icon** to edit the documentation: ![GitHub icon edit](./images/contributing/github-doc-icon-edit.png)
24-
3. You will be asked to fork the repo, click **Fork this repository and propose changes**: ![GitHub doc fork](./images/contributing/github-doc-fork.png)
25-
4. Edit the contents, describe your changes and click on the **Propose file change** button: ![GitHub doc propose change](./images/contributing/github-doc-propose-change.png)
26-
5. GitHub will now create a branch and a commit for your changes (forking the repository first if this is your first contribution) and it will also display a preview of your changes: ![GitHub doc create pull request](./images/contributing/github-doc-create-pr.png)If everything is correct, click on the **Create pull request** button.
27-
6. GitHub will display a new page where you can do some last-minute changes to your pull request before creating it. For simple contributions, you can safely ignore these options and just click on the **Create pull request** button again.
27+
# QuickStart
2828

29-
**Congratulations!** You just created a pull request to the official Drupal Commerce documentation! The community will now review your pull request and (possibly) suggest tweaks.
29+
These are the options to get Grav:
3030

31-
But if you want to contribute heavily, we recommend you doing a local setup of the documentation.
31+
### Downloading a Grav Package
3232

33-
### Local setup
34-
1. Run composer install
35-
7. In the terminal generate user for admin panel `bin/plugin login newuser`
36-
8. Add credentials
37-
![Adding Credentials](admin_grav.png)
38-
9. Login `php -S localhost:8000 system/router.php`
33+
You can download a **ready-built** package from the [Downloads page on https://getgrav.org](https://getgrav.org/downloads)
3934

40-
### Edit using Visual Code Studio
41-
You can download Visual Code Studio and add the [reStructured Text](https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext) plugin to have an editor with built in previews available.
35+
### With Composer
4236

43-
### Edit and review manually
44-
1. Execute `./build.sh`, this will generate documentation HTML inside `_build/html`.
45-
2. Now you can view the documentation locally, execute `php -S localhost:8000 -t _build/html` , and visit [http://localhost:8000/](http://localhost:8000/) from your browser.
37+
You can create a new project with the latest **stable** Grav release with the following command:
4638

47-
That's it!
39+
```
40+
$ composer create-project getgrav/grav ~/webroot/grav
41+
```
42+
43+
### From GitHub
44+
45+
1. Clone the Grav repository from [https://github.com/getgrav/grav]() to a folder in the webroot of your server, e.g. `~/webroot/grav`. Launch a **terminal** or **console** and navigate to the webroot folder:
46+
```
47+
$ cd ~/webroot
48+
$ git clone https://github.com/getgrav/grav.git
49+
```
50+
51+
2. Install the **plugin** and **theme dependencies** by using the [Grav CLI application](https://learn.getgrav.org/advanced/grav-cli) `bin/grav`:
52+
```
53+
$ cd ~/webroot/grav
54+
$ bin/grav install
55+
```
56+
57+
Check out the [install procedures](https://learn.getgrav.org/basics/installation) for more information.
58+
59+
# Adding Functionality
60+
61+
You can download [plugins](https://getgrav.org/downloads/plugins) or [themes](https://getgrav.org/downloads/themes) manually from the appropriate tab on the [Downloads page on https://getgrav.org](https://getgrav.org/downloads), but the preferred solution is to use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
62+
63+
```
64+
$ bin/gpm index
65+
```
66+
67+
This will display all the available plugins and then you can install one or more with:
68+
69+
```
70+
$ bin/gpm install <plugin/theme>
71+
```
72+
73+
# Updating
74+
75+
To update Grav you should use the [Grav Package Manager](https://learn.getgrav.org/advanced/grav-gpm) or `GPM`:
76+
77+
```
78+
$ bin/gpm selfupgrade
79+
```
80+
81+
To update plugins and themes:
82+
83+
```
84+
$ bin/gpm update
85+
```
86+
87+
88+
# Contributing
89+
We appreciate any contribution to Grav, whether it is related to bugs, grammar, or simply a suggestion or improvement! Please refer to the [Contributing guide](CONTRIBUTING.md) for more guidance on this topic.
90+
91+
## Security issues
92+
If you discover a possible security issue related to Grav or one of its plugins, please email the core team at [email protected] and we'll address it as soon as possible.
93+
94+
# Getting Started
95+
96+
* [What is Grav?](https://learn.getgrav.org/basics/what-is-grav)
97+
* [Install](https://learn.getgrav.org/basics/installation) Grav in few seconds
98+
* Understand the [Configuration](https://learn.getgrav.org/basics/grav-configuration)
99+
* Take a peek at our available free [Skeletons](https://getgrav.org/downloads/skeletons)
100+
* If you have questions, jump on our [Discord Chat Server](https://chat.getgrav.org)!
101+
* Have fun!
102+
103+
# Exploring More
104+
105+
* Have a look at our [Basic Tutorial](https://learn.getgrav.org/basics/basic-tutorial)
106+
* Dive into more [advanced](https://learn.getgrav.org/advanced) functions
107+
* Learn about the [Grav CLI](https://learn.getgrav.org/cli-console/grav-cli)
108+
* Review examples in the [Grav Cookbook](https://learn.getgrav.org/cookbook)
109+
* More [Awesome Grav Stuff](https://github.com/getgrav/awesome-grav)
110+
111+
# Backers
112+
Support Grav with a monthly donation to help us continue development. [[Become a backer](https://opencollective.com/grav#backer)]
113+
114+
<img src="https://opencollective.com/grav/tiers/backers.svg?avatarHeight=36&width=600" />
115+
116+
# Sponsors
117+
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/grav#sponsor)]
118+
119+
<img src="https://opencollective.com/grav/tiers/sponsors.svg?avatarHeight=36&width=600" />
120+
121+
# License
122+
123+
See [LICENSE](LICENSE.txt)
124+
125+
126+
[gitflow-model]: http://nvie.com/posts/a-successful-git-branching-model/
127+
[gitflow-extensions]: https://github.com/nvie/gitflow
128+
129+
# Running Tests
130+
131+
First install the dev dependencies by running `composer update` from the Grav root.
132+
Then `composer test` will run the Unit Tests, which should be always executed successfully on any site.
133+
Windows users should use the `composer test-windows` command.
134+
You can also run a single unit test file, e.g. `composer test tests/unit/Grav/Common/AssetsTest.php`

bin/gpm

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
#!/usr/bin/env php
22
<?php
3-
define('GRAV_CLI', true);
4-
5-
if (!file_exists(__DIR__ . '/../vendor')){
6-
require_once __DIR__ . '/../system/src/Grav/Common/Composer.php';
7-
}
83

94
use Grav\Common\Composer;
10-
use Grav\Common\Config\Setup;
5+
use Symfony\Component\Console\Application;
6+
use Grav\Common\Grav;
7+
8+
\define('GRAV_CLI', true);
9+
\define('GRAV_REQUEST_TIME', microtime(true));
1110

12-
if (!file_exists(__DIR__ . '/../vendor')){
11+
if (!file_exists(__DIR__ . '/../vendor/autoload.php')){
1312
// Before we can even start, we need to run composer first
13+
require_once __DIR__ . '/../system/src/Grav/Common/Composer.php';
14+
1415
$composer = Composer::getComposerExecutor();
1516
echo "Preparing to install vendor dependencies...\n\n";
1617
echo system($composer.' --working-dir="'.__DIR__.'/../" --no-interaction --no-dev --prefer-dist -o install');
1718
echo "\n\n";
1819
}
1920

20-
use Symfony\Component\Console\Application;
21-
use Grav\Common\Grav;
22-
23-
$autoload = require_once(__DIR__ . '/../vendor/autoload.php');
21+
$autoload = require __DIR__ . '/../vendor/autoload.php';
2422

2523
if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) {
2624
exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req));
@@ -30,7 +28,7 @@ if (!ini_get('date.timezone')) {
3028
date_default_timezone_set('UTC');
3129
}
3230

33-
if (!file_exists(ROOT_DIR . 'index.php')) {
31+
if (!file_exists(GRAV_ROOT . '/index.php')) {
3432
exit('FATAL: Must be run from ROOT directory of Grav!');
3533
}
3634

@@ -48,15 +46,16 @@ $climate->arguments->add([
4846
]
4947
]);
5048
$climate->arguments->parse();
51-
$environment = $climate->arguments->get('environment');
5249

5350
// Set up environment based on params.
54-
Setup::$environment = $environment;
51+
$environment = $climate->arguments->get('environment');
5552

5653
$grav = Grav::instance(array('loader' => $autoload));
57-
$grav['uri']->init();
54+
$grav->setup($environment);
55+
5856
$grav['config']->init();
59-
$grav['streams'];
57+
$grav['uri']->init();
58+
$grav['users'];
6059

6160
$app = new Application('Grav Package Manager', GRAV_VERSION);
6261
$app->addCommands(array(

bin/grav

+32-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,52 @@
11
#!/usr/bin/env php
22
<?php
3-
define('GRAV_CLI', true);
4-
5-
if (!file_exists(__DIR__ . '/../vendor')){
6-
require_once __DIR__ . '/../system/src/Grav/Common/Composer.php';
7-
}
83

94
use Grav\Common\Composer;
5+
use Grav\Common\Grav;
6+
use League\CLImate\CLImate;
7+
use Symfony\Component\Console\Application;
8+
9+
\define('GRAV_CLI', true);
10+
\define('GRAV_REQUEST_TIME', microtime(true));
1011

11-
if (!file_exists(__DIR__ . '/../vendor')){
12+
if (!file_exists(__DIR__ . '/../vendor/autoload.php')){
1213
// Before we can even start, we need to run composer first
14+
require_once __DIR__ . '/../system/src/Grav/Common/Composer.php';
15+
1316
$composer = Composer::getComposerExecutor();
1417
echo "Preparing to install vendor dependencies...\n\n";
1518
echo system($composer.' --working-dir="'.__DIR__.'/../" --no-interaction --no-dev --prefer-dist -o install');
1619
echo "\n\n";
1720
}
1821

19-
use Symfony\Component\Console\Application;
20-
21-
require_once __DIR__ . '/../vendor/autoload.php';
22+
$autoload = require __DIR__ . '/../vendor/autoload.php';
2223

2324
if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) {
2425
exit(sprintf("You are running PHP %s, but Grav needs at least PHP %s to run.\n", $ver, $req));
2526
}
2627

28+
$climate = new League\CLImate\CLImate;
29+
$climate->arguments->add([
30+
'environment' => [
31+
'prefix' => 'e',
32+
'longPrefix' => 'env',
33+
'description' => 'Configuration Environment',
34+
'defaultValue' => 'localhost'
35+
]
36+
]);
37+
$climate->arguments->parse();
38+
39+
// Set up environment based on params.
40+
$environment = $climate->arguments->get('environment');
41+
42+
$grav = Grav::instance(array('loader' => $autoload));
43+
$grav->setup($environment);
44+
2745
if (!ini_get('date.timezone')) {
2846
date_default_timezone_set('UTC');
2947
}
3048

31-
if (!file_exists(ROOT_DIR . 'index.php')) {
49+
if (!file_exists(GRAV_ROOT . '/index.php')) {
3250
exit('FATAL: Must be run from ROOT directory of Grav!');
3351
}
3452

@@ -41,5 +59,9 @@ $app->addCommands(array(
4159
new \Grav\Console\Cli\ClearCacheCommand(),
4260
new \Grav\Console\Cli\BackupCommand(),
4361
new \Grav\Console\Cli\NewProjectCommand(),
62+
new \Grav\Console\Cli\SchedulerCommand(),
63+
new \Grav\Console\Cli\SecurityCommand(),
64+
new \Grav\Console\Cli\LogViewerCommand(),
65+
new \Grav\Console\Cli\YamlLinterCommand(),
4466
));
4567
$app->run();

0 commit comments

Comments
 (0)