What's the best way to format a program that uses Condorcet? #142
-
I'm sorry to bother you with some amateur questions on using PHP. But I've never worked with PHP before working with Condorcet. What I know comes from reading w3schools.com & php.net, just so I can work with Condorcet. I am trying to make a program to process an election with a specialized variant of the Schulze method. This method is too specialized to ever be worth including in Condorcet itself. How should I format a program that requires Condorcet as an API? First I started by writing a new php file in But then I figured that's not a good place to put it, especially for when I share this. So I put a new subfolder in But perhaps the ideal way to format this project is as new project that includes Condorcet as a library. Anyone who downloads it can download Condorcet separately. But I don't know how to get a PHP program to use an external library. I know there is this page, but I don't know how to use composer. I also don't know how to install Condorcet as a PHP library on my computer. I am on Manjaro Linux. So how should I do this? What would the beginning of the initial PHP file look like? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
You're welcome :-) It's very rare to interact with real users, and really useful to realize some imperfections or bugs. It's a niche program. And when it works well and easily, people (most of the time) don't say anything, they're ghosts. This is a good point, I will write a little skeleton ASAP about creating a method module without fork Condorcet. Condorcet is designed for (optionally) working without composer and dependencies for security concerns (except for the Command line version), but I highly recommend using it with Composer because is nicer and you can include it with another project more easily. It also activates an arbitrary precision floating point Math library, useful for some methods (better than PHP float precision). About Composer, it's not a big deal: https://getcomposer.org/ |
Beta Was this translation helpful? Give feedback.
-
It looks like you've started making a reference example. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I don't know where else to post this. @julien-boudry I have tried downloading your Condorcet_Modules_Skeletons. The program works properly when I do the steps in README.md. However, I don't know how to rename things without breaking it. You can see this repository, which is the same, except some namespaces and the method class are renamed. Somehow the program no longer works with these changes.
|
Beta Was this translation helpful? Give feedback.
-
@LiamM32 Just improve the skeleton with PHPUnit test, command line version, and other cleanups. https://github.com/CondorcetVote/Condorcet_Modules_Skeletons |
Beta Was this translation helpful? Give feedback.
@LiamM32 Just improve the skeleton with PHPUnit test, command line version, and other cleanups.
https://github.com/CondorcetVote/Condorcet_Modules_Skeletons