GithubHelp home page GithubHelp logo

Save build information about phpbrew HOT 10 OPEN

phpbrew avatar phpbrew commented on July 21, 2024
Save build information

from phpbrew.

Comments (10)

marcioAlmada avatar marcioAlmada commented on July 21, 2024

Any spec about how this command would behave? Something like:

  • when successfully installing a php version phpbrew saves information about how it was built (alias, variants, options). Let's suppose 5.5.6-phpbrew.json
  • user would install a phpbrew build with something like $ phpbrew rebuild 5.5.6-phpbrew.json

from phpbrew.

c9s avatar c9s commented on July 21, 2024

yeah sure, see if we can serialise the build information through json or php serialisation.

on the refactoring-tasks branch, there is a PhpBrew/Build class, this should store all the build information, and you can see how the informations are set to the Build object.

After finished the building, we can simply call

   $build->save();

to save informations for a build (including name, version, source directory, dist directory, variants... etc)

then maybe we could have a method to load it back:

  $build = Build::loadFromFile('path/to/info_file);

or

  $build = Build::loadByName('php-5.5.6');

note that we will have "name" and "version" attributes in the build object, because we can give different name with the same version and which are different builds, for example:

  5.5.6-mysql
  5.5.6-debug
  5.5.6-foobar

are different builds but with the same version.

For now, we have the phpbrew.variants file in each dist directory, and we also need to make the new mechanism consistent with the old one (or migrate the phpbrew.variants to the new one)

So if we want to add a rebuild command, we can do:

phpbrew rebuild {name}

And use the loadByName method to load the build file.

from phpbrew.

c9s avatar c9s commented on July 21, 2024

Further, we can have another command to export the build information, e.g.:

 phpbrew export {name} {file}

And we can import the build from a local file or an url:

 phpbrew import {file}
 phpbrew import {url}

from phpbrew.

c9s avatar c9s commented on July 21, 2024

By the way, If we want to use JSON format by default, we might also need to enable +json variant by default for every new install.

from phpbrew.

marcioAlmada avatar marcioAlmada commented on July 21, 2024

Hello!

Sorry for the delay, I haven't noticed all those replies.

Good catch! Maybe turning +json variant obligatory could become too invasive? In positive case, the idea of a good and old file_put_content($filename, serialize($build) and unserialize(file_get_content($filename)) would be enough IMMO.

from phpbrew.

c9s avatar c9s commented on July 21, 2024

yeah I think using built-in serialization is enough for now. because users usually don't modify this file, if they want, they can export to json individually, e.g.,

 phpbrew export --format json {version name}    5.4.3-db.json 

from phpbrew.

marcioAlmada avatar marcioAlmada commented on July 21, 2024

We'll be using yml to store build information from now on. Seems more logical now that we already included symfony yaml parser as a dependency and it does not require any extension.

from phpbrew.

c9s avatar c9s commented on July 21, 2024

That makes sense.

  1. Modifiable.
  2. Readable.
  3. Does not require an extension.

from phpbrew.

jcrben avatar jcrben commented on July 21, 2024

Is there a branch tied to this idea?

from phpbrew.

c9s avatar c9s commented on July 21, 2024

not yet, it's welcome to create one for that :)

from phpbrew.

Related Issues (20)

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.