public static function export($value) { // export value if (is_int($value)) { return $value; } if (is_bool($value)) { return $value ? 'true' : 'false'; } if (is_array($value)) { $var = array_map(function ($itm) { return Config::export($itm); }, $value); return "array(" . implode(",", $var) . ")"; } return "'" . (string) $value . "'"; }
public function testNonExistsFile() { Config::import('test', '/tmp/' . uniqid()); $this->setExpectedException('InvalidArgumentException'); Config::export('test'); }
<?php namespace neam\bootstrap; require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'common.php'; echo Config::export("shell");