示例#1
0
文件: Files.php 项目: spuy767/sdk
 /**
  * @param ControllerGenerator $generator
  */
 public static function saveController($generator)
 {
     $generator->setNamespace(Generator::$namespace . '\\' . $generator->getVersion() . '\\' . 'Controllers\\' . $generator->getEntityName());
     $filePath = self::formPath($generator->getVersion(), 'Controllers', $generator->getEntityName(), $generator->getEntityName() . 'Controller');
     $class = $generator->create();
     if (is_file($filePath)) {
         $diff = new ClassDiff($filePath, $class->getNamespaceName() . '\\' . $class->getName(), $class);
         $class = $diff->merge();
     }
     file_put_contents($filePath, self::generatorToString($class));
 }
示例#2
0
文件: Files.php 项目: shinichi81/sdk
 /**
  * @param Generator\SDK\SDKGenerator $generator
  */
 public static function saveSDK($generator)
 {
     $generator->setNamespace(Generator::$namespace);
     $filePath = self::$outputDir . '/' . $generator->getVersion() . '/' . $generator->getName() . '.php';
     $class = $generator->create();
     if (is_file($filePath)) {
         $diff = new ClassDiff($filePath, $class->getNamespaceName() . '\\' . $class->getName(), $class);
         $class = $diff->merge();
     }
     file_put_contents($filePath, self::generatorToString($class));
 }