Code Monkey home page Code Monkey logo

inilib's People

Contributors

sierrakomodo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

inilib's Issues

[REVIEW 2] Change default INI_SCANNER_* value to INI_SCANNER_TYPED

https://codereview.stackexchange.com/questions/165524/php-7-0-inicontroller-a-set-of-classes-for-reading-parsing-and-editing/165784#165784

Should you consider INI_SCANNER_TYPED as default parsing behavior, as this would tend to yield data values in your array that are more meaningful to be used in other areas of the application (i.e. booleans vs. 'yes', 'no', 'on', 'off', etc.). This could of course be a problem for persisting to file as you would need to potentially have a conversion back to 'yes', 'no', etc.

Add fetchSection() method

Fetching a full section into an associative array may be a useful feature. Function will be similar to fetchEntry, but only use a single parameter for the section name. Return value should be an associative array or NULL.

Provide 'parsing' systems for converting PHP types back into INI entires for certain scanner modes

Currently, the scanner mode only affects the reading of the INI file, and will not change values when they are being written to a file. As an example: Assume you have an INI file with key bSomeBooleanValue=off. INI_SCANNER_NORMAL will parse this as an empty string '', INI_SCANNER_RAW as string 'off', and INI_SCANNER_TYPED as boolean false. Upon writing this data back to file, without any changes, this key will now have an empty value, a value of off, or a value of 0, respectively.

IniFile::saveDataToFile() should be updated to convert boolean values, and other non-string types, to strings that best fit the INI scanner type currently in use (I.e., boolean true to string 'true'.

A second, internal, never-modified version of the data array containing the original INI contents might be desireable to compare against, and determine if saveDataToFile should output 'on' or 'true' (And other variations of ambiguous entries)

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.