Permalink
Browse files

Add PHP wrapper as workaround for web servers which are not configure…

…d to serve .htc files as content type text/x-component.
  • Loading branch information...
1 parent c97a6f2 commit 1531a0767b742ef1858a87e8abdfaa41cbea357e Jason Johnston committed May 8, 2010
Showing with 31 additions and 2 deletions.
  1. +13 −2 build.xml
  2. +18 −0 sources/wrappers/PIE.php
View
@@ -48,7 +48,6 @@
--compilation_level ADVANCED_OPTIMIZATIONS
--externs ${src_dir}/closure_externs.js' />
</exec>
- <delete file="${build_dir}/temp.js" />
<!--
<exec executable="yuicompressor">
@@ -61,8 +60,20 @@
<fileset file="${build_dir}/script_compressed.js" />
<fileset file="${src_dir}/htc_close.txt" />
</concat>
+
+ <delete file="${build_dir}/temp.js" />
+ <delete file="${build_dir}/script_uncompressed.js" />
+ <delete file="${build_dir}/script_compressed.js" />
</target>
- <target name="package" depends="package-uncompressed,package-compressed" />
+
+ <target name="copy-wrappers">
+ <copy todir="${build_dir}">
+ <fileset dir="${src_dir}/wrappers" />
+ </copy>
+ </target>
+
+
+ <target name="package" depends="package-uncompressed,package-compressed,copy-wrappers" />
</project>
View
@@ -0,0 +1,18 @@
+<?php
+/*
+This file is a wrapper, for use in PHP environments, which serves PIE.htc using the
+correct content-type, so that IE will recognize it as a behavior. Simply specify the
+behavior property to fetch this .php file instead of the .htc directly:
+
+.myElement {
+ [ ...css3 properties... ]
+ behavior: url(PIE.php);
+}
+
+This is only necessary when the web server is not already configured to serve .htc files
+with the text/x-component content-type.
+*/
+
+header( 'Content-type: text/x-component' );
+include( 'PIE.htc' );
+?>

0 comments on commit 1531a07

Please sign in to comment.