Ejemplo n.º 1
0
	/**
	* Create a SRMN Membership object from one of docx, html, json file
	*/
	static function create($filePath)
	{
		$info = new \SplFileInfo($filePath);
		$ext = $info->getExtension();
		if($ext == "json" ){
			
		}else if( $ext == "html" ){
			
		}else if($ext == "docx" ){
			$converter = new \DocxToHtmlConverter(["temp_dir"=>__DIR__]);
			$outputFile = $converter->convert($filePath);
			 
		}
	}
Ejemplo n.º 2
0
*
* Step 3 - save in a new json format by calling MembershipHtml::toJson()
*
*
* Along the was change the file name of the membership document from something like
*
*		"SRMN Membership Application Form 5.20a huntercarl .docx"
*
*		"huntercarl.json"
*/
var_dump($argv);
$fn = $argv[1];


$converter = new DocxToHtmlConverter();
print ($convertedFilePath = $converter->convert($argv[1]))."\n";

$dom = new DOMDocument();
// $dom->loadHTMLFile($convertedFilePath);
//$dom->loadHTMLFile(__DIR__."/".$fn);

$memDoc = new MembershipHtmlDoc($convertedFilePath);

$memDoc->parse();

print_r($memDoc->getMembershipObject());

file_put_contents(
	__DIR__."/".$memDoc->getMemberShipObject()->document_name.".json", 	json_encode($memDoc->getMembershipObject(), JSON_PRETTY_PRINT)
);