Skip to main content
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

I can't say we've ever gone to any lengths to prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

I can't say we've ever gone to any lengths to prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

I can't say we've ever gone to any lengths to prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

added 5 characters in body
Source Link
Ben Lessani
  • 17.7k
  • 4
  • 44
  • 69

I can't say we've ever gone to any lengths doto prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code)(the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

I can't say we've ever gone any lengths do prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

I can't say we've ever gone to any lengths to prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

added 509 characters in body
Source Link
Ben Lessani
  • 17.7k
  • 4
  • 44
  • 69

I can't say we've ever gone any lengths do prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to be more verboseelaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

I can't say we've ever gone any lengths do prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to be more verbose on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

I can't say we've ever gone any lengths do prevent it - as we simply don't do it. Or worst case scenario (the underpant elves changed your core code) - you see it on the next Git commit that you issue.

But I guess there is a few ways to clean up/prevent it happening. So just to elaborate on your bullet points.

###Finding modifications

Identifying changes is fairly easy, just download a clean equivalent release and perform a diff on the respective directories.

diff -r ./app/code/core ./clean_mage/app

You can find a more more guidance in the Magento debugging answer.

###Preventing modifications

You could prevent edits to the core just by altering file permissions, make them read/execute only

chmod -R 555 ./app/code/core

Or go a step further and make them immutable

chattr +i -R ./app/code/core

###Undoing modifications in real-time

If you are using Git, and your core is under version control, you could add a hook just to checkout the core prior to a commit

.git/hooks/pre-commit

#!/bin/bash
git checkout /home/path/public_html/app/code/core

###Using local

Its a last resort really. The PHP include path (its not a Magento thing) will prevent you from being able to declare the same class twice.

Local > Community > Core

So the moment you add a class to local, the respective matching file won't be read from anywhere else. So you need to copy in the whole file contents.

For abstract/final classes - you don't have much of a choice, but for most other tasks, you can usually rewrite the class and bundle it into a module in community

Source Link
Ben Lessani
  • 17.7k
  • 4
  • 44
  • 69
Loading