Blog Taxonomy

Posts tagged with 'php'

How the Skosmos Widget Wiki plugin works

kinow @ Dec 24, 2018 15:43:43

Skosmos can be extended through plugins, or widgets (a widget is a plugin for Skosmos). You can read more about how plugins work in Skosmos here.

This post is a note-to-self, explaining how the Skosmos Widget Wiki plugin works. This is a plugin - or widget - that displays Wikipedia information when the concept supports it.

Here’s an image of the plugin in action. Or you can go to a live instance of Skosmos that has the plugin enabled.

Skosmos Widget Wiki plugin in action

( Read more ... )

Writing a custom SchemaSpy command for Laravel 4

kinow @ Feb 11, 2014 13:15:33

This week I had to write my first custom command for Laravel 4. In Nestor-QA, Peter and I thought it would be useful to have the database schema being automatically generated with SchemaSpy in our Jenkins box.

Thanks to Artisan this task is much simpler than I thought. The following command creates the schemaspy command.

php artisan command:make SchemaSpyCommand --command=schemaspy

This will create the file app/commands/SchemaSpyCommand.php. And all I had to do was just fill in the options and write the exec command as the Laravel 4 docs explain.

$this->info('Creating SchemaSpy');

$jar = $this->option("jar");
$dbtype = $this->option("dbtype");
$output = $this->option("output");

$commandLine = sprintf("java -jar %s -u none -t %s -o %s", $jar, $dbtype, $output);

$this->info(sprintf("Command line: [%s]", $commandLine));


That’s how my final command looks. Now the final step is integrate it into the application by adding the line below to app/start/artisan.php.

Artisan::add(new SchemaSpyCommand);

And that’s it, running php artisan schemaspy --jar=/opt/schemaspy/schemaSpy_5.0.0.jar --dbtype=app/database/ --output=database-schema creates the database schema docs in the database-schema directory.

Check this gist for the final code.

Happy coding!