瀏覽代碼

Code cleanup

markseu 11 年之前
父節點
當前提交
c124aad12c

+ 1 - 1
.htaccess

@@ -7,7 +7,7 @@ RewriteEngine on
 RewriteCond %{ENV:REDIRECT_STATUS} ^$
 RewriteRule ^(content|system)/ error404 [L]
 RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
-RewriteRule ^media/plugins/(core_.+) system/core/$1 [L]
+RewriteRule ^media/plugins/(core-.+) system/core/$1 [L]
 RewriteCond %{REQUEST_URI} \.(css|js|png|woff)$
 RewriteRule ^media/plugins/(.+) system/plugins/$1 [L]
 

+ 8 - 10
README.md

@@ -16,17 +16,15 @@ How to make a website?
 ----------------------
 You already have everything you need, start by editing the default pages.  
 For more information see [Yellow documentation](https://github.com/markseu/yellowcms-extensions/blob/master/documentation/README.md).
-
-License and acknowledgments
----------------------------
-* Yellow and Yellow extensions are licensed under [GPLv2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
-* [PHP Markdown](https://github.com/michelf/php-markdown) by Michel Fortin is licensed under [BSD license](http://opensource.org/licenses/BSD-3-Clause)
-* [Font Awesome](https://github.com/FortAwesome/Font-Awesome) by Dave Gandy is licensed under [OFLv1.1](http://opensource.org/licenses/OFL-1.1)
-
-Yellow is open source. You can use it for free.
-
+
+License and acknowledgments
+---------------------------
+* Yellow and extensions are licensed under [GPLv2](http://opensource.org/licenses/GPL-2.0)
+* [PHP Markdown Extra](https://github.com/michelf/php-markdown) by Michel Fortin is licensed under [BSD license](http://opensource.org/licenses/BSD-3-Clause)
+* [Font Awesome](https://github.com/FortAwesome/Font-Awesome) by Dave Gandy is licensed under [OFLv1.1](http://opensource.org/licenses/OFL-1.1)
+
 Need help? Have a question?
----------------------------
+---------------------------
 Looking for something, then get in touch with other users.  
 Visit [Yellow on Reddit](http://www.reddit.com/r/yellowcms/), 
 follow [Yellow on Twitter](https://twitter.com/yellowcms).

+ 0 - 0
media/images/default_icon.png → media/images/icon.png


+ 2 - 2
system/config/config.ini

@@ -6,7 +6,7 @@ author = Yellow
 language = en
 template = default
 style = default
-parser = markdown
+parser = markdownextra
 
 // serverName = your.domain.name
 // serverBase = /yellow
@@ -28,4 +28,4 @@ contentDefaultFile = page.txt
 contentExtension = .txt
 configExtension = .ini
 errorPageFile = error(.*).txt
-textStringFile = text_(.*).ini
+textStringFile = text(.*).ini

+ 0 - 0
system/config/text_english.ini → system/config/textenglish.ini


+ 11 - 11
system/core/core_commandline.php → system/core/core-commandline.php

@@ -3,13 +3,13 @@
 // This file may be used and distributed under the terms of the public license.
 
 // Command line core plugin
-class Yellow_Commandline
+class YellowCommandline
 {
-	const Version = "0.1.5";
+	const Version = "0.2.1";
 	var $yellow;			//access to API
 
 	// Initialise plugin
-	function initPlugin($yellow)
+	function onLoad($yellow)
 	{
 		$this->yellow = $yellow;
 		$this->yellow->config->setDefault("commandBuildDefaultFile", "index.html");
@@ -33,7 +33,7 @@ class Yellow_Commandline
 	// Show available commands
 	function help()
 	{
-		echo "Yellow command line ".Yellow_Commandline::Version."\n";
+		echo "Yellow command line ".YellowCommandline::Version."\n";
 		echo "Syntax: yellow.php build DIRECTORY [LOCATION]\n";
 		echo "        yellow.php version\n";
 		return 0;
@@ -87,8 +87,8 @@ class Yellow_Commandline
 				".", "/.*\\".$this->yellow->config->get("commandBuildCustomMediaExtension")."/", false, false));
 			$fileNamesSystem = array($this->yellow->config->get("commandBuildCustomErrorFile"));
 		} else {
-			$pages = new Yellow_PageCollection($this->yellow, $location);
-			$pages->append(new Yellow_Page($this->yellow, $location));
+			$pages = new YellowPageCollection($this->yellow, $location);
+			$pages->append(new YellowPage($this->yellow, $location));
 			$fileNamesMedia = array();
 			$fileNamesSystem = array();
 		}
@@ -101,7 +101,7 @@ class Yellow_Commandline
 				++$error;
 				echo "ERROR building location '".$page->location."', ".$this->yellow->page->getStatusCode(true)."\n";
 			}
-			if(defined("DEBUG") && DEBUG>=1) echo "Yellow_Commandline::buildStatic status:$statusCode location:".$page->location."\n";
+			if(defined("DEBUG") && DEBUG>=1) echo "YellowCommandline::buildStatic status:$statusCode location:".$page->location."\n";
 		}
 		foreach($fileNamesMedia as $fileName)
 		{
@@ -112,7 +112,7 @@ class Yellow_Commandline
 				++$error;
 				echo "ERROR building media file '$path/$fileName', ".$this->yellow->toolbox->getHttpStatusFormatted($statusCode)."\n";
 			}
-			if(defined("DEBUG") && DEBUG>=1) echo "Yellow_Commandline::buildStatic status:$statusCode file:$fileName\n";
+			if(defined("DEBUG") && DEBUG>=1) echo "YellowCommandline::buildStatic status:$statusCode file:$fileName\n";
 		}
 		foreach($fileNamesSystem as $fileName)
 		{
@@ -123,10 +123,10 @@ class Yellow_Commandline
 				++$error;
 				echo "ERROR building system file '$path/$fileName', ".$this->yellow->toolbox->getHttpStatusFormatted($statusCode)."\n";
 			}
-			if(defined("DEBUG") && DEBUG>=1) echo "Yellow_Commandline::buildStatic status:$statusCode file:$fileName\n";	
+			if(defined("DEBUG") && DEBUG>=1) echo "YellowCommandline::buildStatic status:$statusCode file:$fileName\n";
 		}
 		$this->yellow->toolbox->timerStop($time);
-		if(defined("DEBUG") && DEBUG>=1) echo "Yellow_Commandline::buildStatic time:$time ms\n";
+		if(defined("DEBUG") && DEBUG>=1) echo "YellowCommandline::buildStatic time:$time ms\n";
 		return array($statusCodeMax, count($pages), count($fileNamesMedia), count($fileNamesSystem), $error);
 	}
 	
@@ -263,5 +263,5 @@ class Yellow_Commandline
 	}
 }
 	
-$yellow->registerPlugin("commandline", "Yellow_Commandline", Yellow_Commandline::Version);
+$yellow->registerPlugin("commandline", "YellowCommandline", YellowCommandline::Version);
 ?>

+ 0 - 0
system/core/core_fontawesome.woff → system/core/core-fontawesome.woff


+ 7 - 7
system/core/core_markdown.php → system/core/core-markdownextra.php

@@ -2,15 +2,15 @@
 // Copyright (c) 2013 Datenstrom, http://datenstrom.se
 // This file may be used and distributed under the terms of the public license.
 
-// Markdown parser core plugin
-class Yellow_Markdown
+// Markdown extra parser core plugin
+class YellowMarkdownExtra
 {
-	const Version = "0.1.7";
+	const Version = "0.2.1";
 	var $yellow;		//access to API
 	var $textHtml;		//generated text (HTML format)
 	
 	// Initialise plugin
-	function initPlugin($yellow)
+	function onLoad($yellow)
 	{
 		$this->yellow = $yellow;
 	}
@@ -18,14 +18,14 @@ class Yellow_Markdown
 	// Parse text
 	function parse($text)
 	{
-		$markdown = new Yellow_MarkdownExtraParser($this->yellow);
+		$markdown = new YellowMarkdownExtraParser($this->yellow);
 		return $this->textHtml = $markdown->transform($text);
 	}
 }
 
 require_once("markdown.php");
 
-class Yellow_MarkdownExtraParser extends MarkdownExtra_Parser
+class YellowMarkdownExtraParser extends MarkdownExtra_Parser
 {
 	var $yellow;	//access to API
 
@@ -108,5 +108,5 @@ class Yellow_MarkdownExtraParser extends MarkdownExtra_Parser
 	}
 }
 
-$yellow->registerPlugin("markdown", "Yellow_Markdown", Yellow_Markdown::Version);
+$yellow->registerPlugin("markdownextra", "YellowMarkdownExtra", YellowMarkdownExtra::Version);
 ?>

+ 2 - 2
system/core/core_webinterface.css → system/core/core-webinterface.css

@@ -1,4 +1,4 @@
-/* Yellow web interface 0.1.2 */
+/* Yellow web interface 0.1.3 */
 
 .yellow-bar { position:relative; overflow:hidden; line-height:2.0em; }
 .yellow-barleft { display:block; float:left; }
@@ -52,7 +52,7 @@
 
 /* Font icons from Fontawesome */
 
-@font-face { font-family:'FontAwesome'; font-style:normal; font-weight:normal; src:url('core_fontawesome.woff'); }
+@font-face { font-family:'FontAwesome'; font-style:normal; font-weight:normal; src:url('core-fontawesome.woff'); }
 [class*="yellow-icon-"] {
 	font-family:FontAwesome;
 	font-style:normal;

+ 2 - 2
system/core/core_webinterface.js → system/core/core-webinterface.js

@@ -4,7 +4,7 @@
 // Yellow main API
 var yellow =
 {
-	version: "0.1.2",
+	version: "0.2.1",
 	onClick: function(e) { yellow.webinterface.hidePanesOnClick(yellow.toolbox.getEventElement(e)); },
 	onKeydown: function(e) { yellow.webinterface.hidePanesOnKeydown(yellow.toolbox.getEventKeycode(e)); },
 	onResize: function() { yellow.webinterface.resizePanes(); },
@@ -64,7 +64,7 @@ yellow.webinterface =
 			var location = yellow.config.serverBase+yellow.config.pluginLocation;			
 			elementBar.innerHTML =
 				"<div class=\"yellow-barleft\">"+
-				"<a href=\"http://datenstrom.se/yellow/\" target=\"_blank\"><img src=\""+location+"core_webinterface.png\" width=\"16\" height=\"16\"> Yellow</a>"+
+				"<a href=\"http://datenstrom.se/yellow/\" target=\"_blank\"><img src=\""+location+"core-webinterface.png\" width=\"16\" height=\"16\"> Yellow</a>"+
 				"<a href=\"#\" onclick=\"yellow.onShow('yellow-paneedit'); return false;\">"+this.getText("Edit")+"</a>"+
 				"<a href=\"#\" onclick=\"yellow.onShow('yellow-paneshow'); return false;\">"+this.getText("Show")+"</a>"+
 				"</div>"+

+ 10 - 10
system/core/core_webinterface.php → system/core/core-webinterface.php

@@ -3,9 +3,9 @@
 // This file may be used and distributed under the terms of the public license.
 
 // Web interface core plugin
-class Yellow_Webinterface
+class YellowWebinterface
 {
-	const Version = "0.1.10";
+	const Version = "0.2.1";
 	var $yellow;				//access to API
 	var $users;					//web interface users
 	var $activeLocation;		//web interface location? (boolean)
@@ -14,12 +14,12 @@ class Yellow_Webinterface
 	var $rawDataOriginal;		//raw data of page in case of errors
 
 	// Initialise plugin
-	function initPlugin($yellow)
+	function onLoad($yellow)
 	{
 		$this->yellow = $yellow;
 		$this->yellow->config->setDefault("webinterfaceLocation", "/edit/");
 		$this->yellow->config->setDefault("webinterfaceUserFile", "user.ini");
-		$this->users = new Yellow_WebinterfaceUsers();
+		$this->users = new YellowWebinterfaceUsers();
 		$this->users->load($this->yellow->config->get("configDir").$this->yellow->config->get("webinterfaceUserFile"));
 	}
 
@@ -83,8 +83,8 @@ class Yellow_Webinterface
 		{
 			$location = $this->yellow->config->getHtml("serverBase").$this->yellow->config->getHtml("pluginLocation");
 			$language = $this->isUser() ? $this->users->getLanguage($this->activeUserEmail) : $this->yellow->page->get("language");
-			$header .= "<link rel=\"styleSheet\" type=\"text/css\" media=\"all\" href=\"{$location}core_webinterface.css\" />\n";
-			$header .= "<script type=\"text/javascript\" src=\"{$location}core_webinterface.js\"></script>\n";
+			$header .= "<link rel=\"styleSheet\" type=\"text/css\" media=\"all\" href=\"{$location}core-webinterface.css\" />\n";
+			$header .= "<script type=\"text/javascript\" src=\"{$location}core-webinterface.js\"></script>\n";
 			$header .= "<script type=\"text/javascript\">\n";
 			$header .= "// <![CDATA[\n";
 			if($this->isUser())
@@ -161,7 +161,7 @@ class Yellow_Webinterface
 	{
 		if($_POST["action"] == "login")
 		{
-			$email = $_POST["email"];
+			$email = $corPOST["email"];
 			$password = $_POST["password"];
 			if($this->users->checkUser($email, $password))
 			{
@@ -228,7 +228,7 @@ class Yellow_Webinterface
 }
 
 // Yellow web interface users
-class Yellow_WebinterfaceUsers
+class YellowWebinterfaceUsers
 {
 	var $users;		//registered users
 	
@@ -250,7 +250,7 @@ class Yellow_WebinterfaceUsers
 				if(!empty($matches[1]) && !empty($matches[2]) && !empty($matches[3]) && !empty($matches[4]))
 				{
 					$this->setUser($matches[1], $matches[2], $matches[3], $matches[4]);
-					if(defined("DEBUG") && DEBUG>=3) echo "Yellow_WebinterfaceUsers::load email:$matches[1] $matches[3]<br/>\n";
+					if(defined("DEBUG") && DEBUG>=3) echo "YellowWebinterfaceUsers::load email:$matches[1] $matches[3]<br/>\n";
 				}
 			}
 		}
@@ -323,5 +323,5 @@ class Yellow_WebinterfaceUsers
 	}
 }
 
-$yellow->registerPlugin("webinterface", "Yellow_Webinterface", Yellow_Webinterface::Version);
+$yellow->registerPlugin("webinterface", "YellowWebinterface", YellowWebinterface::Version);
 ?>

+ 0 - 0
system/core/core_webinterface.png → system/core/core-webinterface.png


+ 34 - 34
system/core/core.php

@@ -5,7 +5,7 @@
 // Yellow main class
 class Yellow
 {
-	const Version = "0.1.22";
+	const Version = "0.2.1";
 	var $page;				//current page data
 	var $pages;				//current page tree from file system
 	var $config;			//configuration
@@ -15,17 +15,17 @@ class Yellow
 
 	function __construct()
 	{
-		$this->pages = new Yellow_Pages($this);
-		$this->config = new Yellow_Config($this);
-		$this->text = new Yellow_Text($this);
-		$this->toolbox = new Yellow_Toolbox();
-		$this->plugins = new Yellow_Plugins();
+		$this->pages = new YellowPages($this);
+		$this->config = new YellowConfig($this);
+		$this->text = new YellowText($this);
+		$this->toolbox = new YellowToolbox();
+		$this->plugins = new YellowPlugins();
 		$this->config->setDefault("sitename", "Yellow");
 		$this->config->setDefault("author", "Yellow");
 		$this->config->setDefault("language", "en");
 		$this->config->setDefault("template", "default");
 		$this->config->setDefault("style", "default");
-		$this->config->setDefault("parser", "markdown");
+		$this->config->setDefault("parser", "markdownextra");
 		$this->config->setDefault("serverName", $this->toolbox->getServerName());
 		$this->config->setDefault("serverBase", $this->toolbox->getServerBase());
 		$this->config->setDefault("styleLocation", "/media/styles/");
@@ -46,7 +46,7 @@ class Yellow
 		$this->config->setDefault("configExtension", ".ini");
 		$this->config->setDefault("configFile", "config.ini");
 		$this->config->setDefault("errorPageFile", "error(.*).txt");
-		$this->config->setDefault("textStringFile", "text_(.*).ini");
+		$this->config->setDefault("textStringFile", "text(.*).ini");
 		$this->config->load($this->config->get("configDir").$this->config->get("configFile"));
 		$this->text->load($this->config->get("configDir").$this->config->get("textStringFile"));
 	}
@@ -61,7 +61,7 @@ class Yellow
 		$serverBase = $this->config->get("serverBase");
 		$location = $this->getRelativeLocation($serverBase);
 		$fileName = $this->getContentFileName($location);
-		$this->page = new Yellow_Page($this, $location);
+		$this->page = new YellowPage($this, $location);
 		foreach($this->plugins->plugins as $key=>$value)
 		{
 			if(method_exists($value["obj"], "onRequest"))
@@ -152,7 +152,7 @@ class Yellow
 			fclose($fileHandle);
 		}
 		$this->pages->serverBase = $serverBase;
-		$this->page = new Yellow_Page($this, $location);
+		$this->page = new YellowPage($this, $location);
 		$this->page->parseData($fileName, $fileData, $cacheable, $statusCode, $pageError);
 		$this->page->parseContent();
 		$this->page->setHeader("Content-Type", "text/html; charset=UTF-8");
@@ -337,7 +337,7 @@ class Yellow
 }
 	
 // Yellow page data
-class Yellow_Page
+class YellowPage
 {
 	var $yellow;				//access to API
 	var $location;				//page location
@@ -433,7 +433,7 @@ class Yellow_Page
 				fclose($fileHandle);
 				$this->parseMeta();
 			}
-			if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Page::parseUpdate location:".$this->location."<br/>\n";
+			if(defined("DEBUG") && DEBUG>=2) echo "YellowPage::parseUpdate location:".$this->location."<br/>\n";
 		}
 	}
 	
@@ -467,7 +467,7 @@ class Yellow_Page
 			{
 				$this->set("keywords", $this->yellow->toolbox->createTextKeywords($this->get("title"), 10));
 			}
-			if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Page::parseContent location:".$this->location."<br/>\n";
+			if(defined("DEBUG") && DEBUG>=2) echo "YellowPage::parseContent location:".$this->location."<br/>\n";
 		}
 	}
 	
