Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Delicious Brains Blog:
Craft CMS | Self-Hosted WordPress Alternatives Part 1
Jul 11, 2017 @ 15:52:03

The Delicious Brains site has kicked off a new series of posts looking at other options besides WordPress for self-hosted content management systems. In this initial article they cover the Craft CMS that's built on top of the Yii framework.

To kick this off, I’ll be taking a look at Craft CMS by Pixel & Tonic, a software development team that was behind some of the best add-ons for ExpressionEngine. They have since moved on from ExpressionEngine to create their own CMS that is built on the popular Yii framework.

Craft bills itself as “a content-first CMS that aims to make life enjoyable for developers and content managers alike”. This is a change in stride from WordPress which appeals to a much wider variety of people, so it should be interesting to see how that change affects Craft CMS as a whole.

The tutorial then walks you through the installation process for Craft and what the interface will look like when everything is set up correctly. He talks about the functionality that's immediately available and some places where he feels Craft "shines" in its features. He then goes through some of the core architecture of the tool, templating, plugins, custom fields, SEO, eCommerce support and the documentation/pricing the project offers.

tagged: wordpress alternative series part1 craftcms introduction installation

Link: https://deliciousbrains.com/craft-cms-self-hosted-wordpress-alternatives/

Matt Stauffer:
Environment-Specific Configuration for CraftCMS Using PHPDotEnv
Sep 25, 2015 @ 15:13:21

In this post to his site Matt Stauffer shows a more real-word example of how the phpdotenv library can make configuration of your application simpler. He shows how it can be applied to a Craft CMS installation to manage domain-specific configuration details.

Craft is a fantastic CMS, but every CMS shows some pain points when you have a large team working on the same site at the same time. One of these points for me is Craft's native multi-environment configuration options, which allow you to define configuration options based on the domain name.

[...] This is great, but it's limited: You're hard-coding the configuration details into your code, which sometimes means putting sensitive information into your version control. Every developer's local installs either all have to have different domains, or if they use the same domain they need to all have the same configuration settings. And something just feels dirty about the codebase having such knowledge of every place it's going to be deployed.

He introduces the phpdotenv library and how you define its simple .env file with a basic INI structure. He then shows how to add the phpdotenv library to your installation:

  • adding it to the list of Composer installed libraries
  • update your front controller to load the configuration
  • define the .env file with your settings
  • ignore it via .gitignore

With these steps in place you can then update the Craft configuration with calls to getenv in all the right places to pull items from the phpdotenv configuration.

tagged: phpdotenv env configuration craftcms example environment tutorial

Link: https://mattstauffer.co/blog/environment-specific-configuration-for-craftcms-using-phpdotenv


Trending Topics: