{"id":15490389,"url":"https://github.com/byjg/xmlnuke","last_synced_at":"2025-06-20T17:37:34.232Z","repository":{"id":9266772,"uuid":"11094807","full_name":"byjg/xmlnuke","owner":"byjg","description":"This project is deprecated and split into a several projects. Please see: https://opensource.byjg.com/","archived":false,"fork":false,"pushed_at":"2022-06-15T13:17:40.000Z","size":6907,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-22T19:08:48.711Z","etag":null,"topics":["this"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byjg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-01T12:55:45.000Z","updated_at":"2025-04-20T11:49:25.000Z","dependencies_parsed_at":"2022-09-22T15:41:38.320Z","dependency_job_id":null,"html_url":"https://github.com/byjg/xmlnuke","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/byjg/xmlnuke","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fxmlnuke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fxmlnuke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fxmlnuke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fxmlnuke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byjg","download_url":"https://codeload.github.com/byjg/xmlnuke/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byjg%2Fxmlnuke/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260988912,"owners_count":23093583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["this"],"created_at":"2024-10-02T07:20:54.112Z","updated_at":"2025-06-20T17:37:29.213Z","avatar_url":"https://github.com/byjg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"XMLNuke - The King is dead. Long live the King.\n=======\n\nSince 2002 I started the development of the XMLNuke project. I created a framework because I would like to put the best practice I've learning in PHP and I wanted to be more productive.\nIn fact I became more productive developing with XMLNuke than use another framework. Over the years, PHP evolved from your version 3.3 with no code standard to the PSR-*, namespaces,\nobject orientation and the powerful composer. XMLNuke survived to all changes and evolved too. The applications I developed using the XMLNuke framework evolved also and the time\ndid not kill neither the framework project neither the applications are using it.\n\nBut XMLNuke had challenges bigger than the PHP and the time. XMLNuke was formed of a single large block piece of software. If you want to use a small feature you had to install and setup all XMLNuke software.\n\nNow is time to move to next step. I learned with XMLNuke and I produced some useful routines and code. Now, XMLNuke project was splitted in several small and manageable projects.\nThis process is going on right now. There are dozen of small projects and this number is continuing to increase. XMLNuke is becoming small and is using these projects.\n\nThe most important part of this proccess is the small projects have a better code qualitty (Sensiolab Insigths, Scrutinizer CI and Code Climate) and unit tests (Travis-CI).\n\nThe legacy software based on XMLNuke will continue to run, but XMLNuke won't be maintained. You can find the list of the new project in the website\n[OpenSource ByJG](http://opensource.byjg.com/)\n\n**Long live the king. **\n\n\n\n\n## Description\n[![Build Status](https://travis-ci.org/byjg/xmlnuke.png?branch=master)](https://travis-ci.org/byjg/xmlnuke)\n\n**[ *The master branch requires PHP53 or higher and is full PSR-0 compliant by using namespaces. The branch 'php50' is the legacy XMLNuke version and is now deprecated.* ]**\n\n\nXMLNuke is a Web Development Framework focused on the Data. Programming in XMLNuke you'll never more worry about open and close PHP tags and manage *spaghetti code*. All of your code is fully based in objects and all code produces only data in XML or JSON, you choose. \n\nThis is a page in XMLNuke:\n\n```php\nnamespace MyProject\\Modules;\n\nuse Xmlnuke\\Core\\Classes\\XmlnukeDocument;\nuse Xmlnuke\\Core\\Module\\BaseModule;\n\nclass Home extends BaseModule \n{\n    public function __construct()\n    {}\n\n    public function CreatePage() \n    {\n        $this-\u003edefaultXmlnukeDocument = new XmlnukeDocument(\"Title\", \"Abstract\");\n        ...\n        return $this-\u003edefaultXmlnukeDocument;\n    }\n}\n```\n\n\nYou can easily add some requirements to your page without have to care about how handle this. For example, you can define that your page requires authentication, will be cached or requires to be executed in a SSL context. See the example below:\n\n```php\nnamespace MyProject\\Modules;\n\nuse Xmlnuke\\Core\\Module\\BaseModule;\n\nclass Home extends BaseModule \n{\n    /**\n     * requiresAutentication(), getAccessLevel() and getRole() handle the page security and access level\n     */\n    public functon requiresAutentication()\n    {\n        return true;\n    }\n        \n    public function getAccessLevel()\n    {\n        return \\Xmlnuke\\Core\\Enum\\AccessLevel::OnlyRole;\n    }\n    \n    public function getRole()\n    {\n        return new array(\"DIRECTOR\", \"MANAGER\");\n    }\n        \n    \n    /**\n     * useCache determines if the XMLNuke will store your page in a cache or not.\n     * By default XMLNuke can store in the:\n     *   - \\Xmlnuke\\Core\\Cache\\ArrayCacheEngine (Static Array), \n     *   - \\Xmlnuke\\Core\\Cache\\FileSystemCacheEngine (File System), \n     *   - \\Xmlnuke\\Core\\Cache\\MemcachedEngine (MemCached),\n     *   - \\Xmlnuke\\Core\\Cache\\NoCacheEngine (Ignore Cache)\n     * \n     * You can configure your own cache strategy by implementing the interface \n     * \\Xmlnuke\\Core\\Cache\\ICacheEngine.\n     */ \n    public function useCache()\n    {\n        if ($this-\u003e_action != \"\")\n        {\n              return false;\n        }\n        else\n        {\n              return true;\n        }\n    }\n\n    /** \n     * Determines if your page requires SSL or Not\n     */\n    public function requiresSSL()\n    {\n        return \\Xmlnuke\\Core\\Enum\\SSLAccess::ForceSSL;\n    }\n}\n```\n\nIf you work with models using the classic getter and setter or property you can add it to your page and the XMLNuke will output. For example:\n\n```php\nnamespace MyProject\\Classes;\n\nclass MyClass\n{\n    protected $_name;\n    public function getName() ...;\n    public function setName($value) ...;\n        \n    protected $_age;\n    public function getAge() ...;\n    public function setAge($value) ...;\n}\n```\n\n```php\nnamespace MyProject\\Modules;\n\nuse MyProject\\Classes;\nuse Xmlnuke\\Core\\Classes\\XmlnukeDocument;\nuse Xmlnuke\\Core\\Module\\BaseModule;\n\nclass Home extends BaseModule \n{\n    public function CreatePage() \n    {\n        $this-\u003edefaultXmlnukeDocument = new XmlnukeDocument(\"Title\", \"Abstract\");\n        ...\n        \n        $myClass = new MyClass();\n        $myClass-\u003esetName('Joao');\n        $myClass-\u003esetAge(39);\n        ...\n        $this-\u003edefaultXmlnukeDocument-\u003eaddXmlnukeObject($myClass);\n            \n        return $this-\u003edefaultXmlnukeDocument;\n    }\n}\n```\n\nAfter that you can associate a Snippet XSL to handle this data and produces HTML or whatever you want to produce by the XSL transformation. You can optionally get the raw data in XML or JSON by calling through your web browser:\n\n```url\nhttp://youserver/xmlnuke.php?module=byjg.home\u0026raw=xml\u0026spath=//MyProject_Classes_MyClass\n```\n    \n```xml\n\u003cxmlnuke xpath=\"//MyProject_Classes_MyClass\"\u003e\n    \u003cMyProject_Classes_MyClass\u003e\n        \u003cname\u003eJoao\u003c/name\u003e\n        \u003cage\u003e39\u003c/age\u003e\n    \u003c/MyProject_Classes_MyClass\u003e\n\u003c/xmlnuke\u003e\n```\n    \nor\n\n```url\nhttp://yourserver/xmlnuke.php?module=byjg.home\u0026raw=json\u0026xpath=//MyProject_Classes_MyClass;\n```\n\n```json\n{\n    \"MyProject_Classes_MyClass\": {\n        \"name\": \"Joao\",\n        \"age\": \"39\"\n    }\n}\n```\n\nSee the [Wiki](https://github.com/byjg/xmlnuke/wiki) for more examples;\n\n\n## Installing\n\nThe master branch requires PHP 5.3 to run. Prior PHP versions can use the legacy 'php50' branch. \n\n### Composer: Project level installation\n\nComposer can download XMLNuke and create a empty XMLNuke project at the same time. \n\nTo do this you have to create a empty folder and put the following `composer.json` file:\n\n```json\n{\n    \"require\": {\n        \"byjg/xmlnuke\": \"dev-master\"\n    },\n    \"minimum-stability\": \"dev\",\n    \"scripts\": {\n        \"post-install-cmd\": [\n             \"Xmlnuke\\\\Util\\\\Composer::postInstallCmd\"\n        ],\n\t\"post-update-cmd\" : [\n             \"Xmlnuke\\\\Util\\\\Composer::postInstallCmd\"\n        ]\n    }\n}\n```\n\nand execute the command:\n\n```bash\ncomposer install\n```\n\nThis procedure is valid for existing XMLNuke projects also. \n\n### Composer: Global installation using global\n\nYou can install XMLNuke globally using composer. To do this execute the command:\n\n```bash\n# use dev-master for stable version\n# use dev-develop for unstable/develop versions\n# use the version number for specific version\ncomposer global require \"byjg/xmlnuke=dev-master\"\n```\n\nMake sure that the folder `~/.composer` can be accessible by your web server.\n\nIt is interesting that the folder `~/.composer/vendor/bin` it is the PATH of server:\n\n```bash\nexport PATH=~/.composer/vendor/bin:$PATH\n```\n\n### Composer: Global installation using create-project\n\n```bash\nsudo composer create-project byjg/xmlnuke /opt/xmlnuke dev-master\n```\n\n### Command Line (Debian/Ubuntu)\n\nYou have to install your web server (Apache2, Lighttd, nginx, ...). XMLNuke requires for PHP:\n\n    apt-get install php5-xsl php5-json\n    \nDownload the XMLNuke package. You can download from:\n- the Zip package (https://github.com/byjg/xmlnuke/archive/master.zip) or \n- from repository by using the Git or SVN. \n\nExtract the package in any folder, e.g. /opt/xmlnuke.\n**Remember**: The XMLNuke folder cannot to be accessible from you Web Browser. \n\nRun at your terminal:\n\n    cd /opt/xmlnuke\n    ./copy-dist-files.sh link yes\n\nChoose and create a folder for your project. This folder must be accessible through your web broswer. \n\n    mkdir /var/www/my-project\n    php /opt/xmlnuke/create-php5-project.php /var/www/my-project myproject en-us pt-br\n    ln -s /opt/xmlnuke/xmlnuke-common /var/www/my-project/common\n    \nNow, just test it:\n\n    http://yourserver/my-project\n    \n\n### Windows\n\nYou have to install your web server (Xampp, Apache2, IIS, ...) and configure it to run PHP5 scripts. Make sure that the XSL extension is installed. \n\nDownload the XMLNuke package. You can download from:\n- the Zip package (https://github.com/byjg/xmlnuke/archive/master.zip) or \n- from repository by using the Git or SVN. \n\nExtract the package in any folder, e.g. D:\\data\\xmlnuke.   \n**Remember**: The XMLNuke folder cannot to be accessible from you Web Browser. \n\nUsing the Windows Explorer find your XMLNuke folder and double click in the file \"copy-dist-files.vbs\". Follow the instructions. \n\nChoose and create a folder for your project (e.g. c:\\InetPub\\wwwroot\\my-project). This folder must be accessible through your web broswer. Using the Windows Explorer find your XMLNuke Folder and double click in the file \"create-php5-project.vbs\" and follow the instructions. \n\nNow, just test it:\n\n    http://yourserver/my-project\n    \n\n## Development\n\nThe `master` branch is the stable release. All development will be done in the `develop` branch.\nMerge Requests will be accepted in the `develop` branch.\n\n### Pre-Commit Hook.\n\nYou can install a pre-commit hook to execute all unit tests before each commit. Install this hook by using the command:\n\n```\ncd \u003cxmlnukedir\u003e\nln -s \u003cxmlnukedir\u003e/utils/git/hooks/pre-commit .git/hooks\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fxmlnuke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyjg%2Fxmlnuke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyjg%2Fxmlnuke/lists"}