Created
July 31, 2015 00:03
-
-
Save jeremykendall/d628d015df2424abff31 to your computer and use it in GitHub Desktop.
Java Config Writer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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/" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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