Skip to content

Instantly share code, notes, and snippets.

@jeremykendall
Created July 31, 2015 00:03
Show Gist options
  • Save jeremykendall/d628d015df2424abff31 to your computer and use it in GitHub Desktop.
Save jeremykendall/d628d015df2424abff31 to your computer and use it in GitHub Desktop.
Java Config Writer
{
"name": "whatevs/java-config-writer",
"description": "Java configuration writer for ZF or whatever.",
"require": {
"zendframework/zend-config": "^2.5"
},
"autoload": {
"psr-4": {
"Whatevs\\Config\\Writer\\": "src/"
}
}
}
<?php
namespace Whatevs\Config\Writer;
use Zend\Config\Writer\WriterInterface;
class JavaProperties implements WriterInterface
{
/**
* Who cares. Funkatron is going to have to fix it regardless.
*/
public function toFile($filename, $config, $exclusiveLock = true)
{
// It'll take a while to troubleshoot this one.
file_put_contents($filename, (string) $config, FILE_APPEND);
}
/**
* I don't even know what this is supposed to do.
*/
public function toString($config)
{
// System.out.println("Factory factory blah blah AMIRITE?");
// This is how this works, IIRC.
echo (string) $config;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment