Overriding Core Class

Permalink 1 user found helpful
Hello,

I'm trying to override the core class Concrete\Core\Sharing\SocialNetwork\Service. I don't want to extend this class but instead change its behaviour so that all blocks that's using Concrete\Core\Sharing\SocialNetwork\Service will benefit.

In the documentation for 5.7 it says

application/src
This directory contains custom PHP classes used by this application, or (in some limited cases) overrides of core Concrete5 PHP classes. Note: this directory obeys the same casing rules as the concrete/src directory.


So what I did is copying original from
concrete/src/Sharing/SocialNetwork/Service.php
to
application/src/Sharing/SocialNetwork/Service.php
I changed what I wanted but it's not taking effect. How should this be done?

 
GBNT replied on at Permalink Reply
GBNT
I would like to know as well how this can be done.
serot0nin replied on at Permalink Reply
serot0nin
Any solution to this? I'm looking to do the same.

Edit: my solution was (simply) to follow the Autoloading guidelines
http://documentation.concrete5.org/developers/environment/autoloadi...
TMDesigns replied on at Permalink Reply
TMDesigns
so in this case

moving it
Application\Src\Sharing\SocialNetwork

and changing the namespace
namespace Application\Src\Sharing\SocialNetwork;
class Service


should work?

but doesn't