Skip to content

Instantly share code, notes, and snippets.

@suin
Created October 15, 2012 06:31
Show Gist options
  • Save suin/3891076 to your computer and use it in GitHub Desktop.
Save suin/3891076 to your computer and use it in GitHub Desktop.
XOOPS 構造変更案

1 オーソドックス

xoops_trust_path/modules/xcore
├── actions
├── admin
├── blocks
├── class <-- ここに現在の html/core を入れ込む
├── forms
├── images
├── include
├── index.php
├── kernel
├── language
├── lib
├── preload
├── service
└── templates
└── xoops_version.php

2 PSR-0準拠 コードとリソースをより分離

xoops_trust_path/modules/xcore
├── index.php
├── resources
│   ├── public
│   │   ├── css
│   │   ├── images
│   │   └── js
│   └── templates
├── src
│   └── XCore
│       ├── Action
│       ├── Admin
│       ├── Form
│       ├── Kernel <-- ここに現在の html/core を入れ込む
│       ├── Preload
│       └── Service
└── xoops_version.php

3 PSR-0準拠 Symfony2ライク

├── index.php
├── src
│   └── XCore
│       ├── Action
│       ├── Admin
│       ├── Form
│       ├── Kernel <-- ここに現在の html/core を入れ込む
│       ├── Preload
│       ├── Resources
│       │   ├── public
│       │   │   ├── css
│       │   │   ├── images
│       │   │   └── js
│       │   └── templates
│       └── Service
└── xoops_version.php
@suin
Copy link
Author

suin commented Nov 15, 2012

第6案

  • index.php は Public へ(たぶん、このほうが Public にシンボリックリンクを張るとか、ハードコピーするとかいろいろ楽なはず)
  • Publicの中身は ウェブに公開されるので、URLに大文字が入るとなんとなく気持ちよくないので、小文字のままにした。
  • XoopsObject をエンティティとして移動、XoopsHandler系をリポジトリとして移動する
