当前位置: 首页>>代码示例>>PHP>>正文


PHP modPackageBuilder::buildLexicon方法代码示例

本文整理汇总了PHP中modPackageBuilder::buildLexicon方法的典型用法代码示例。如果您正苦于以下问题:PHP modPackageBuilder::buildLexicon方法的具体用法?PHP modPackageBuilder::buildLexicon怎么用?PHP modPackageBuilder::buildLexicon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在modPackageBuilder的用法示例。


在下文中一共展示了modPackageBuilder::buildLexicon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$xg_snippet->setProperties($properties);
$category->addMany($xg_snippet);
/* create XPhoto snippet */
$xph_snippet = $modx->newObject('modSnippet');
$xph_snippet->set('id', 1);
$xph_snippet->set('name', 'XPhoto');
$xph_snippet->set('description', 'Display single flickr photo with additional information.');
$xph_snippet->set('snippet', file_get_contents($sources['source_core'] . '/snippet.xphoto.php'));
$properties = (include $sources['data'] . 'properties.xphoto.inc.php');
$xph_snippet->setProperties($properties);
$category->addMany($xph_snippet);
/* create category vehicle */
$attr = array(XPDO_TRANSPORT_UNIQUE_KEY => 'category', XPDO_TRANSPORT_PRESERVE_KEYS => false, XPDO_TRANSPORT_UPDATE_OBJECT => true, XPDO_TRANSPORT_RELATED_OBJECTS => true, XPDO_TRANSPORT_RELATED_OBJECT_ATTRIBUTES => array('Snippets' => array(XPDO_TRANSPORT_PRESERVE_KEYS => false, XPDO_TRANSPORT_UPDATE_OBJECT => true, XPDO_TRANSPORT_UNIQUE_KEY => 'name')));
$vehicle = $builder->createVehicle($category, $attr);
$vehicle->resolve('file', array('source' => $sources['source_core'], 'target' => "return MODX_CORE_PATH . 'components/';"));
$vehicle->resolve('file', array('source' => $sources['source_assets'], 'target' => "return MODX_ASSETS_PATH . 'components/';"));
$vehicle->resolve('php', array('source' => $sources['resolvers'] . 'setupoptions.resolver.php'));
$builder->putVehicle($vehicle);
/* load lexicon strings */
$builder->buildLexicon($sources['lexicon']);
/* now pack in the license file, readme and setup options */
$builder->setPackageAttributes(array('license' => file_get_contents($sources['docs'] . 'license.txt'), 'readme' => file_get_contents($sources['docs'] . 'readme.txt'), 'setup-options' => array('source' => $sources['build'] . 'setup.options.php')));
$builder->pack();
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tend = $mtime;
$totalTime = $tend - $tstart;
$totalTime = sprintf("%2.4f s", $totalTime);
$modx->log(MODX_LOG_LEVEL_INFO, "\n<br />Package Built.<br />\nExecution time: {$totalTime}\n");
exit;
开发者ID:ChrstnMgcn,项目名称:xflickr,代码行数:31,代码来源:build.transport.php


注:本文中的modPackageBuilder::buildLexicon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。