本文整理汇总了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);
}