Download the PHP package drez/hjson-to-propel-xml without Composer

On this page you can find all versions of the php package drez/hjson-to-propel-xml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hjson-to-propel-xml

A better way to build Propel with HJSON Schema

This is a library to convert HJSON file to Propel XML schema. I always found Propel(http://propelorm.org/) schema tedious to write. This should help make it more approchable.

Install with composer

composer require drez/hjson-to-propel-xml

Live converter

https://hjson2xml.apigoat.com

Example

Now you can write that:

will translate to:

<database name="goatcheese" defaultIdMethod="native" namespace="App" >
        <behavior name="add_validator" />
        <behavior name="table_stamp_behavior" />
        <behavior name="GoatCheese" >
            <parameter name="set_debug_level" value="3" />
            <parameter name="is_builder" value="1" />
            <parameter name="add_hooks" value="[]" />
            <parameter name="with_api" value="1" />
        </behavior>
    <table name="authy" description="User" >
        <behavior name="GoatCheese" >
            <parameter name="set_parent_menu" value="Settings" />
        </behavior>
        <column name="id_authy" type="INTEGER" size="11" required="true" primaryKey="true" autoIncrement="true" />
        <column name="validation_key" type="VARCHAR" size="32" required="false" />
        <column name="username" description="Username" type="VARCHAR" size="32" required="false" />
        <column name="is_root" description="Root" type="ENUM" valueSet="Yes, No" required="false" defaultValue="No" />
        <column name="id_authy_group" type="INTEGER" size="11" required="true" />
        <foreign-key foreignTable="authy_group" onDelete="restrict" onUpdate="restrict" >
            <reference local="id_authy_group" foreign="id_authy_group" />
        </foreign-key>
        <column name="expire" description="Expiration" type="DATE" required="false" />
        <unique >
            <unique-column name="username" />
        </unique>
    </table>
    <table name="authy_group_x" isCrossRef="true" >
        <column name="id_authy" type="INTEGER" size="11" required="true" primaryKey="true" />
        <foreign-key foreignTable="authy" onDelete="cascade" onUpdate="restrict" >
            <reference local="id_authy" foreign="id_authy" />
        </foreign-key>
        <column name="id_authy_group" type="INTEGER" size="11" required="true" primaryKey="true" />
        <foreign-key foreignTable="authy_group" onDelete="restrict" onUpdate="restrict" >
            <reference local="id_authy_group" foreign="id_authy_group" />
        </foreign-key>
    </table>
</database>

USE

$text = file_get_contents($this->rootDir . DIRECTORY_SEPARATOR . $hjson_file);

// make sure we have unix style text regardless of the input
$std = mb_ereg_replace('/\r/', "", $text);
$hjson = $cr ? mb_ereg_replace("\n", "\r\n", $std) : $std;

// use of laktak/hjson(https://github.com/hjson/hjson-php) to convert the HJSON to array
$parser = new \HJSON\HJSONParser();
$obj = $parser->parse($hjson, ['assoc' => true]);

// convert Hjson to Propel schema
$HjsonToXml = new \HjsonToPropelXml\HjsonToPropelXml();
$HjsonToXml->convert($obj);

Schema

TODO

License

MIT


All versions of hjson-to-propel-xml with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-mbstring Version *
laktak/hjson Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package drez/hjson-to-propel-xml contains the following files

Loading the files please wait ....