浏览代码

Hello command line (version display)

markseu 10 年之前
父节点
当前提交
864ce8ab44
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      system/core/core-commandline.php

+ 11 - 2
system/core/core-commandline.php

@@ -5,7 +5,7 @@
 // Command line core plugin
 class YellowCommandline
 {
-	const Version = "0.4.2";
+	const Version = "0.4.3";
 	var $yellow;				//access to API
 	var $content;				//number of content pages
 	var $media;					//number of media files
@@ -65,7 +65,7 @@ class YellowCommandline
 	function versionCommand()
 	{
 		echo "Yellow ".Yellow::Version."\n";
-		foreach($this->yellow->plugins->plugins as $key=>$value) echo "$value[class] $value[version]\n";
+		foreach($this->getPluginVersion() as $line) echo "$line\n";
 		return 200;
 	}
 	
@@ -419,6 +419,15 @@ class YellowCommandline
 		return $data;
 	}
 	
+	// Return plugin version
+	function getPluginVersion()
+	{
+		$data = array();
+		foreach($this->yellow->plugins->plugins as $key=>$value) $data[$key] = "$value[class] $value[version]";
+		usort($data, strnatcasecmp);
+		return $data;
+	}
+	
 	// Check if directory contains Yellow files
 	function isYellowDirectory($path)
 	{