예제 #1
0
 /**
  * Create a new instance.
  *
  * @param string $filename The filename to use.
  *
  * @param bool   $debug    The debug flag. True to enable debugging, false otherwise.
  */
 public function __construct($filename, $debug = false)
 {
     parent::__construct($debug);
     $this->filename = $filename;
     $this->doc = new \DOMDocument('1.0', 'UTF-8');
     $this->doc->preserveWhiteSpace = false;
     $this->doc->formatOutput = true;
     $this->load($filename);
 }
예제 #2
0
 /**
  * Create a new instance.
  *
  * @param string $filename The filename.
  *
  * @param bool   $debug    The debug flag. True to enable debugging, false otherwise.
  */
 public function __construct($filename, $debug = false)
 {
     parent::__construct($debug);
     $this->filename = $filename;
     $this->language = basename(dirname($filename));
     if (file_exists($filename)) {
         $this->load();
     } else {
         $this->createBasicDocument();
     }
 }