@@ -643,7 +643,7 @@ class Yellow_Page
 }
 
 // Yellow page collection as array
-class Yellow_PageCollection extends ArrayObject
+class YellowPageCollection extends ArrayObject
 {
 	var $yellow;				//access to API
 	var $paginationPage;		//current page number in pagination
@@ -810,7 +810,7 @@ class Yellow_PageCollection extends ArrayObject
 }
 
 // Yellow page tree from file system
-class Yellow_Pages
+class YellowPages
 {
 	var $yellow;			//access to API
 	var $pages;				//scanned pages
@@ -827,7 +827,7 @@ class Yellow_Pages
 	// Return empty page collection
 	function create()
 	{
-		return new Yellow_PageCollection($this->yellow);
+		return new YellowPageCollection($this->yellow);
 	}
 	
 	// Return pages from file system
@@ -861,7 +861,7 @@ class Yellow_Pages
 		if($absoluteLocation) $location = substru($location, strlenu($this->serverBase));
 		$parentLocation = $this->getParentLocation($location);
 		$this->scanChildren($parentLocation);
-		$pages = new Yellow_PageCollection($this->yellow);
+		$pages = new YellowPageCollection($this->yellow);
 		foreach($this->pages[$parentLocation] as $page) if($page->location == $location) { $pages->append($page); break; }
 		return $pages;
 	}
