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


PHP Frontend::cleanPath方法代码示例

本文整理汇总了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
 }
开发者ID:arhe,项目名称:pwak,代码行数:58,代码来源:CodeGenerator.php


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