summaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile/php.py
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/plugins/compile/php.py')
-rw-r--r--nikola/plugins/compile/php.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/nikola/plugins/compile/php.py b/nikola/plugins/compile/php.py
index 44701c8..14b80e8 100644
--- a/nikola/plugins/compile/php.py
+++ b/nikola/plugins/compile/php.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -35,6 +35,11 @@ import codecs
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompilePhp(PageCompiler):
"""Compile PHP into PHP."""
@@ -46,7 +51,10 @@ class CompilePhp(PageCompiler):
shutil.copyfile(source, dest)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
os.makedirs(os.path.dirname(path))