diff --git a/plugin.xml.generate.php b/plugin.xml.generate.php deleted file mode 100644 index 509267f..0000000 --- a/plugin.xml.generate.php +++ /dev/null @@ -1,216 +0,0 @@ -basePath. - * @param string $parent Parent element from which to get children. - * @param array $options - *
  • ident - ident chanracters. - *
  • ignorePattern - pattern that will be matched to XML. - * @return string - */ - public function getXml($xmlFilePath, $parent, $options=array()) - { - if (!isset($options['indent'])) - { - $options['indent'] = ""; - } - - $contents = ""; - $filePath = $this->basePath . $xmlFilePath; - if (!file_exists($filePath)) - { - $this->perror("File $filePath does not exist"); - return $contents; - } - - $xml = file_get_contents($this->basePath . $xmlFilePath); - $document = new SimpleXMLElement($xml); - $els = $document->xpath($parent); - if (!empty($els)) - { - $rootNode = $els[0]; - foreach ($rootNode->children() as $child) - { - $childContent = $child->asXML(); - if (isset($options['ignorePattern']) && preg_match($options['ignorePattern'], $childContent)) - { - $this->perror("\nignored $childContent"); - continue; - } - $contents .= "\n" . $options['indent'] . $childContent; - } - $contents = ltrim ($contents) . "\n"; - return $contents; - } - else - { - $this->perror("Path $parent not found in $xmlFilePath"); - return $contents; - } - } - - /** - * Generate source-file tags to copy all resources from given dir. - * - * @param type $dir Dir path relative to $this->basePath. - * @param array $options - *
  • ident - ident chanracters. - */ - public function sourceFiles($dir, $options=array()) - { - //ob_end_clean(); - - if (!isset($options['indent'])) - { - $options['indent'] = ""; - } - $path = $this->basePath . $dir; - - $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); - while($it->valid()) - { - if (!$it->isDot()) - { - $filename = strtr($it->key(), '\\', '/'); - if (isset($options['ignorePattern']) && preg_match($options['ignorePattern'], $filename)) - { - $this->perror("\nignored $filename"); - $it->next(); - continue; - } - - $targetDir = preg_replace('#.+LibraryProject/(.+?)/[^/]+$#', '$1', $filename); - echo "\n{$options['indent']}"; - } - $it->next(); - } - - echo "\n"; - //exit; - } - } - - // init - $pluginHelper = new PluginHelper(); - - ob_start(); - echo ''; -?> - - - BarcodeScanner - - Scans Barcodes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sourceFiles("res", array('indent'=>"\t\t", 'ignorePattern' => '#values/strings.xml#')); - ?> - - - - getXml('res/values/strings.xml', "/resources", array('ignorePattern' => '/name="(app_name|menu_settings)"/', 'indent' => "\t\t\t"))?> - - - - \ No newline at end of file