Kaynağa Gözat

Better user config/git compatability.

Removed `config.php` from repo, and replaced w/ `config.php.dist`.
This allows users to update their Pico install w/o changing their
settings.

Additionally now ignoring user added themes.
William Duyck 12 yıl önce
ebeveyn
işleme
1165cff633
3 değiştirilmiş dosya ile 20 ekleme ve 29 silme
  1. 19 1
      .gitignore
  2. 0 25
      config.php
  3. 1 3
      lib/pico.php

+ 19 - 1
.gitignore

@@ -1,5 +1,23 @@
+# Composer
 composer.lock
 composer.phar
+
+# Twig
 vendor/twig/twig/doc/*
 vendor/twig/twig/ext/*
-vendor/twig/twig/test/*
+vendor/twig/twig/test/*
+
+# OS Generated
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
+*.swp
+
+# User themes
+themes/*
+!themes/index.html
+!themes/default/*
+
+# User config
+config.php.dist

+ 0 - 25
config.php

@@ -1,25 +0,0 @@
-<?php 
-
-/*
-// Override any of the default settings below:
-
-$config['site_title'] = 'Pico';			// Site title
-$config['base_url'] = ''; 				// Override base URL (e.g. http://example.com)
-$config['theme'] = 'default'; 			// Set the theme (defaults to "default")
-$config['date_format'] = 'jS M Y';		// Set the PHP date format
-$config['twig_config'] = array(			// Twig settings
-	'cache' => false,					// To enable Twig caching change this to CACHE_DIR
-	'autoescape' => false,				// Autoescape Twig vars
-	'debug' => false					// Enable Twig debug
-);
-$config['pages_order_by'] = 'alpha';	// Order pages by "alpha" or "date"
-$config['pages_order'] = 'asc';			// Order pages "asc" or "desc"
-$config['excerpt_length'] = 50;			// The pages excerpt length (in words)
-
-// To add a custom config setting:
-
-$config['custom_setting'] = 'Hello'; 	// Can be accessed by {{ config.custom_setting }} in a theme
-
-*/
-
-// End of file

+ 1 - 3
lib/pico.php

@@ -179,10 +179,8 @@ class Pico {
 	 */
 	private function get_config()
 	{
-		if(!file_exists(ROOT_DIR .'config.php')) return array();
-		
 		global $config;
-		require_once(ROOT_DIR .'config.php');
+		@include_once(ROOT_DIR .'config.php');
 
 		$defaults = array(
 			'site_title' => 'Pico',