xoops_trust_path/modules/XCore
.
├── Action
├── Admin
├── Entity <-- html/kernel の XoopsObject をエンティティとして移動する
│   ├── AbstractEntity.php
│   ├── Avatar.php
│   ├── Block.php
│   ├── Cachetime.php
│   ├── Comment.php
│   ├── ConfigCategory.php
│   ├── ConfigItem.php
│   ├── ConfigOption.php
│   ├── Group.php
│   ├── GroupPerm.php
│   ├── GuestUser.php
│   ├── Image.php
│   ├── Imagecategory.php
│   ├── Imageset.php
│   ├── Imagesetimg.php
│   ├── Membership.php
│   ├── Module.php
│   ├── Notification.php
│   ├── Object.php
│   ├── Privmessage.php
│   ├── Subjecticon.php
│   ├── Timezone.php
│   ├── Tplfile.php
│   ├── Tplset.php
│   └── User.php
├── Form
├── Kernel <-- html/core を移動する(Validatorなどは構造化したほうがいいか?)
│   ├── AbstractArrayProperty.php
│   ├── AbstractPermissionProvider.php
│   ├── AbstractProperty.php
│   ├── AbstractRequest.php
│   ├── AbstractServiceClient.php
│   ├── ActionForm.php
│   ├── BoolArrayProperty.php
│   ├── BoolProperty.php
│   ├── Controller.php
│   ├── Delegate.php
│   ├── DelegateManager.php
│   ├── DelegateUtils.php
│   ├── DependClassFactory.php
│   ├── EmailValidator.php
│   ├── ExtensionValidator.php
│   ├── FieldProperty.php
│   ├── FileArrayProperty.php
│   ├── FileProperty.php
│   ├── Filter.php
│   ├── FloatArrayProperty.php
│   ├── FloatProperty.php
│   ├── FormFile.php
│   ├── FormImageFile.php
│   ├── GenericArrayProperty.php
│   ├── GenericRequest.php
│   ├── HttpContext.php
│   ├── HttpRequest.php
│   ├── Identity.php
│   ├── ImageFileArrayProperty.php
│   ├── ImageFileProperty.php
│   ├── IniHandler.php
│   ├── IntArrayProperty.php
│   ├── IntProperty.php
│   ├── IntRangeValidator.php
│   ├── LanguageManager.php
│   ├── MaskValidator.php
│   ├── MaxValidator.php
│   ├── MaxfilesizeValidator.php
│   ├── MaxlengthValidator.php
│   ├── MinValidator.php
│   ├── MinlengthValidator.php
│   ├── Object.php
│   ├── ObjectArray.php
│   ├── PageNavigator.php
│   ├── Permissions.php
│   ├── Principal.php
│   ├── PropertyInterface.php
│   ├── Ref.php
│   ├── RenderCache.php
│   ├── RenderSystem.php
│   ├── RenderTarget.php
│   ├── RequiredValidator.php
│   ├── Role.php
│   ├── RoleManager.php
│   ├── Root.php
│   ├── Service.php
│   ├── ServiceClient.php
│   ├── ServiceManager.php
│   ├── ServiceUtils.php
│   ├── Session.php
│   ├── StringArrayProperty.php
│   ├── StringProperty.php
│   ├── TextArrayProperty.php
│   ├── TextFilter.php
│   ├── TextProperty.php
│   ├── Theme.php
│   ├── Utils.php
│   └── Validator.php
├── Preload
├── Public
│   ├── css
│   ├── images
│   ├── index.php
│   └── js
├── Repository <--- XoopsHandler系をリポジトリとして移動する
│   ├── AvatarRepository.php
│   ├── BlockRepository.php
│   ├── CachetimeRepository.php
│   ├── CommentRepository.php
│   ├── ConfigCategoryRepository.php
│   ├── ConfigItemRepository.php
│   ├── ConfigOptionRepository.php
│   ├── ConfigRepository.php
│   ├── GroupPermRepository.php
│   ├── GroupRepository.php
│   ├── ImageRepository.php
│   ├── ImagecategoryRepository.php
│   ├── ImagesetRepository.php
│   ├── ImagesetimgRepository.php
│   ├── MemberRepository.php
│   ├── MembershipRepository.php
│   ├── ModuleRepository.php
│   ├── NotificationRepository.php
│   ├── ObjectRepository.php
│   ├── OnlineRepository.php
│   ├── PrivmessageRepository.php
│   ├── SessionRepository.php
│   ├── SubjecticonRepository.php
│   ├── TimezoneRepository.php
│   ├── TplfileRepository.php
│   ├── TplsetRepository.php
│   └── UserRepository.php
├── Service
├── Template
└── xoops_version.php

13 directories, 122 files

@suin
Copy link
Author

suin commented Nov 15, 2012

6案は単純移動にすぎない。次のステップでXCoreの粒度を小さくする必要ある。
一部はComponent化し、一部は削除するリファクタリングが必須になると思う。

@suin
Copy link
Author

suin commented Nov 16, 2012

第6案 A : (単体テスト、結合テスト置き場を追加)

xoops_trust_path/modules/XCore
├── Action
├── Admin
├── Entity
│   ├── AbstractEntity.php
│ │(略)
│   └── User.php
├── Form
├── Kernel
│   ├── AbstractArrayProperty.php
│ │(略)
│   └── Validator.php
├── Preload
├── Public
│   ├── css
│   ├── images
│   ├── index.php
│   └── js
├── Repository
│   ├── AvatarRepository.php
│ │(略)
│   └── UserRepository.php
├── Service
├── Template
├── Tests
│   ├── Join <--- 結合テスト
│   └── Unit <--- 単体テスト
└── xoops_version.php

16 directories, 122 files

@suin
Copy link
Author

suin commented Nov 17, 2012

判断材料

xcoreRender -> xcore に移動したときにファイル名が重複するファイル:

