From 1a94578b1e76b640c29f34c1f9967c6e151ba190 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 11 Jan 2019 09:10:43 -0500 Subject: [PATCH] Make the functions API automatically enabled by default in core site profiles --- site-beginner/config.php | 16 +++++++++++++++- site-blank/config.php | 16 +++++++++++++++- site-classic/config.php | 16 +++++++++++++++- site-default/config.php | 16 ++++++++++++++-- site-languages/config.php | 16 +++++++++++++++- 5 files changed, 74 insertions(+), 6 deletions(-) diff --git a/site-beginner/config.php b/site-beginner/config.php index f68e1421..94ac48af 100644 --- a/site-beginner/config.php +++ b/site-beginner/config.php @@ -17,7 +17,7 @@ * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * - * ProcessWire 3.x, Copyright 2016 by Ryan Cramer + * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ @@ -51,5 +51,19 @@ $config->debug = false; */ $config->prependTemplateFile = '_init.php'; +/** + * Allow core API variables to also be accessed as functions? + * + * Recommended. This enables API varibles like $pages to also be accessed as pages(), + * as an example. And so on for most other core variables. + * + * Benefits are better type hinting, always in scope, and potentially shorter API calls. + * See the file /wire/core/FunctionsAPI.php for details on these functions. + * + * @var bool + * + */ +$config->useFunctionsAPI = true; + /*** INSTALLER CONFIG ********************************************************************/ diff --git a/site-blank/config.php b/site-blank/config.php index b51bdcba..300c6b27 100644 --- a/site-blank/config.php +++ b/site-blank/config.php @@ -17,7 +17,7 @@ * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * - * ProcessWire 3.x, Copyright 2016 by Ryan Cramer + * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ @@ -40,6 +40,20 @@ if(!defined("PROCESSWIRE")) die(); */ $config->debug = false; +/** + * Allow core API variables to also be accessed as functions? + * + * Recommended. This enables API varibles like $pages to also be accessed as pages(), + * as an example. And so on for most other core variables. + * + * Benefits are better type hinting, always in scope, and potentially shorter API calls. + * See the file /wire/core/FunctionsAPI.php for details on these functions. + * + * @var bool + * + */ +$config->useFunctionsAPI = true; + /*** INSTALLER CONFIG ********************************************************************/ diff --git a/site-classic/config.php b/site-classic/config.php index 2ffd5173..700d5436 100644 --- a/site-classic/config.php +++ b/site-classic/config.php @@ -17,7 +17,7 @@ * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * - * ProcessWire 3.x, Copyright 2016 by Ryan Cramer + * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ @@ -40,5 +40,19 @@ if(!defined("PROCESSWIRE")) die(); */ $config->debug = false; +/** + * Allow core API variables to also be accessed as functions? + * + * Recommended. This enables API varibles like $pages to also be accessed as pages(), + * as an example. And so on for most other core variables. + * + * Benefits are better type hinting, always in scope, and potentially shorter API calls. + * See the file /wire/core/FunctionsAPI.php for details on these functions. + * + * @var bool + * + */ +$config->useFunctionsAPI = true; + /*** INSTALLER CONFIG ********************************************************************/ diff --git a/site-default/config.php b/site-default/config.php index 5889e6d2..6c5acb36 100755 --- a/site-default/config.php +++ b/site-default/config.php @@ -17,7 +17,7 @@ * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * - * ProcessWire 3.x, Copyright 2016 by Ryan Cramer + * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ @@ -62,7 +62,19 @@ $config->prependTemplateFile = '_init.php'; */ $config->appendTemplateFile = '_main.php'; - +/** + * Allow core API variables to also be accessed as functions? + * + * Recommended. This enables API varibles like $pages to also be accessed as pages(), + * as an example. And so on for most other core variables. + * + * Benefits are better type hinting, always in scope, and potentially shorter API calls. + * See the file /wire/core/FunctionsAPI.php for details on these functions. + * + * @var bool + * + */ +$config->useFunctionsAPI = true; /*** INSTALLER CONFIG ********************************************************************/ diff --git a/site-languages/config.php b/site-languages/config.php index 11400a50..d6091777 100644 --- a/site-languages/config.php +++ b/site-languages/config.php @@ -17,7 +17,7 @@ * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * - * ProcessWire 3.x, Copyright 2016 by Ryan Cramer + * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ @@ -62,6 +62,20 @@ $config->prependTemplateFile = '_init.php'; */ $config->appendTemplateFile = '_main.php'; +/** + * Allow core API variables to also be accessed as functions? + * + * Recommended. This enables API varibles like $pages to also be accessed as pages(), + * as an example. And so on for most other core variables. + * + * Benefits are better type hinting, always in scope, and potentially shorter API calls. + * See the file /wire/core/FunctionsAPI.php for details on these functions. + * + * @var bool + * + */ +$config->useFunctionsAPI = true; + /*** INSTALLER CONFIG ********************************************************************/