all files / src/ config.js

90% Statements 9/10
50% Branches 1/2
25% Functions 1/4
90% Lines 9/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83            1×     1×                                                                                     1× 1×     1×             1×             1×             1×       1×  
/*!
 * Copyright (C) 2017 Glayzzle (BSD3 License)
 * @authors https://github.com/glayzzle/php-transpiler/graphs/contributors
 * @url http://glayzzle.com
 */
 
var extend = require('extend');
 
// define default options
var defaults = {
  short_open_tag: false,
  output_buffering: 4096,
  implicit_flush: false,
  open_basedir: null,
  disable_functions: [],
  disable_classes: [],
  max_execution_time: 120,
  memory_limit: '128M',
  error_reporting: ['E_ALL'],
  display_errors: true,
  display_startup_errors: true,
  log_errors: true,
  log_errors_max_len: 1024,
  ignore_repeated_errors: false,
  ignore_repeated_source: false,
  track_errors: false,
  html_errors: false,
  error_log: '/var/log/php-error.log',
  include_path: ['.', '/usr/share/php'],
  extension_dir: [__dirname + '/ext', './node_modules', '/usr/local/lib/node_modules'],
  enable_dl: false,
  allow_url_fopen: true,
  allow_url_include: false,
  // list of extensions
  extension: [],
  // http://php.net/date.timezone
  date: {
    timezone: "UTC",
    // http://php.net/date.default-latitude
    default_latitude: 31.7667,
    // http://php.net/date.default-longitude
    default_longitude: 35.2333,
    // http://php.net/date.sunrise-zenith
    sunrise_zenith: 90.583333,
    // http://php.net/date.sunset-zenith
    sunset_zenith: 90.583333
  }
};
 
/**
 * @constructor Config
 */
var Config = function(options) {
  Iif (options) {
    extend(true, options, defaults, this);
  } else {
    extend(true, defaults, this);
  }
};
 
/**
 * @todo ini_set
 */
Config.prototype.set = function(name, value) {
 
};
 
/**
 * @todo ini_get
 */
Config.prototype.get = function(name) {
 
};
 
/**
 * @todo php_info
 */
Config.prototype.info = function() {
 
};
 
module.exports = Config;