Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-683

Detect filename automatically based on class name

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: no change required
    • Affects Version/s: 5.1.0
    • Fix Version/s: None
    • Component/s: Optimization
    • Labels:
      None
    • Additional information:
      Hide

      This large change, since we need to rename most of our classes/files to keep everything working. That's why I propose this change to be made as part of 5.2.0 release.

      Show
      This large change, since we need to rename most of our classes/files to keep everything working. That's why I propose this change to be made as part of 5.2.0 release.
    • Change Log Group:
      Changed
    • Change Log Message:
      Automatically determine PHP file location by given class name.
    • External issue ID:
      850
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      I propose we auto-guess php class name based on filename, where that class is stored.

      For example "my_super_helper.php" file will contain "MySuperHelper" class and nothing other.

      There are several benefits of this:

      • no need to specify class name in unit config file (only class filename remains);
      • developer will be forced to properly name class file to connect it's class to the system.

      We'll make some presumptions, that:

      • "eh" will transform to "EventHandler"
      • "tp" will transform to "TagProcessor"
      • all classes from "core" module, that are not event handler/tag processor should have "k" in front of their name

      Before:

      • UsersEventHandler, users_event_handler.php
      • UserGroupsEventHandler, user_groups_eh.php
      • kThemesHelper, themes_helper.php
      • CustomFieldsTagProcessor, custom_fields_tag_processor.php

      After:

      • UserEventHandler, user_eh.php
      • UserGroupEventHandler, user_group_eh.php
      • kThemeHelper, theme_helper.php
      • CustomFieldTagProcessor, custom_field_tp.php

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: