diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-22 01:35:59 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-22 01:35:59 +0200 |
commit | 78d3e2164116f299effb11d25b1971e6d375366e (patch) | |
tree | d7a875f96833946b82f001ebdba1c23b19d32b17 /3rdparty/simplepie/build/compile.php | |
parent | fb28fadcf6e71b4b797aa4241436ec3add543ba0 (diff) |
get rid of simplepie
Diffstat (limited to '3rdparty/simplepie/build/compile.php')
-rwxr-xr-x | 3rdparty/simplepie/build/compile.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/3rdparty/simplepie/build/compile.php b/3rdparty/simplepie/build/compile.php deleted file mode 100755 index 34a29d4c7..000000000 --- a/3rdparty/simplepie/build/compile.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -// Set up our constants -define('SP_PATH', dirname(dirname(__FILE__))); -define('COMPILED', SP_PATH . DIRECTORY_SEPARATOR . 'SimplePie.compiled.php'); - -function remove_header($contents) -{ - $tokens = token_get_all($contents); - $stripped_source = ''; - $stripped_doc = false; - $stripped_open = false; - foreach ($tokens as $value) - { - if (is_string($value)) - { - $stripped_source .= "{$value}"; - continue; - } - switch ($value[0]) - { - case T_DOC_COMMENT: - if (!$stripped_doc) - { - $stripped_doc = true; - continue 2; - } - break; - case T_OPEN_TAG: - if (!$stripped_open) - { - $stripped_open = true; - continue 2; - } - break; - } - $stripped_source .= "{$value[1]}"; - } - - return $stripped_source; -} - -// Start with the header -$compiled = file_get_contents(SP_PATH . '/build/header.txt'); -$compiled .= "\n"; - -// Add the base class -$contents = file_get_contents(SP_PATH . '/library/SimplePie.php'); -$compiled .= remove_header($contents) . "\n"; - -// Add all the files in the SimplePie directory -$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(SP_PATH . '/library/SimplePie')); -foreach($files as $file_path => $info) -{ - $contents = file_get_contents($file_path); - $compiled .= remove_header($contents) . "\n"; -} - -// Strip excess whitespace -$compiled = preg_replace("#\n\n\n+#", "\n\n", $compiled); - -// Hardcode the build -$compiled = str_replace( - "define('SIMPLEPIE_BUILD', gmdate('YmdHis', SimplePie_Misc::get_build()))", - "define('SIMPLEPIE_BUILD', '" . gmdate('YmdHis', time()) . "')", - $compiled -); - -// Finally, save -file_put_contents(COMPILED, $compiled);
\ No newline at end of file |