Forums / Developer / Modify a content class via script

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Modify a content class via script

Author Message

Jérôme Vieilledent

Saturday 07 February 2009 6:58:40 am

Hi

Does anybody know if it is possible to (easily) modify a content class with a PHP script ?
Indeed, I sometimes have to add/remove attributes in my content classes to satisfy the new needs of my clients. The problem is that I have to do this in the admin, on my dev environment, on the pre-production environment and finally on the production environment. That's annoying and it can be dangerous if you forget something...

Thanks for your help

Łukasz Serwatka

Saturday 07 February 2009 12:23:46 pm

Hi,

You can take a look on code in this contribution. It should give you some ideas how to add attributes on PHP level.

http://ez.no/developer/contribs/hacks/update_class_from_command_line

See also user comments.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog