Commit d7764e0d authored by Administrator's avatar Administrator 💬

Clean up the M3P2 plugin.

parent b2d91018
...@@ -3,10 +3,11 @@ namespace Grav\Plugin; ...@@ -3,10 +3,11 @@ namespace Grav\Plugin;
use Grav\Common\Page\Page; use Grav\Common\Page\Page;
use Grav\Common\Plugin; use Grav\Common\Plugin;
use mysql_xdevapi\Exception;
use RocketTheme\Toolbox\Event\Event;
/** /**
* Features:
* - /sync Cheap git-sync (did not knew about it at the time)
*
* Class M3P2Plugin * Class M3P2Plugin
* @package Grav\Plugin * @package Grav\Plugin
*/ */
...@@ -39,13 +40,6 @@ class M3P2Plugin extends Plugin ...@@ -39,13 +40,6 @@ class M3P2Plugin extends Plugin
return; return;
} }
// // Enable the main event we are interested in
// $this->enable([
// 'onPageContentRaw' => ['onPageContentRaw', 0]
// ]);
$uri = $this->grav['uri']; $uri = $this->grav['uri'];
$route = $this->config->get('plugins.m3-p2.route'); $route = $this->config->get('plugins.m3-p2.route');
// throw new \Exception($route." - ".$uri->path()); // throw new \Exception($route." - ".$uri->path());
...@@ -57,24 +51,6 @@ class M3P2Plugin extends Plugin ...@@ -57,24 +51,6 @@ class M3P2Plugin extends Plugin
} }
} }
// /**
// * Do some work for this event, full details of events can be found
// * on the learn site: http://learn.getgrav.org/plugins/event-hooks
// *
// * @param Event $e
// */
// public function onPageContentRaw(Event $e)
// {
// // Get a variable from the plugin configuration
// $text = $this->grav['config']->get('plugins.m3-p2.text_var');
//
// // Get the current raw content
// $content = $e['page']->getRawContent();
//
// // Prepend the output with the custom text and set back on the page
// $e['page']->setRawContent($text . "\n\n" . $content);
// }
/** /**
* Send user to a random page * Send user to a random page
*/ */
...@@ -84,7 +60,8 @@ class M3P2Plugin extends Plugin ...@@ -84,7 +60,8 @@ class M3P2Plugin extends Plugin
# shell pwd is project root # shell pwd is project root
$out .= shell_exec("cd user/pages && git pull --rebase --autostash origin master 2>&1") . "\n"; $out .= shell_exec("cd user/pages && git pull --rebase --autostash origin master 2>&1") . "\n";
$out .= shell_exec("fortune | cowsay -e Oø -f dragon") . "\n"; $out .= shell_exec("fortune") . "\n";
//$out .= shell_exec("fortune | cowsay -e Oø -f dragon") . "\n";
$out .= "Done."; $out .= "Done.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment