diff --git a/.gitignore b/.gitignore index 36ea956..20dad6b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ assets vendor/ framework/ docsviewer/ +cache/ +staticpublisher/ \ No newline at end of file diff --git a/app/_config.php b/app/_config.php index af3226b..888ad72 100644 --- a/app/_config.php +++ b/app/_config.php @@ -16,7 +16,7 @@ error_reporting(E_ALL); // downloaded from http://www.silverstripe.org/themes/ SSViewer::set_theme('docs'); -if(@$_GET['db'] == "sqlite3") { +if(Director::isDev() && @$_GET['db'] == "sqlite3") { global $databaseConfig; $databaseConfig['type'] = 'SQLite3Database'; } @@ -45,15 +45,10 @@ DocumentationViewer::set_edit_link( ) ); - -Object::add_extension('Controller', 'ControllerExtension'); - if(Director::isLive()) { ControllerExtension::$google_analytics_code = 'UA-84547-8'; } -Validator::set_javascript_validation_handler('none'); - DocumentationSearch::set_meta_data(array( 'ShortName' => 'SilverStripe Documentation', 'Description' => 'Documentation for SilverStripe CMS / Framework', diff --git a/app/_config/config.yml b/app/_config/config.yml new file mode 100644 index 0000000..096fcae --- /dev/null +++ b/app/_config/config.yml @@ -0,0 +1,7 @@ +StaticExporter: + extensions: + - DocumentationStaticPublisherExtension + disable_sitetree_export: true +Controller: + extensions: + - ControllerExtension \ No newline at end of file diff --git a/app/code/ControllerExtension.php b/app/code/extensions/ControllerExtension.php similarity index 93% rename from app/code/ControllerExtension.php rename to app/code/extensions/ControllerExtension.php index f16a1c7..8e0ed46 100644 --- a/app/code/ControllerExtension.php +++ b/app/code/extensions/ControllerExtension.php @@ -15,7 +15,7 @@ class ControllerExtension extends Extension { } /** - * @return boolean + * @return bool */ public function IsDev() { return (Director::isDev()); diff --git a/composer.json b/composer.json index f4bd04c..b1fc476 100644 --- a/composer.json +++ b/composer.json @@ -3,8 +3,9 @@ "description": "The source code behind doc.silverstripe.org", "require": { "php": ">=5.3.2", - "silverstripe/docsviewer": "0.1.x-dev", - "silverstripe/framework": "3.0.x-dev" + "silverstripe/docsviewer": "dev-master", + "silverstripe/staticpublisher": "dev-master", + "silverstripe/framework": "3.1.x-dev" }, "config": { "process-timeout": 600 diff --git a/composer.lock b/composer.lock index fe43fd1..a1f7047 100644 --- a/composer.lock +++ b/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "edc15d70fab34d39f90088405d94ea90", + "hash": "0d2dbd6336d098b081f4f846fbd227a0", "packages": [ { "name": "composer/installers", @@ -82,20 +82,23 @@ }, { "name": "silverstripe/docsviewer", - "version": "0.1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/silverstripe/silverstripe-docsviewer.git", - "reference": "95fee5a9fffeba32e6d09a6bfba0f55d0ba1cefc" + "reference": "95b982353b6188287257a542bc4fae0a1b10c16b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/95fee5a9fffeba32e6d09a6bfba0f55d0ba1cefc", - "reference": "95fee5a9fffeba32e6d09a6bfba0f55d0ba1cefc", + "url": "https://api.github.com/repos/silverstripe/silverstripe-docsviewer/zipball/95b982353b6188287257a542bc4fae0a1b10c16b", + "reference": "95b982353b6188287257a542bc4fae0a1b10c16b", "shasum": "" }, "require": { - "silverstripe/framework": "3.0.*" + "silverstripe/framework": "~3.1" + }, + "suggest": { + "silverstripe/staticpublisher": "Allows publishing documentation as HTML" }, "type": "silverstripe-module", "notification-url": "https://packagist.org/downloads/", @@ -114,20 +117,20 @@ "documentation", "silverstripe" ], - "time": "2013-10-30 22:06:02" + "time": "2014-01-14 07:41:59" }, { "name": "silverstripe/framework", - "version": "3.0.x-dev", + "version": "3.1.x-dev", "source": { "type": "git", "url": "https://github.com/silverstripe/silverstripe-framework.git", - "reference": "dd801bdb0bfdd199d7bb6ce3269e1aedd7b1a8ce" + "reference": "9b5a9afe2be766e9830c795dc26636a82f59743c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/dd801bdb0bfdd199d7bb6ce3269e1aedd7b1a8ce", - "reference": "dd801bdb0bfdd199d7bb6ce3269e1aedd7b1a8ce", + "url": "https://api.github.com/repos/silverstripe/silverstripe-framework/zipball/9b5a9afe2be766e9830c795dc26636a82f59743c", + "reference": "9b5a9afe2be766e9830c795dc26636a82f59743c", "shasum": "" }, "require": { @@ -160,7 +163,46 @@ "framework", "silverstripe" ], - "time": "2014-01-10 23:19:12" + "time": "2014-01-14 05:19:45" + }, + { + "name": "silverstripe/staticpublisher", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/silverstripe-labs/silverstripe-staticpublisher.git", + "reference": "ea1461acd7eb78b25e629b5c6fedf719b37f63e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silverstripe-labs/silverstripe-staticpublisher/zipball/ea1461acd7eb78b25e629b5c6fedf719b37f63e8", + "reference": "ea1461acd7eb78b25e629b5c6fedf719b37f63e8", + "shasum": "" + }, + "require": { + "silverstripe/framework": "~3.1" + }, + "type": "silverstripe-module", + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Will Rossiter", + "email": "will@fullscreen.io", + "homepage": "http://wilr.github.com" + }, + { + "name": "Sam Minnee", + "email": "sam@silverstripe.com" + } + ], + "description": "StaticPublisher provides an extensions for exporting a SilverStripe application to either a local or remote file systems.", + "keywords": [ + "export", + "publisher", + "silverstripe-labs", + "static" + ], + "time": "2014-01-14 07:36:46" } ], "packages-dev": [ @@ -172,6 +214,7 @@ "minimum-stability": "stable", "stability-flags": { "silverstripe/docsviewer": 20, + "silverstripe/staticpublisher": 20, "silverstripe/framework": 20 }, "platform": {