本文整理汇总了PHP中false::output方法的典型用法代码示例。如果您正苦于以下问题:PHP false::output方法的具体用法?PHP false::output怎么用?PHP false::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类false
的用法示例。
在下文中一共展示了false::output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateCache
/**
* Generates the static cache from the configured INI settings.
*
* @param bool $force If true then it will create all static caches even if it is not outdated.
* @param bool $quiet If true then the function will not output anything.
* @param eZCLI|false $cli The eZCLI object or false if no output can be done.
* @param bool $delay
*/
public function generateCache( $force = false, $quiet = false, $cli = false, $delay = true )
{
$staticURLArray = $this->cachedURLArray();
$db = eZDB::instance();
$configSettingCount = count( $staticURLArray );
$currentSetting = 0;
// This contains parent elements which must checked to find new urls and put them in $generateList
// Each entry contains:
// - url - Url of parent
// - glob - A glob string to filter direct children based on name
// - org_url - The original url which was requested
// - parent_id - The element ID of the parent (optional)
// The parent_id will be used to quickly fetch the children, if not it will use the url
$parentList = array();
// A list of urls which must generated, each entry is a string with the url
$generateList = array();
foreach ( $staticURLArray as $url )
{
$currentSetting++;
if ( strpos( $url, '*') === false )
{
$generateList[] = $url;
}
else
{
$queryURL = ltrim( str_replace( '*', '', $url ), '/' );
$dir = dirname( $queryURL );
if ( $dir == '.' )
$dir = '';
$glob = basename( $queryURL );
$parentList[] = array( 'url' => $dir,
'glob' => $glob,
'org_url' => $url );
}
}
// As long as we have urls to generate or parents to check we loop
while ( count( $generateList ) > 0 || count( $parentList ) > 0 )
{
// First generate single urls
foreach ( $generateList as $generateURL )
{
if ( !$quiet and $cli )
$cli->output( "caching: $generateURL ", false );
$this->cacheURL( $generateURL, false, !$force, $delay );
if ( !$quiet and $cli )
$cli->output( "done" );
}
$generateList = array();
// Then check for more data
$newParentList = array();
foreach ( $parentList as $parentURL )
{
if ( isset( $parentURL['parent_id'] ) )
{
$elements = eZURLAliasML::fetchByParentID( $parentURL['parent_id'], true, true, false );
foreach ( $elements as $element )
{
$path = '/' . $element->getPath();
$generateList[] = $path;
$newParentList[] = array( 'parent_id' => $element->attribute( 'id' ) );
}
}
else
{
if ( !$quiet and $cli and $parentURL['glob'] )
$cli->output( "wildcard cache: " . $parentURL['url'] . '/' . $parentURL['glob'] . "*" );
$elements = eZURLAliasML::fetchByPath( $parentURL['url'], $parentURL['glob'] );
foreach ( $elements as $element )
{
$path = '/' . $element->getPath();
$generateList[] = $path;
$newParentList[] = array( 'parent_id' => $element->attribute( 'id' ) );
}
}
}
$parentList = $newParentList;
}
}