本文整理匯總了PHP中Helpers::rglob方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helpers::rglob方法的具體用法?PHP Helpers::rglob怎麽用?PHP Helpers::rglob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Helpers
的用法示例。
在下文中一共展示了Helpers::rglob方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_partial_template
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';
}
示例2: ob_start
<?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();
示例3: die
<?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);
}
示例4: die
<?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);
}