Last active
December 18, 2015 17:28
-
-
Save Abban/5818362 to your computer and use it in GitHub Desktop.
Get Anchor CMS Working on PHP 5.3.0+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In anchor/libraries/anchor.php change lines 50 -65 from: | |
public static function functions() { | |
if( ! is_admin()) { | |
$fi = new FilesystemIterator(APP . 'functions', FilesystemIterator::SKIP_DOTS); | |
foreach($fi as $file) { | |
if($file->isFile() and $file->isReadable() and '.' . $file->getExtension() == EXT) { | |
require $file->getPathname(); | |
} | |
} | |
// include theme functions | |
if(is_readable($path = PATH . 'themes' . DS . Config::meta('theme') . DS . 'functions.php')) { | |
require $path; | |
} | |
} | |
} | |
// To | |
public static function functions() { | |
if( ! is_admin()) { | |
$fi = new FilesystemIterator(APP . 'functions', FilesystemIterator::SKIP_DOTS); | |
foreach($fi as $file) { | |
$ext = (version_compare(PHP_VERSION, '5.3.6') < 0) ? pathinfo($file, PATHINFO_EXTENSION) : $file->getExtension(); | |
if($file->isFile() and $file->isReadable() and '.' . $ext == EXT) { | |
require $file->getPathname(); | |
} | |
} | |
// include theme functions | |
if(is_readable($path = PATH . 'themes' . DS . Config::meta('theme') . DS . 'functions.php')) { | |
require $path; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//In system/boot.php change lines 16 - 19 from | |
if(version_compare(PHP_VERSION, '5.3.6') < 0) { | |
echo 'We need PHP 5.3.6 or higher, you are running ' . PHP_VERSION; | |
exit; | |
} | |
// To | |
if(version_compare(PHP_VERSION, '5.3.0') < 0) { | |
echo 'We need PHP 5.3.6 or higher, you are running ' . PHP_VERSION; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Worked!!! Thanks for taking the time to share this gist!
I was preparing to spend my day breaking everything on my server by manually upgrading to 5.3.6. You just saved me an entire day of hating my life. Thanks!