Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/04/2022 in all areas

  1. @Roych No, you're not missing anything I don't think. @kongondo has been working on the docs and also putting together the repository and will then update everyone who registered interest via email I do believe.
    3 points
  2. Once my PRs are approved the latest version of this module will make it possible to set the main color via an inputfield:
    2 points
  3. 1 point
  4. I didn't read the whole topic, so hope I guess corretly what is it about. I add my approach to having different configs for each environment. I did it very simple, just used environment variables, so I have one configurable config for all ? (I am using docker on localhost so it is easy to work with environment variables) <?php namespace ProcessWire; /** * ProcessWire Configuration File * * Site-specific configuration for ProcessWire * * Please see the file /wire/config.php which contains all configuration options you may * specify here. Simply copy any of the configuration options from that file and paste * them into this file in order to modify them. * * SECURITY NOTICE * In non-dedicated environments, you should lock down the permissions of this file so * that it cannot be seen by other users on the system. For more information, please * see the config.php section at: https://processwire.com/docs/security/file-permissions/ * * This file is licensed under the MIT license * https://processwire.com/about/license/mit/ * * ProcessWire 3.x, Copyright 2019 by Ryan Cramer * https://processwire.com * */ if(!defined("PROCESSWIRE")) die(); /*** SITE CONFIG *************************************************************************/ /** @var Config $config */ /** * 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 ********************************************************************/ /** * Installer: Database Configuration * */ $config->dbHost = getenv("DB_HOST"); $config->dbName = getenv("DB_NAME"); $config->dbUser = getenv("DB_USER"); $config->dbPass = getenv("DB_PASS"); $config->dbPort = getenv("DB_PORT"); $config->dbEngine = 'InnoDB'; /** * Installer: User Authentication Salt * * This value was randomly generated for your system on 2021/12/14. * This should be kept as private as a password and never stored in the database. * Must be retained if you migrate your site from one server to another. * Do not change this value, or user passwords will no longer work. * */ $config->userAuthSalt = getenv("USER_AUTH_SALT"); /** * Installer: Table Salt (General Purpose) * * Use this rather than userAuthSalt when a hashing salt is needed for non user * authentication purposes. Like with userAuthSalt, you should never change * this value or it may break internal system comparisons that use it. * */ $config->tableSalt = getenv("TABLE_SALT"); /** * Installer: File Permission Configuration * */ $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire /** * Installer: Time zone setting * */ $config->timezone = 'Europe/Prague'; /** * Installer: Admin theme * */ $config->defaultAdminTheme = 'AdminThemeUikit'; /** * Installer: Unix timestamp of date/time installed * * This is used to detect which when certain behaviors must be backwards compatible. * Please leave this value as-is. * */ $config->installed = 1639521804; /** * Installer: HTTP Hosts Whitelist * */ $config->httpHosts = preg_split('/\s*,\s*/', getenv('HTTP_HOSTS')); /** * Installer: Debug mode? * * When debug mode is true, errors and exceptions are visible. * When false, they are not visible except to superuser and in logs. * Should be true for development sites and false for live/production sites. * */ $config->debug = filter_var(getenv("DEBUG"), FILTER_VALIDATE_BOOLEAN); $config->advanced = true;
    1 point
  5. Don't think so, I was just curious ? This is what I'm using nowadays: <?php namespace ProcessWire; if(!defined("PROCESSWIRE")) die(); /** @var Config $config */ $config->debug = false; $config->useFunctionsAPI = false; $config->useMarkupRegions = false; $config->usePageClasses = true; $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; $config->defaultAdminTheme = 'AdminThemeUikit'; $config->dbHost = 'localhost'; $config->dbPort = '3306'; $config->chmodDir = '0755'; $config->chmodFile = '0644'; $config->timezone = 'Europe/Vienna'; $config->dbEngine = 'InnoDB'; $config->installed = 123456789; setlocale(LC_ALL, 'de_AT.utf8', 'de_DE.utf8', 'de_AT', 'de_DE'); // try to load config foreach([ "/path/to/your/live/config.php", __DIR__."/config-local.php", ] as $c) { if(!is_file($c)) continue; return include($c); } die("no config found"); This file is under git, so everything that is the same for all environments comes into config.php; Everything else comes into the live or dev config: <?php namespace ProcessWire; /** @var Config $config */ $config->debug = true; $config->dbName = 'db'; $config->dbUser = 'db'; $config->dbPass = 'db'; $config->dbHost = 'db'; $config->userAuthSalt = 'abcdefg'; $config->httpHosts = ['my.ddev.site']; $config->filesOnDemand = 'https://staging.mysite.com'; ?
    1 point
  6. There must be something on my local machine, I uploaded it to the dev server and it works straight away. I configured it and got busy translating. Thanks for the help and for the great module! I tested DeepL's translation quality with my native language and it blew my mind. Multilingual sites are now really a breeze to create.
    1 point
  7. Happy New Year! Hope that you all have a great end to 2021 and start of 2022. No major core updates to report this week, just a few minor issue fixing commits, so no version bump today. The dev branch is getting close to 100 commits (and at 7 versions) above the master branch, and with even more improvements/fixes/optimizations than that. So we may try to get a new master/main version out in early 2022, as I'd really like to get more master versions out in 2022 than we did in 2021. Some portion of our audience does not use the dev branch where most of the activity happens, and so it might be nice to share more of that activity on the master/main branch. That's one of many things I'm thinking about as the New Year approaches and am certain 2022 is going to be a great year for ProcessWire and the community. Hope that you have a great weekend and Happy New Year!
    1 point
  8. For redirects I suggest: $session->redirect($url, 307);
    1 point
  9. @Richard Jedlička @wbmnfktr You can set a response code in your hook like this: http_response_code(400); So you can set 400, 307, or whatever you need. https://www.php.net/manual/en/function.http-response-code.php
    1 point
  10. Just created my first VSCode Extension - if you like it please give it a star on Github and rate it on VSCode Marketplace ? Installation: Either via https://marketplace.visualstudio.com/items?itemName=baumrock.pwsnippets or directly in VSCode: Contributions welcome! https://github.com/BernhardBaumrock/pwsnippets
    1 point
×
×
  • Create New...