Giter Site home page Giter Site logo

bcaddonmigrator's People

Contributors

ryuring avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

bcaddonmigrator's Issues

テーマ名がCamelCaseでないテーマをマイグレーションしてもファイルの中身まで置換されない

baserCMS 3 betaの動作検証で利用させていただいています。

テーマのマイグレーションを実行した際の問題です。
テーマ名がアッパーキャメルケースに沿っているテーマは正常にマイグレーションされますが、そうでないテーマはヘルパーファイルとビューファイルの中身の置換が動きませんでした。

原因

    public function migrateTheme($theme) {

            $this->migrateThemeStructure($theme);
            $newTheme = Inflector::camelize($theme);

            $themePath = WWW_ROOT . 'theme' . DS . $newTheme;                
            $this->migrateHelper($themePath . DS . 'Helper');
            $this->migrateView($themePath);

    }

BcAddonMigrator3Componentの上記メソッドを見ると、
新しいテーマ名$newThemeは元のテーマ名$themeをアッパーキャメルケースに変換したものになっています。
しかし、元のテーマ名と新しいテーマ名が異なる場合(=元のテーマ名がアッパーキャメルケースではない場合)でも、テーマフォルダ自体はリネームされていないように見受けられます。

この結果、migrateHelperとmigrateViewの引数に存在しないディレクトリのパスが渡されてしまいます。

マイグレーション対象のテーマフォルダをアッパーキャメルケースにリネームするか、新しいテーマのパスを使わず元のテーマのパスを引数に渡すように変更する必要があるかと思いますが、いかがでしょうか?

また、CakePHP2系ではテーマ名もアッパーキャメルケースが標準だったと記憶しています。baserCMS 3からテーマ名はアッパーキャメルケースに統一することになるのでしょうか?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.