Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How do I easily add a new class?

  • deggyorg
  • deggyorg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 6 months ago - 4 years 6 months ago #188360 by deggyorg
How do I easily add a new class? was created by deggyorg
I need to slightly modify the CSV export functions from LimeSurvey.

I'm trying to do this simply by modifying CsvWriter - my solution doesn't need to be pretty and can be bespoke and fragile - just for my needs! But I want to retain the current CsvWriter functions too.

To get started I've copied CsvWriter.php to MyNewWriter.php. Renamed the class to MyNewWriter and added a radio button to the export menu by modifying core/plugins/Authdb/Authdb.php.

I've also added a new 'class RDataWriter extends MyNewWriter' in core/plugins/ExportR/RDataWriter.php, copying the function.

I have a lot of experience with PHP, but have never used composer. The expected function at the moment is that I should just have duplicated the CsvWriter under a different name - the first step to learning how the backend works.

However, when I try to export using my 'new' writer I get an error 500 'Class MyNewWriter not found'. I'm assuming that composer needs to rebuild some sort of class table?

I'm hoping there's an easy one-liner that will resolve this. Can anybody point the way?

Thank you in advance.

Just me!
Last edit: 4 years 6 months ago by deggyorg.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188371 by DenisChenu
Replied by DenisChenu on topic How do I easily add a new class?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose