本文整理汇总了PHP中Frontend::cleanPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Frontend::cleanPath方法的具体用法?PHP Frontend::cleanPath怎么用?PHP Frontend::cleanPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frontend
的用法示例。
在下文中一共展示了Frontend::cleanPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @access public
*/
public function __construct($path, $entitiesToGen = array())
{
$xmlfile = Frontend::cleanPath($path) . '/config/xml/project.xml';
$this->_projectPath = Frontend::cleanPath($path);
$this->xml = simplexml_load_file($xmlfile);
$this->entitiesToGen = $entitiesToGen;
$this->smarty = new Smarty();
$this->smarty->compile_dir = SMARTY_COMPILE_DIR;
$this->smarty->template_dir = dirname(__FILE__) . '/templates';
$this->smarty->force_compile = true;
$this->smarty->left_delimiter = '[[';
$this->smarty->right_delimiter = ']]';
$this->smarty->caching = false;
$file = self::$fileData;
$entities = $links = array();
foreach ($this->xml->entity as $entity) {
$e = $this->handleEntity($entity);
$entities[strval($e['name'])] = $e;
foreach ($e['links'] as $link) {
if (!isset($links[strval($link['linktable'])])) {
$links[strval($link['linktable'])] = array('tablename' => $link['linktable'], 'field' => $link['field'], 'linkfield' => $link['linkfield']);
}
}
}
// Add links to navigable foreign keys
foreach ($entities as $entity) {
foreach ($entity['fkeys'] as $p) {
if (isset($entities[strval($p['class'])]) && $p['navigable'] == 1) {
$linkType = 'onetomany';
// XXX
$link = array();
$link['name'] = !empty($p['navigablename']) ? $p['navigablename'] : $entity['name'];
$link['class'] = $entity['name'];
$link['field'] = $p['name'];
$link['ondelete'] = !empty($p['ondelete']) ? $p['ondelete'] : 'nullify';
$link['multiplicity'] = $linkType;
$link['type'] = self::$propertyTypeMap[$linkType];
$link['type']['name'] = $linkType;
$entities[strval($p['class'])]['links'][] = $link;
}
}
}
$this->_entities = $entities;
// manage mapping
$this->fullMapping = array();
foreach ($entities as $entity) {
$this->fullMapping[strval($entity['name'])] = $this->buildMapping($entity);
}
$this->smarty->assign('file', $file);
$this->smarty->assign('entities', $entities);
$this->smarty->assign('links', $links);
// to generate links tables in sql
}