Idea: S9y CLI tool

Discussion corner for Developers of Serendipity.
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Idea: S9y CLI tool

Post by mattsches »

yellowled wrote:While we're at it, I have to admit that Dogma is actually one of the very few flicks by Kevin Smith which I don't like. :mrgreen:

YL
Now this is getting off-topic, but anyway. It's definitely not his best movie, but I haven't seen anything since Clerks II. (The original Clerks is one of my favorite movies of all time ...)

Btw: Is someone capable of mixing the S9y logo with this? Would result in a nice logo for Metatron :wink:
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Idea: S9y CLI tool

Post by onli »

A more carefully made
Image
?^^
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Idea: S9y CLI tool

Post by mattsches »

LOL .. yeah, almost perfect!!!

@onli Have you tried to run the tool yet?
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Idea: S9y CLI tool

Post by onli »

Yep, just sent the mail a minute ago.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Idea: S9y CLI tool

Post by yellowled »

I took the liberty of creating a repository for Metatron: https://github.com/s9y/Metatron

Now mattsches just needs to commit the actual project files. :) (Unless I did something wrong.)

YL
artodeto
Regular
Posts: 12
Joined: Sat Jul 30, 2011 12:07 am
Contact:

Re: Idea: S9y CLI tool

Post by artodeto »

yellowled wrote:I took the liberty of creating a repository for Metatron: https://github.com/s9y/Metatron

Now mattsches just needs to commit the actual project files. :) (Unless I did something wrong.)

YL
I will have a look to the github project ;-).
I've played around with symfony console and created some simple components (composer ready). Take a look to configuration format converter if you want to. I extended the existing application with a IOInterface (influenced by composer) to get rid of the io handling :-).
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Idea: S9y CLI tool

Post by mattsches »

So, I've just pushed the first version to GitHub :D

I've also blogged about it (in German): Metatron - Ein CLI-Tool für Serendipity

Clone or fork it, try it, give feedback please!
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Idea: S9y CLI tool

Post by Timbalu »

Whow. Congrats!
That looks very neat. :)

To extend the userbase for testing, you might need to add a dummy description on how to use it for what in detail here, since not everybody is knowing the usage and possible benefits. This starts telling, that it is used to install or administrate Serendipity by CLI console with some very simple commands, am I right? :wink:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Idea: S9y CLI tool

Post by yellowled »

Timbalu wrote:To extend the userbase for testing, you might need to add a dummy description on how to use it for what in detail here, since not everybody is knowing the usage and possible benefits.
https://github.com/s9y/Metatron#usage

YL
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Idea: S9y CLI tool

Post by mattsches »

Timbalu wrote:To extend the userbase for testing, you might need to add a dummy description on how to use it for what in detail here, since not everybody is knowing the usage and possible benefits. This starts telling, that it is used to install or administrate Serendipity by CLI console with some very simple commands, am I right? :wink:
Thanks for the feedback, Ian! I wanted to push it to GitHub as soon as possible, that's why the README contains only the most important information. Since the tool is aimed at admins and developers, they will know what to do hopefully ;)

But I will add some more info and documentation later!
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Idea: S9y CLI tool

Post by mattsches »

Two small changes in serendipity_config.inc.php seem to be necessary for Metatron to work correctly. If nobody has any objections, I will commit the following change to the 2.0 branch:

Code: Select all

$ git diff serendipity_config.inc.php
diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php
index a55f475..99c21c7 100644
--- a/serendipity_config.inc.php
+++ b/serendipity_config.inc.php
@@ -8,7 +8,7 @@ if (defined('S9Y_FRAMEWORK')) {
 
 @define('S9Y_FRAMEWORK', true);
 
-if (!headers_sent()) {
+if (!headers_sent() && php_sapi_name() !== 'cli') {
     // Only set the session name, if no session has yet been issued.
     if (session_id() == '') {
         session_name('s9y_' . md5(dirname(__FILE__)));
@@ -312,7 +312,7 @@ if ( (isset($serendipity['autodetect_baseURL']) && serendipity_db_bool($serendip
  * If a user is logged in, fetch his preferences. He possibly wants to have a different language
  */
 
-if (IS_installed === true) {
+if (IS_installed === true && php_sapi_name() !== 'cli') {
     // Import HTTP auth (mostly used for RSS feeds)
     if ($serendipity['useHTTP-Auth'] && (isset($_REQUEST['http_auth']) || isset($_SERVER['PHP_AUTH_USER']))) {
         if (!isset($_SERVER['PHP_AUTH_USER'])) {
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Idea: S9y CLI tool

Post by garvinhicking »

No objections!
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Metatron (WAS: Re: Idea: S9y CLI tool)

Post by mattsches »

I just pushed version 0.2.0. Please test!

I've been working on the update for quite a while every now and then. Today I felt I had to push things forward, so I committed my changes. It's quite a large commit and, even if my tests are all green, may still contain some bugs. So, please don't use in production!!

See the changelog for updates.

Regards,
Mattsches
Post Reply