commit 5c9cad0dc4e8cdc8d38279f150284c61faf35d1d Author: Daniel Date: Mon May 21 10:33:11 2012 +0200 creating project structure diff --git a/builds/build.properties.txt b/builds/build.properties.txt new file mode 100644 index 0000000..145b171 --- /dev/null +++ b/builds/build.properties.txt @@ -0,0 +1,11 @@ +build.version=dev +component.name=jedchecker +component.upperName=JEDCHECKER + +; FTP Options +ftp.host=ftp.example.com +ftp.port=21 +ftp.username=username +ftp.password=password +ftp.dir=/path/to/directory +ftp.mode=binary diff --git a/builds/component.xml b/builds/component.xml new file mode 100644 index 0000000..7e4b93f --- /dev/null +++ b/builds/component.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uploading ${component.name} nightly build + + + + + + + + + + \ No newline at end of file diff --git a/builds/module.xml b/builds/module.xml new file mode 100644 index 0000000..157e687 --- /dev/null +++ b/builds/module.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/builds/phingext/GitVersionTask.php b/builds/phingext/GitVersionTask.php new file mode 100644 index 0000000..e017fbb --- /dev/null +++ b/builds/phingext/GitVersionTask.php @@ -0,0 +1,55 @@ +propertyName = $propertyName; + } + + /** + * Returns the name of the property to use + */ + function getPropertyName() + { + return $this->propertyName; + } + + /** + * Sets the path to the working copy + */ + function setWorkingCopy($wc) + { + $this->workingCopy = $wc; + } + + /** + * The main entry point + * + * @throws BuildException + */ + function main() + { + $this->setup('info'); + + + exec('git log -n 1 --no-decorate --pretty=format:"%h" '.escapeshellarg(realpath($this->workingCopy)), $out); + $version = $out[0]; + + $this->project->setProperty($this->getPropertyName(), $version); + } +} \ No newline at end of file diff --git a/builds/phingext/explodetask.php b/builds/phingext/explodetask.php new file mode 100644 index 0000000..11805d2 --- /dev/null +++ b/builds/phingext/explodetask.php @@ -0,0 +1,56 @@ +string = $string; + } + + public function setDelimiter($delimiter) { + $this->delimiter = $delimiter; + } + + public function setKey($key) { + $this->key = $key; + } + + /** + * Defines the name of a property to be set . + * + * @param string $name Name for the property to be set from input + */ + public function setPropertyName($name) { + $this->propertyName = $name; + } + + /** + * The init method: Do init steps. + */ + public function init() + { + // nothing to do here + } + + /** + * The main entry point method. + */ + public function main() + { + if ($this->propertyName === null) { + throw new BuildException("You must specify a value for propertyName attribute."); + } + + + $value = explode($this->delimiter, $this->string); + + if ($value !== null) { + $this->project->setUserProperty($this->propertyName, $value[$this->key]); + } + } + +} \ No newline at end of file diff --git a/builds/phingext/listjpackagefilestask.php b/builds/phingext/listjpackagefilestask.php new file mode 100644 index 0000000..412336a --- /dev/null +++ b/builds/phingext/listjpackagefilestask.php @@ -0,0 +1,310 @@ +type = $type; + } + + public function setFile($str) + { + $this->file = $str; + } + + public function setSourceDir($dir) + { + $this->sourceDir = $dir; + } + + public function setComponent($name) + { + $this->component = $name; + } + + /** + * The init method: Do init steps. + */ + public function init() + { + // nothing to do here + } + + /** + * The main entry point method. + */ + public function main() + { + $content = file_get_contents($this->file); + + $content = preg_replace_callback('/##PACKAGEFILESPLUGIN##/', 'self::findPluginPackageFiles', $content); + + if (preg_match('/##PACKAGEFILESMODULE##/', $content)) { + $content = preg_replace('/##PACKAGEFILESMODULE##/', + call_user_func('self::findModulePackageFiles'), $content); + } + + if (preg_match('/##ADMINLANGUAGEFILES##/', $content)) { + $content = preg_replace('/##ADMINLANGUAGEFILES##/', + call_user_func('self::languageFiles', true), $content); + } + + if (preg_match('/##FRONTENDLANGUAGEFILES##/', $content)) { + $content = preg_replace('/##FRONTENDLANGUAGEFILES##/', + call_user_func('self::languageFiles', false), $content); + } + + if (preg_match('/##ADMINCOMPONENTPACKAGEFILES##/', $content)) { + $content = preg_replace('/##ADMINCOMPONENTPACKAGEFILES##/', + call_user_func('self::findComponentPackagefiles', true), $content); + } + + + if (preg_match('/##FRONTENDCOMPONENTPACKAGEFILES##/', $content)) { + $content = preg_replace('/##FRONTENDCOMPONENTPACKAGEFILES##/', + call_user_func('self::findComponentPackagefiles', false), $content); + } + + if (preg_match('/##MEDIAPACKAGEFILES##/', $content)) { + $content = preg_replace('/##MEDIAPACKAGEFILES##/', + call_user_func('self::findMediaPackagefiles', false), $content); + } + + file_put_contents($this->file, $content); + } + + public function languageFiles($admin = false) + { + + if($this->type == 'module') { + $this->sourceDir = $this->sourceDir . '/../../'; + } + if($this->type == 'plugin') { + $this->sourceDir = $this->sourceDir . '/../../../'; + } + $languageFolder = $this->sourceDir . '/language'; + if ($admin) { + $languageFolder = $this->sourceDir . '/administrator/language'; + } + $list = array(); + if (file_exists($languageFolder)) { + $dir = new DirectoryIterator($languageFolder); + + foreach ($dir as $element) { + if (!$element->isDot()) { + if ($element->isDir()) { + $langDir = new DirectoryIterator($element->getPath() . '/' . $element->getFileName()); + + foreach ($langDir as $langElement) { + if (!$langElement->isDot()) { + if ($langElement->isFile()) { + if ($this->component) { +// if(strstr($this->component,'sys')) + $name = explode('.', $langElement->getFileName()); + $name = $name[1]; + if ($name == $this->component) { + $list[] = '' + . $element->getFileName() . '/' . $langElement->getFileName() . ''; + } + } +// else { +// $list[] = '' +// . $element->getFileName() . '/' . $langElement->getFileName() . ''; +// } + // $packageMainFile = basename($this->file, '.xml'); + // if ($element->getFileName() == $packageMainFile . '.php') { + // . $element->getFileName() . '/' . $langElement->getFileName() . ''; + } + } + } + } + } + } + } else { + echo 'Folder ' . $languageFolder . ' doesn\'t exist'; + } + + return implode("\n", $list); + } + + public function findComponentPackagefiles($admin = false) + { + $list = array(); + $componentFolder = $this->sourceDir . '/components/' . $this->component; + if ($admin) { + $componentFolder = $this->sourceDir . '/administrator/components/' . $this->component; + } + + if (file_exists($componentFolder)) { + $dir = new DirectoryIterator($componentFolder); + foreach ($dir as $element) { + if (!$element->isDot()) { + if ($element->isDir()) { + $list[] = '' . $element->getFileName() . ''; + } + if ($element->isFile()) { + $list[] = '' . $element->getFileName() . ''; + } + } + + } + } else { + echo 'Folder ' . $componentFolder . ' doesn\'t exist'; + } + + return implode("\n", $list); + } + + public function findMediaPackagefiles() + { + $list = array(); + $source = $this->sourceDir; + if(strstr($source, '/administrator/')) { + if($this->type == 'module') { + $source = $source . '..'; + } + } + $mediaFolder = $source . '/media/' . $this->component; + if (file_exists($mediaFolder)) { + $dir = new DirectoryIterator($mediaFolder); + foreach ($dir as $element) { + if (!$element->isDot() && substr($element, 0, 1) != ".") { + if ($element->isDir()) { + $list[] = '' . $element->getFileName() . ''; + } + if ($element->isFile()) { + $list[] = '' . $element->getFileName() . ''; + } + } + + } + + } else { + echo 'Folder ' . $mediaFolder . ' doesn\'t exist'; + } + return implode("\n", $list); + } + + public function findPluginPackageFiles() + { + $list = array(); + if (file_exists($this->sourceDir)) { + $dir = new DirectoryIterator($this->sourceDir); + foreach ($dir as $element) { + if (!$element->isDot()) { + if ($element->isDir()) { + $skip = false; + if ($element->getFileName() == 'administrator') { + /** + * we need to handle the language folder in the plugin + * differently. If the administrator folder contains + * just the language folder we don't need to list it. + * Otherwise when the user installs the plugin he will have + * administrator/language in his plugi folder which is lame... + */ + $adminDir = new DirectoryIterator($this->sourceDir . '/administrator'); + $i = 0; + $language = false; + foreach ($adminDir as $adminElement) { + if ($adminElement->isDir() && !$adminElement->isDot()) { + if ($adminElement->getFileName() == 'language') { + $language = true; + } + $i++; + } + } + /** + * so we have just one folder and it is + * the language one??? + */ + if ($i == 1 && $language == true) { + $skip = true; + } + } + + if (!$skip) { + $list[] = '' . $element->getFileName() . ''; + } + } + if ($element->isFile()) { + $packageMainFile = basename($this->file, '.xml'); + if ($element->getFileName() == $packageMainFile . '.php') { + $list[] = '' . $element->getFilename() . ''; + } elseif ($element->getFileName() != basename($this->file)) { + $list[] = '' . $element->getFileName() . ''; + } + } + } + } + } else { + echo 'Folder ' . $this->sourceDir . ' doesn\'t exist'; + } + + return implode("\n", $list); + } + + + public function findModulePackageFiles() + { + $list = array(); + if (file_exists($this->sourceDir)) { + $dir = new DirectoryIterator($this->sourceDir); + foreach ($dir as $element) { + if (!$element->isDot()) { + if ($element->isDir()) { + $skip = false; + if ($element->getFileName() == 'administrator') { + /** + * we need to handle the language folder in the plugin + * differently. If the administrator folder contains + * just the language folder we don't need to list it. + * Otherwise when the user installs the plugin he will have + * administrator/language in his plugi folder which is lame... + */ + $adminDir = new DirectoryIterator($this->sourceDir . '/administrator'); + $i = 0; + $language = false; + foreach ($adminDir as $adminElement) { + if ($adminElement->isDir() && !$adminElement->isDot()) { + if ($adminElement->getFileName() == 'language') { + $language = true; + } + $i++; + } + } + /** + * so we have just one folder and it is + * the language one??? + */ + if ($i == 1 && $language == true) { + $skip = true; + } + } + + if (!$skip) { + $list[] = '' . $element->getFileName() . ''; + } + } + if ($element->isFile()) { + $packageMainFile = basename($this->file, '.xml'); + if ($element->getFileName() == $packageMainFile . '.php') { + $list[] = '' . $element->getFilename() . ''; + } elseif ($element->getFileName() != basename($this->file)) { + $list[] = '' . $element->getFileName() . ''; + } + } + } + } + } else { + echo 'Folder ' . $this->sourceDir . ' doesn\'t exist'; + } + + return implode("\n", $list); + } + +} \ No newline at end of file diff --git a/builds/plugin.xml b/builds/plugin.xml new file mode 100644 index 0000000..887270f --- /dev/null +++ b/builds/plugin.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/administrator/components/com_jedchecker/jedchecker.php b/source/administrator/components/com_jedchecker/jedchecker.php new file mode 100644 index 0000000..aac684c --- /dev/null +++ b/source/administrator/components/com_jedchecker/jedchecker.php @@ -0,0 +1,8 @@ +