dakanji / G2Project

Community Update of Gallery2 - A web based photo album viewer and editor
Other
7 stars 4 forks source link

Update CoreAPI major version bump tasks #63

Open dakanji opened 12 years ago

dakanji commented 12 years ago
 * - remove GallerySession::getSessionId
 * - remove GalleryPlatform::recursiveFixDirPermissions
 * - remove GalleryUtilities::htmlEntityDecode
 * - remove GalleryUrlGenerator::getGalleryId
 * - remove GalleryStatus::wrap
 * - change GalleryCoreApi::error to only take error code and error message
 * - remove GalleryCapabilities (major bump of embed api too?)
 * - remove 'link' entry in Gallery.class constructor
 * - remove GalleryCoreApi::getPluginBaseDirs();
 * - remove GalleryCoreApi::getPluginBaseDir();
 * - remove GalleryCoreApi::isPluginInDefaultLocation();
 * - remove $skipBaseDirectoryDetection from GalleryCoreApi::requireOnce();
 * - remove support for check[Sidebar|Album|Photo]Blocks deprecated params
 *   for ShouldShowEmergencyEditItemLink in Callbacks.inc
 *   and comment in blocks/EmergencyEditItemLink.tpl
 * - remove GalleryView::_getItem() (the private version of getItem());
 * - remove support for : separator in GalleryView::loadView
 * - delete GallerySqlFragment.class
 * - remove studyPermissions, fetchPermissionsForItems does the same and more.
 * - remove GalleryUtilities::utf8Substring (moved to GalleryCoreApi)
 * - remove lib/wz_dragdrop/ (currently used by G2.1's watermark module)
 * - refactor renderer code (methods: getRenderer and render, GalleryEntity vs GalleryItem)
 * - remove support for {modules,themes}/.../locale dirs from lib/tools/po scripts
 *   from GalleryTranslatorHelper_medium::installTranslationsForPlugin,
 *   and from getPackageNames() in lib/tools/repository/classes/RepositoryDescriptor.class
 * - remove resourceGetTemplateBaseDir from GalleryTemplate class
 * - delete GalleryTestCase::failWithStatus
 * - loadEntitiesById and deleteEntityById: make optional $requiredEntityType mandatory
 * - remove GalleryCoreApi::registerEventListener, GalleryModule::registerEventListeners
 *   and other code marked for removal in helpers/GalleryEventHelper_simple.class
 * - consider renaming everything using "languageCode" to "locale" for correct terminology
 *   (GalleryTranslator.class and Gallery.class)
 * - delete modules/core/templates/blocks/NavigationLinks.tpl
 * - remove GalleryRepository::getLanguageDescription
 * - convert the contents of GALLERY_PERMISSION_SESSION_KEY to array indices instead of array
 *   of values.
miceno commented 5 years ago

Should you consider to deal with all the changes in just one PR? Or do you prefer to split the issue in one PR per bullet?

dakanji commented 5 years ago

Hi,

Probably best to do things in small chunks although some of these may be interdependent.

Try to pull from dev once again before starting as I have updated the style to avoid conflicts. I will shortly update the contributing md file on steps to take to align coding style with a pre-commit hook

miceno commented 5 years ago

Great! I am using PHPStorm as of now and I found it difficult to align the style... I will appreciate any tools or suggestions :)

dakanji commented 5 years ago

It is basically PSR 2 with tabs for indentation and spaces for alignment.

Working on making this easier to adopt using composer but I need to test.

You could temporarily do the following:

  • composer global require "squizlabs/php_codesniffer=*"
  • composer global require friendsofphp/php-cs-fixer

Code your stuff as usual and before commit, run...

  1. cd /full/server/path/to/the/G2Project-repo
  2. phpcbf /full/server/path/to/the/G2Project-repo
  3. php-cs-fixer fix

This will take quite a lot of time due to the large number of files checked. Step 2 takes the bulk of this time and Step 3 will speed up on subsequent runs.

The style rules are already in the package and this will pick them up.

The pre-commit hook will only pass changed files so will be much less time. I just need to run a few tests first.

The file you have here: https://raw.githubusercontent.com/miceno/gallery2-ahpn/develop/.phpstorm.cs.xml seems to be reasonably close.

Main things I see from a quick look are:

  • TAB_SIZE = 4
  • CONTINUATION_INDENT_SIZE = 4
  • SPACE_AFTER_TYPE_CAST = false
  • KEEP_SIMPLE_METHODS_IN_ONE_LINE = false
  • Keep indents on empty lines = false
  • Braces placement = End of line

I don't actually use PHPStorm so this is an estimate.

So a manual run for now and later the hook will take care of things.

miceno commented 5 years ago

Thank you!!I will manage with these commands. There are tutorials on how to integrate those tools in PHPstorm.I was using a WordPress set of rules, I didn't try with PSR 2.The pre commit hook is a great idea.I think it will be enough to run the fixer on the files I plan to commit, or in any  folder I add and not in all the code, since you have already formatted it.Regards.On Jan 19, 2019 09:40, dakanji notifications@github.com wrote:It is basically PSR 2 with tabs for indentation and spaces for alignment. Working on making this easier to adopt using composer but I need to test. You could temporarily do the following:

composer global require "squizlabs/php_codesniffer=*"composer global require friendsofphp/php-cs-fixer

Code your stuff as usual and before commit, run...

cd /full/server/path/to/the/G2Project-repophpcbf /full/server/path/to/the/G2Project-repophp-cs-fixer fix

This will take quite a lot of time due to the large number of files checked. Step 2 takes the bulk of this time and Step 3 will speed up on subsequent runs. The style rules are already in the package and this will pick them up. The pre-commit hook will only pass changed files so will be much less time. I just need to run a few tests first. The file you have here: https://raw.githubusercontent.com/miceno/gallery2-ahpn/develop/.phpstorm.cs.xml seems to be reasonably close. Main things I see from a quick look are: TAB_SIZE = 4 CONTINUATION_INDENT_SIZE = 4 SPACE_AFTER_TYPE_CAST = false KEEP_SIMPLE_METHODS_IN_ONE_LINE = false Keep indents on empty lines = false Braces placement = End of line I don't actually use PHPStorm so this is an estimate. So a manual run for now and later the hook will take care of things.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

dakanji commented 5 years ago

I think it will be enough to run the fixer on the files I plan to commit, or in any folder I add and not in all the code

That should work...

  • phpcbf /full/server/path/to/the/G2Project-repo/affected/folder
  • php-cs-fixer fix /full/server/path/to/the/G2Project-repo/affected/folder

Unfortunately both tools are needed as neither gives a full result alone as of now.

dakanji commented 5 years ago

Please pull the dev branch and see contributing.md for instructions on setting up the dev environment