@@ -870,7 +870,7 @@ class Yellow_Pages
 	function findChildren($location, $showHidden = false)
 	{
 		$this->scanChildren($location);
-		$pages = new Yellow_PageCollection($this->yellow);
+		$pages = new YellowPageCollection($this->yellow);
 		foreach($this->pages[$location] as $page) if($page->isVisible() || $showHidden) $pages->append($page);
 		return $pages;
 	}
@@ -880,7 +880,7 @@ class Yellow_Pages
 	{
 		--$levelMax;
 		$this->scanChildren($location);
-		$pages = new Yellow_PageCollection($this->yellow);
+		$pages = new YellowPageCollection($this->yellow);
 		foreach($this->pages[$location] as $page)
 		{
 			if($page->isVisible() || $showHidden)
@@ -900,7 +900,7 @@ class Yellow_Pages
 	{
 		if(is_null($this->pages[$location]))
 		{
-			if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Pages::scanChildren location:$location<br/>\n";
+			if(defined("DEBUG") && DEBUG>=2) echo "YellowPages::scanChildren location:$location<br/>\n";
 			$this->pages[$location] = array();
 			$path = $this->yellow->config->get("contentDir");
 			if(!empty($location))
@@ -940,7 +940,7 @@ class Yellow_Pages
 					$fileData = "";
 					$statusCode = 0;
 				}
-				$page = new Yellow_Page($this->yellow, $this->yellow->toolbox->findLocationFromFile($fileName,
+				$page = new YellowPage($this->yellow, $this->yellow->toolbox->findLocationFromFile($fileName,
 					$this->yellow->config->get("contentDir"), $this->yellow->config->get("contentHomeDir"),
 					$this->yellow->config->get("contentDefaultFile"), $this->yellow->config->get("contentExtension")));
 				$page->parseData($fileName, $fileData, false, $statusCode);
@@ -970,7 +970,7 @@ class Yellow_Pages
 }
 
 // Yellow configuration
-class Yellow_Config
+class YellowConfig
 {
 	var $yellow;			//access to API
 	var $modified;			//configuration modification time
@@ -991,7 +991,7 @@ class Yellow_Config
 		$fileData = @file($fileName);
 		if($fileData)
 		{
-			if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Config::load file:$fileName<br/>\n";
+			if(defined("DEBUG") && DEBUG>=2) echo "YellowConfig::load file:$fileName<br/>\n";
 			$this->modified = filemtime($fileName);
 			foreach($fileData as $line)
 			{
@@ -1000,7 +1000,7 @@ class Yellow_Config
 				if(!empty($matches[1]) && !strempty($matches[2]))
 				{
 					$this->set($matches[1], $matches[2]);
-					if(defined("DEBUG") && DEBUG>=3) echo "Yellow_Config::load key:$matches[1] $matches[2]<br/>\n";
+					if(defined("DEBUG") && DEBUG>=3) echo "YellowConfig::load key:$matches[1] $matches[2]<br/>\n";
 				}
 			}
 		}
@@ -1060,7 +1060,7 @@ class Yellow_Config
 }
 
 // Yellow text strings
-class Yellow_Text
+class YellowText
 {
 	var $yellow;		//access to API
 	var $modified;		//text modification time
@@ -1084,7 +1084,7 @@ class Yellow_Text
 			$fileData = @file("$path/$entry");
 			if($fileData)
 			{
-				if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Text::load file:$path/$entry<br/>\n";
+				if(defined("DEBUG") && DEBUG>=2) echo "YellowText::load file:$path/$entry<br/>\n";
 				$this->modified = max($this->modified, filemtime("$path/$entry"));
 				$language = "";
 				foreach($fileData as $line)
@@ -1099,7 +1099,7 @@ class Yellow_Text
 					if(!empty($language) && !empty($matches[1]) && !strempty($matches[2]))
 					{
 						$this->setLanguageText($language, $matches[1], $matches[2]);
-						if(defined("DEBUG") && DEBUG>=3) echo "Yellow_Text::load key:$matches[1] $matches[2]<br/>\n";
+						if(defined("DEBUG") && DEBUG>=3) echo "YellowText::load key:$matches[1] $matches[2]<br/>\n";
 					}
 				}
 			}
@@ -1177,7 +1177,7 @@ class Yellow_Text
 }
 
 // Yellow toolbox with helpers
-class Yellow_Toolbox
+class YellowToolbox
 {
 	// Return server name from current HTTP request
 	function getServerName()
@@ -1669,7 +1669,7 @@ class Yellow_Toolbox
 }
 
 // Yellow plugins
-class Yellow_Plugins
+class YellowPlugins
 {
 	var $plugins;		//registered plugins
 
@@ -1682,9 +1682,9 @@ class Yellow_Plugins
 	function load()
 	{
 		global $yellow;
-		require_once("core_markdown.php");
-		require_once("core_commandline.php");
-		require_once("core_webinterface.php");
+		require_once("core-commandline.php");
+		require_once("core-markdownextra.php");
+		require_once("core-webinterface.php");
 		foreach($yellow->toolbox->getDirectoryEntries($yellow->config->get("pluginDir"), "/.*\.php/", true, false) as $entry)
 		{
 			$fileNamePlugin = $yellow->config->get("pluginDir")."/$entry";
@@ -1693,8 +1693,8 @@ class Yellow_Plugins
 		foreach($this->plugins as $key=>$value)
 		{
 			$this->plugins[$key]["obj"] = new $value["class"];
-			if(defined("DEBUG") && DEBUG>=2) echo "Yellow_Plugins::load class:$value[class] $value[version]<br/>\n";
-			if(method_exists($this->plugins[$key]["obj"], "initPlugin")) $this->plugins[$key]["obj"]->initPlugin($yellow);
+			if(defined("DEBUG") && DEBUG>=2) echo "YellowPlugins::load class:$value[class] $value[version]<br/>\n";
+			if(method_exists($this->plugins[$key]["obj"], "onLoad")) $this->plugins[$key]["obj"]->onLoad($yellow);
 		}
 	}
 	

+ 2 - 2
system/plugins/example.php

@@ -3,12 +3,12 @@
 // This file may be used and distributed under the terms of the public license.
 
 // Example plugin
-class Yellow_Example
+class YellowExample
 {
 	//You can download plugins and extensions from Github.
 	//See https://github.com/markseu/yellowcms-extensions
 	const Version = "0.0.0";
 }
 
-$yellow->registerPlugin("example", "Yellow_Example", Yellow_Example::Version);
+$yellow->registerPlugin("example", "YellowExample", YellowExample::Version);
 ?>

+ 1 - 1
system/snippets/header.php

@@ -6,7 +6,7 @@
 <meta name="author" content="<?php echo $yellow->page->getHtml("author") ?>" />
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <title><?php echo $yellow->page->getHtml("titleHeader") ?></title>
-<link rel="shortcut icon" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("imageLocation")."default_icon.png" ?>" />
+<link rel="shortcut icon" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("imageLocation")."icon.png" ?>" />
 <link rel="stylesheet" type="text/css" media="all" href="<?php echo $yellow->config->get("serverBase").$yellow->config->get("styleLocation").$yellow->page->get("style").".css" ?>" />
 <?php echo $yellow->getHeaderExtra() ?>
 </head>

+ 2 - 1
yellow.php

@@ -11,6 +11,7 @@ if(PHP_SAPI != "cli")
 } else {
 	$yellow = new Yellow();
 	$yellow->plugins->load();
-	$yellow->plugin("commandline", $argv[1], $argv[2], $argv[3], $argv[4], $argv[5]);
+	$statusCode = $yellow->plugin("commandline", $argv[1], $argv[2], $argv[3], $argv[4], $argv[5]);
+	exit($statusCode<=200 ? 0 : 1);
 }
 ?>