Menu

Tree [f9c6bc] master v4.00.2 /
 History

HTTPS access


File Date Author Commit
 nbproject 2013-10-22 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [fd533b] Fixing existing tests; New PHPMailer version
 templates 2014-04-15 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [d31881] Changed how to bind objects from different types.
 utils 2014-06-22 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [d3e8c9] Added some git utils to the project
 xmlnuke-common 2014-04-21 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [94d061] Refactoring Chart capability:
 xmlnuke-data 2014-06-29 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [200638] Fix name of XmlnukePoll language file;
 xmlnuke-php5 2014-08-22 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f9c6bc] Fixed Poll to avoid multiple votes from the sam...
 .gitignore 2014-01-20 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [a75801] Started migration of the Xmlnuke admin modules ...
 .todo 2009-05-30 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f10305] Created trunk repository
 .travis.yml 2013-10-22 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [57cc96] Added travis for continuous building
 AUTHORS 2009-05-30 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f10305] Created trunk repository
 CONTRIBUTORS 2009-05-30 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f10305] Created trunk repository
 LICENSE 2013-07-24 Joao Gilberto Magalhães Joao Gilberto Magalhães [a1b882] Update LICENSE
 README.md 2014-04-14 Joao Gilberto Magalhães Joao Gilberto Magalhães [447a93] Change the Build Status to point to the master ...
 VERSION 2012-09-20 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [031993] Branch Reintegration; Feature Autoload PHP clas...
 copy-dist-files.sh 2013-07-06 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f53a89] Adjusts in name files rename_to_work to dist (b...
 copy-dist-files.vbs 2013-07-06 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [f53a89] Adjusts in name files rename_to_work to dist (b...
 create-php5-project.php 2014-08-05 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [629abf] Create script to update the xmlnuke references ...
 update-php5-project.php 2014-08-05 Joao Gilberto Magalhaes Joao Gilberto Magalhaes [ad9cb6] Create script to update the xmlnuke references ...

Read Me

XMLNuke

Build Status

[ 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. ]

XMLNuke 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.

This is a page in XMLNuke:

namespace MyProject\Modules;

use Xmlnuke\Core\Classes\XmlnukeDocument;
use Xmlnuke\Core\Module\BaseModule;

class Home extends BaseModule 
{
    public function __construct()
    {}

    public function CreatePage() 
    {
        $this->defaultXmlnukeDocument = new XmlnukeDocument("Title", "Abstract");
        ...
        return $this->defaultXmlnukeDocument;
    }
}

You 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:

namespace MyProject\Modules;

use Xmlnuke\Core\Module\BaseModule;

class Home extends BaseModule 
{
    /**
     * requiresAutentication(), getAccessLevel() and getRole() handle the page security and access level
     */
    public functon requiresAutentication()
    {
        return true;
    }

    public function getAccessLevel()
    {
        return \Xmlnuke\Core\Enum\AccessLevel::OnlyRole;
    }

    public function getRole()
    {
        return new array("DIRECTOR", "MANAGER");
    }


    /**
     * useCache determines if the XMLNuke will store your page in a cache or not.
     * By default XMLNuke can store in the:
     *   - \Xmlnuke\Core\Cache\ArrayCacheEngine (Static Array), 
     *   - \Xmlnuke\Core\Cache\FileSystemCacheEngine (File System), 
     *   - \Xmlnuke\Core\Cache\MemcachedEngine (MemCached),
     *   - \Xmlnuke\Core\Cache\NoCacheEngine (Ignore Cache)
     * 
     * You can configure your own cache strategy by implementing the interface 
     * \Xmlnuke\Core\Cache\ICacheEngine.
     */ 
    public function useCache()
    {
        if ($this->_action != "")
        {
              return false;
        }
        else
        {
              return true;
        }
    }

    /** 
     * Determines if your page requires SSL or Not
     */
    public function requiresSSL()
    {
        return \Xmlnuke\Core\Enum\SSLAccess::ForceSSL;
    }
}

If 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:

namespace MyProject\Classes;

class MyClass
{
    protected $_name;
    public function getName() ...;
    public function setName($value) ...;

    protected $_age;
    public function getAge() ...;
    public function setAge($value) ...;
}
namespace MyProject\Modules;

use MyProject\Classes;
use Xmlnuke\Core\Classes\XmlnukeDocument;
use Xmlnuke\Core\Module\BaseModule;

class Home extends BaseModule 
{
    public function CreatePage() 
    {
        $this->defaultXmlnukeDocument = new XmlnukeDocument("Title", "Abstract");
        ...

        $myClass = new MyClass();
        $myClass->setName('Joao');
        $myClass->setAge(39);
        ...
        $this->defaultXmlnukeDocument->addXmlnukeObject($myClass);

        return $this->defaultXmlnukeDocument;
    }
}

After 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:

http://youserver/xmlnuke.php?module=byjg.home&raw=xml&spath=//MyProject_Classes_MyClass
<xmlnuke xpath="//MyProject_Classes_MyClass">
    <MyProject_Classes_MyClass>
        <name>Joao</name>
        <age>39</age>
    </MyProject_Classes_MyClass>
</xmlnuke>

or

http://yourserver/xmlnuke.php?module=byjg.home&raw=json&xpath=//MyProject_Classes_MyClass;
{
    "MyProject_Classes_MyClass": {
        "name": "Joao",
        "age": "39"
    }
}

See the Wiki for more examples;

Installing

The master branch requires PHP 5.3 to run. Prior PHP versions can use the legacy 'php50' branch.

Web Install

You can install the XMLNuke by using the XMLNuke PHP5 Installer. It is a interactive interface and will guide you during all install process. This tool check if your system meets the XMLNuke requirements, download the XMLNuke and creates a project for you. It is in beta stage

See more at:
https://github.com/byjg/xmlnuke-php5-installer

Command Line (Debian/Ubuntu)

You have to install your web server (Apache2, Lighttd, nginx, ...). XMLNuke requires for PHP:

apt-get install php5-xsl php5-json

Download the XMLNuke package. You can download from:
- the Zip package (https://github.com/byjg/xmlnuke/archive/master.zip) or
- from repository by using the Git or SVN.

Extract the package in any folder, e.g. /opt/xmlnuke.
Remember: The XMLNuke folder cannot to be accessible from you Web Browser.

Run at your terminal:

cd /opt/xmlnuke
./copy-dist-files.sh link yes

Choose and create a folder for your project. This folder must be accessible through your web broswer.

mkdir /var/www/my-project
php /opt/xmlnuke/create-php5-project.php /var/www/my-project myproject en-us pt-br
ln -s /opt/xmlnuke/xmlnuke-common /var/www/my-project/common

Now, just test it:

http://yourserver/my-project

Windows

You have to install your web server (Xampp, Apache2, IIS, ...) and configure it to run PHP5 scripts. Make sure that the XSL extension is installed.

Download the XMLNuke package. You can download from:
- the Zip package (https://github.com/byjg/xmlnuke/archive/master.zip) or
- from repository by using the Git or SVN.

Extract the package in any folder, e.g. D:\data\xmlnuke.
Remember: The XMLNuke folder cannot to be accessible from you Web Browser.

Using the Windows Explorer find your XMLNuke folder and double click in the file "copy-dist-files.vbs". Follow the instructions.

Choose 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.

Now, just test it:

http://yourserver/my-project
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.