static function get_partial_template($name) { # return contents of partial file, or return 'not found' error (as text) if (!self::$partials) { self::$partials = Helpers::rglob('./templates/partials*/*.*'); } foreach (self::$partials as $partial) { if (preg_match('/([^\\/]+?)\\.[\\w]+?$/', $partial, $file_name)) { if ($file_name[1] == $name) { return file_get_contents($partial); } } } return 'Partial \'' . $name . '\' not found'; }
<?php ob_start(); # let people know if they are running an unsupported version of PHP if (phpversion() < 5) { die('<h3>Cindy requires PHP/5.0 or higher.<br>You are currently running PHP/' . phpversion() . '.</h3><p>You should contact your host to see if they can upgrade your version of PHP.</p>'); } else { # require helpers class so we can use rglob require_once './app/helpers.inc.php'; # include any php files which sit in the app folder include_once "config.php"; foreach (Helpers::rglob('./app/**.inc.php') as $include) { include_once $include; } foreach (Helpers::rglob('./plugins/**config.php') as $include) { include_once $include; } # start the app new Stacey($_GET); } ob_flush();
<?php # let people know if they are running an unsupported version of PHP if (phpversion() < 5) { die('<h3>Stacey requires PHP/5.0 or higher.<br>You are currently running PHP/' . phpversion() . '.</h3><p>You should contact your host to see if they can upgrade your version of PHP.</p>'); } else { # require helpers class so we can use rglob require_once './app/helpers.inc.php'; # include any php files which sit in the app folder foreach (Helpers::rglob('./app/**.inc.php') as $include) { include_once $include; } # start the app new Stacey($_GET); }
<?php # let people know if they are running an unsupported version of PHP if (phpversion() < 5.2) { die('<h3>Stacey requires PHP/5.2 or higher.<br>You are currently running PHP/' . phpversion() . '.</h3><p>You should contact your host to see if they can upgrade your version of PHP (as 5.2 is pretty standard these days).</p>'); } else { # require config require_once './extensions/config.php'; # require helpers class so we can use rglob require_once './app/helpers.inc.php'; # require the yaml parser require_once './app/parsers/yaml/sfYaml.php'; # include any php files which sit in the app folder foreach (Helpers::rglob('./app/**.inc.php') as $include) { include_once $include; } # include any custom extensions foreach (Helpers::rglob('./extensions/**.inc.php') as $include) { include_once $include; } # start the app new Stacey($_GET); }