2017 © Pedro Peláez
 

library php-xmlog

PHP module for create XML and LOG files

image

zguillez/php-xmlog

PHP module for create XML and LOG files

  • Friday, September 9, 2016
  • by zguillez
  • Repository
  • 1 Watchers
  • 1 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 22 % Grown

The README.md

php-xmlog

License Join the chat at https://gitter.im/zguillez/php-xmlog, (*1)

PHP module for create XML and LOG files, (*2)

Getting Started

Add package to composer.json

composer require zguillez/php-xmlog, (*3)

//packaje.json
{
    "require": {
        "zguillez/php-xmlog": "^1.1.3"
    }
}

Usage:

require 'vendor/autoload.php';

use Z\Log;

$params["filename"] = "register";
$params["path"] = "./logs/";

$log = new Log($params);

On this example, "register" is the name of the log file and "./logs" is the folder on this files will be saved. This folder must exits and have write permitions., (*4)

$log->insert('This is an update!');

This will create a file "register.log" with the text "This is an update!"., (*5)

For create a XML file instead LOG file:, (*6)

$params["type"] = Log::XML;

Options (true/false):

1 dated:

$params["dated"]  = true;

Create a dated file name:, (*7)

  • true: register_2016-03-12_17:10:17.log
  • false (default): register.log

2 clear:

$params["clear"]  = true;

Overwrite last file:, (*8)

  • true: register.log (overwrite the file with new log text)
  • false (default): register.log (new log text will added in new line)

3 backup:

$params["backup"] = true;

Backup last file:, (*9)

  • true: register_2016-03-12_17:10:17_backup.log
  • false (default): (no backup file)

Configuration:

You can override the log options by a config function., (*10)

$log->config(["dated"=>true]);

Example:

require 'vendor/autoload.php';

$params["type"]   = Log::LOG;
$params["filename"]   = "register";
$params["path"]   = "./logs/";
$params["dated"]  = false;
$params["clear"]  = false;
$params["backup"] = false;

$log = new Log($params);

$log->config(["dated"=>true]);

$log->insert('This is update one!');
$log->insert('This is update two!');

Contributing and issues

Contributors are welcome, please fork and send pull requests! If you have any ideas on how to make this project better then please submit an issue or send me an email., (*11)

License

©2019 Zguillez.io, (*12)

Original code licensed under MIT Open Source projects used within this project retain their original licenses., (*13)

Changelog

v1.1.0 (September 9, 2016)

  • Configuration object

v1.0.0 (March 12, 2016)

  • Initial implementation

The Versions

09/09 2016

dev-master

9999999-dev

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml

09/09 2016

1.1.2

1.1.2.0

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml

09/09 2016

1.1.1

1.1.1.0

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml

08/09 2016

1.1.0

1.1.0.0

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml

12/03 2016

1.0.0

1.0.0.0

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml

12/03 2016

0.0.1

0.0.1.0

PHP module for create XML and LOG files

  Sources   Download

MIT

by Guillermo de la Iglesia

log php xml