xcore/admin/actions/index.html
xcore/admin/class/index.html
xcore/admin/forms/index.html
xcore/admin/forms/ThemeSelectForm.class.php
xcore/admin/index.php
xcore/admin/menu.php
xcore/admin/templates/index.html
xcore/admin/templates/stylesheets/module.css
xcore/class/AbstractDeleteAction.class.php
xcore/class/AbstractEditAction.class.php
xcore/class/AbstractFilterForm.class.php
xcore/class/AbstractListAction.class.php
xcore/class/ActionFrame.class.php
xcore/class/index.html
xcore/class/Module.class.php
xcore/class/theme.php
xcore/images/index.html
xcore/kernel/index.html
xcore/language/english/admin.php
xcore/language/english/help/help.html
xcore/language/english/help/index.html
xcore/language/english/index.html
xcore/language/english/modinfo.php
xcore/language/index.html
xcore/language/ja_utf8/admin.php
xcore/language/ja_utf8/help/help.html
xcore/language/ja_utf8/help/index.html
xcore/language/ja_utf8/modinfo.php
xcore/language/japanese/admin.php
xcore/language/japanese/help/help.html
xcore/language/japanese/help/index.html
xcore/language/japanese/index.html
xcore/language/japanese/modinfo.php
xcore/preload/index.html
xcore/preload/ThemeSelect.class.php
xcore/templates/index.html
xcore/xoops_version.php

stdCache -> xcore に移動したときにファイル名が重複するファイル:

xcore/admin/index.php
xcore/admin/templates/index.html
xcore/blocks/index.html
xcore/images/index.html
xcore/language/english/admin.php
xcore/language/english/help/help.html
xcore/language/english/help/images/index.html
xcore/language/english/help/index.html
xcore/language/english/index.html
xcore/language/english/modinfo.php
xcore/language/index.html
xcore/language/ja_utf8/admin.php
xcore/language/ja_utf8/help/help.html
xcore/language/ja_utf8/help/index.html
xcore/language/ja_utf8/modinfo.php
xcore/language/japanese/admin.php
xcore/language/japanese/help/help.html
xcore/language/japanese/help/index.html
xcore/language/japanese/index.html
xcore/language/japanese/modinfo.php
xcore/preload/index.html
xcore/templates/blocks/index.html
xcore/templates/index.html
xcore/xoops_version.php

@suin
Copy link
Author

suin commented Nov 17, 2012

stdCache -> xcore に移動したときにファイル名が重複するファイル:

[捨てる?]
xcore/admin/index.php

↑ヘルプページ(/xcore/admin/index.php?action=Help&dirname=stdCache)に移動するだけ

[くっつけちゃう]
xcore/language/english/admin.php
xcore/language/english/help/help.html
xcore/language/english/modinfo.php
xcore/language/ja_utf8/admin.php
xcore/language/ja_utf8/help/help.html
xcore/language/ja_utf8/modinfo.php
xcore/language/japanese/admin.php
xcore/language/japanese/help/help.html
xcore/language/japanese/modinfo.php

[マージ]
xcore/xoops_version.php

@suin
Copy link
Author

suin commented Nov 17, 2012

xcoreRender -> xcore に移動したときにファイル名が重複するファイル:

xcore/admin/forms/ThemeSelectForm.class.php
xcore/admin/index.php
xcore/admin/menu.php
xcore/admin/templates/stylesheets/module.css
xcore/class/AbstractDeleteAction.class.php
xcore/class/AbstractEditAction.class.php
xcore/class/AbstractFilterForm.class.php
xcore/class/AbstractListAction.class.php
xcore/class/ActionFrame.class.php
xcore/class/Module.class.php
xcore/class/theme.php
xcore/language/english/admin.php
xcore/language/english/help/help.html
xcore/language/english/modinfo.php
xcore/language/ja_utf8/admin.php
xcore/language/ja_utf8/help/help.html
xcore/language/ja_utf8/modinfo.php
xcore/language/japanese/admin.php
xcore/language/japanese/help/help.html
xcore/language/japanese/modinfo.php
xcore/preload/ThemeSelect.class.php
xcore/xoops_version.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment