Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CoreAPI major version bump tasks #63

Open
dakanji opened this issue Jun 29, 2012 · 7 comments
Open

Update CoreAPI major version bump tasks #63

dakanji opened this issue Jun 29, 2012 · 7 comments
Assignees
Milestone

Comments

@dakanji
Copy link
Owner

dakanji commented Jun 29, 2012

 * - 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.
@ghost ghost assigned dakanji Jun 29, 2012
@miceno
Copy link
Contributor

miceno commented Jan 18, 2019

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
Copy link
Owner Author

dakanji commented Jan 18, 2019

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
Copy link
Contributor

miceno commented Jan 18, 2019

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
Copy link
Owner Author

dakanji commented Jan 19, 2019

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
Copy link
Contributor

miceno commented Jan 19, 2019 via email

@dakanji
Copy link
Owner Author

dakanji commented Jan 19, 2019

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
Copy link
Owner Author

dakanji commented Jan 24, 2019

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

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

No branches or pull requests

2 participants