Giter Club home page Giter Club logo

detox-php's Introduction

Abandoned

This project was initially started to replace version 1 of detox, which was written in C, with a version written in PHP. I choose PHP because it is my primary development language these days, both professionally and personally.

I also wanted to leverage modern libraries, to help with transliterating characters, and maybe simplify the process for all. Unfortunately, truly broken filenames, e.g. invalid bytes in a UTF-8 character, cannot be handled like this, and repeatedly broke the foundation I was trying to use. In the end, I opted to do a refresh in C, migrating the legacy codebase to modern practices.

For that reason, I am abandoning this project, and archiving the repository.

Thank you.


The original README follows below.

Warning

Detox is in the middle of a major rewrite.

This code in this repository is half-finished and not ready for production.

Mission of v2.x

The mission of this rewrite is to update detox to make it easier to use and easier to maintain.

Simplify

  • The choice to use config files and translation tables was complete over-engineering. This problem can be solved with a few command line switches.

Language

  • I haven't written C seriously in well over two decades; supporting a C-based project is not happening at this point in my life, when my professional development is all done in PHP.

Code Reuse

  • Write the filters in a way that allows them to be used in other projects.

Focus

  • Modern Linux supports UTF-8 at the command line. There isn't a strong reason to transliterate UTF-8 characters to ASCII under normal circumstances.
  • There is, however, a compelling reason to replace characters that have special meaning on the typical Linux command line. Characters like $, :, (, ), [, ] are all problematic more or less.

Requirements

  • composer
  • git
  • php (7.2.5 or higher)

Installation

git clone https://github.com/dharple/detox-php.git
cd detox-php
composer check-platform-reqs

If everything looks good after the previous check, install the project dependencies:

composer install --no-dev -o

If you have box installed globally, you can use that to build the utility:

box compile
box compile -c box-inline.json

Otherwise, we provide our own:

bin/compile
bin/compile-inline

Finally, install the resulting PHAR file to /usr/local/bin:

sudo cp dist/detox.phar /usr/local/bin/detox
sudo cp dist/inline-detox.phar /usr/local/bin/inline-detox

Contact

Doug Harple [email protected]

detox-php's People

Contributors

dharple avatar guilhermesiani avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

guilhermesiani

detox-php's Issues

Replace iconv's transliteration with another transliteration library

Unit tests that work on PHP 7.4.x are breaking on PHP 8.0.1, despite iconv being the same, and the internals showing the same values for ICONV_IMPL (glibc) and ICONV_VERSION (2.31):

1) Outsanity\Detox\Tests\Filter\AsciiTest::testBasicTransliteration
Ascii filter failed.  Encoding is set to: UTF-8
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Slainte'
+'Sl?inte'

It happens during character-by-character conversion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.