[puntoengine] r100 committed - New version release 0.4.0

11 views
Skip to first unread message

punto...@googlecode.com

unread,
Nov 2, 2011, 5:11:02 PM11/2/11
to punto...@googlegroups.com
Revision: 100
Author: jbalde
Date: Wed Nov 2 14:09:30 2011
Log: New version release 0.4.0
http://code.google.com/p/puntoengine/source/detail?r=100

Added:
/tags/puntoengine_0.4.0
/tags/puntoengine_0.4.0/.htaccess
/tags/puntoengine_0.4.0/beans
/tags/puntoengine_0.4.0/changelog
/tags/puntoengine_0.4.0/config
/tags/puntoengine_0.4.0/config/admin.xml
/tags/puntoengine_0.4.0/config/database.xml
/tags/puntoengine_0.4.0/config/mimes.xml
/tags/puntoengine_0.4.0/config/web.xml
/tags/puntoengine_0.4.0/controllers
/tags/puntoengine_0.4.0/controllers/ExampleController.php
/tags/puntoengine_0.4.0/core
/tags/puntoengine_0.4.0/core/Kernel.php
/tags/puntoengine_0.4.0/core/Object.php
/tags/puntoengine_0.4.0/core/admin
/tags/puntoengine_0.4.0/core/admin/AdminController.php
/tags/puntoengine_0.4.0/core/admin/template
/tags/puntoengine_0.4.0/core/admin/template/home.php
/tags/puntoengine_0.4.0/core/admin/template/login.php
/tags/puntoengine_0.4.0/core/admin/template/master.php
/tags/puntoengine_0.4.0/core/database
/tags/puntoengine_0.4.0/core/database/Database.php
/tags/puntoengine_0.4.0/core/exceptions
/tags/puntoengine_0.4.0/core/exceptions/CoreException.php
/tags/puntoengine_0.4.0/core/exceptions/ExceptionCodes.php
/tags/puntoengine_0.4.0/core/exceptions/IOException.php
/tags/puntoengine_0.4.0/core/exceptions/NotImplementedException.php
/tags/puntoengine_0.4.0/core/exceptions/XmlException.php
/tags/puntoengine_0.4.0/core/http
/tags/puntoengine_0.4.0/core/http/HttpController.php
/tags/puntoengine_0.4.0/core/http/HttpMethods.php
/tags/puntoengine_0.4.0/core/http/HttpRequest.php
/tags/puntoengine_0.4.0/core/http/HttpResponse.php
/tags/puntoengine_0.4.0/core/http/HttpServlet.php
/tags/puntoengine_0.4.0/core/http/HttpWebConnection.php
/tags/puntoengine_0.4.0/core/http/Url.php
/tags/puntoengine_0.4.0/core/plugin
/tags/puntoengine_0.4.0/core/plugin/Hook.php
/tags/puntoengine_0.4.0/core/plugin/HookTypes.php
/tags/puntoengine_0.4.0/core/plugin/Plugin.php
/tags/puntoengine_0.4.0/core/plugin/PluginManager.php
/tags/puntoengine_0.4.0/core/reflection
/tags/puntoengine_0.4.0/core/resources
/tags/puntoengine_0.4.0/core/resources/css
/tags/puntoengine_0.4.0/core/resources/css/admin.css
/tags/puntoengine_0.4.0/core/resources/css/exception.css
/tags/puntoengine_0.4.0/core/resources/images
/tags/puntoengine_0.4.0/core/resources/images/black-button.png
/tags/puntoengine_0.4.0/core/resources/images/logo.png
/tags/puntoengine_0.4.0/core/resources/images/titlebar.png
/tags/puntoengine_0.4.0/core/xml
/tags/puntoengine_0.4.0/core/xml/XmlDocument.php
/tags/puntoengine_0.4.0/core/xml/XmlNode.php
/tags/puntoengine_0.4.0/data
/tags/puntoengine_0.4.0/design
/tags/puntoengine_0.4.0/engine.php
/tags/puntoengine_0.4.0/helper
/tags/puntoengine_0.4.0/images
/tags/puntoengine_0.4.0/install.php
/tags/puntoengine_0.4.0/js
/tags/puntoengine_0.4.0/license
/tags/puntoengine_0.4.0/servlets
/tags/puntoengine_0.4.0/servlets/TestController.php
/tags/puntoengine_0.4.0/servlets/pepadmin
/tags/puntoengine_0.4.0/servlets/pepadmin/PepAdminController.php
/tags/puntoengine_0.4.0/template
/tags/puntoengine_0.4.0/template/example
/tags/puntoengine_0.4.0/template/example/default.php
/tags/puntoengine_0.4.0/template/example/master.php
/tags/puntoengine_0.4.0/template/example/other.php
/tags/puntoengine_0.4.0/template/pepadmin
/tags/puntoengine_0.4.0/template/pepadmin/admin.php
/tags/puntoengine_0.4.0/template/pepadmin/adminmaster.php
/tags/puntoengine_0.4.0/template/pepadmin/head.php
/tags/puntoengine_0.4.0/template/pepadmin/login.php
/tags/puntoengine_0.4.0/template/pepadmin/menu.php
/tags/puntoengine_0.4.0/template/pepadmin/servlets.php
/tags/puntoengine_0.4.0/template/test
/tags/puntoengine_0.4.0/template/test/head.php
/tags/puntoengine_0.4.0/template/test/master.php
/tags/puntoengine_0.4.0/template/test/menu.php
/tags/puntoengine_0.4.0/xml

=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/.htaccess Wed Nov 2 14:09:30 2011
@@ -0,0 +1,4 @@
+Options +Indexes
+Options +FollowSymlinks
+
+DirectoryIndex install.php
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/changelog Wed Nov 2 14:09:30 2011
@@ -0,0 +1,22 @@
+Version 0.4.0
+ - New controller system against servlet system
+ - New Object class to base of all objects
+
+Version 0.2.1
+ - Fixed a problem with virtual path autoprocessor when the path is a
root path same "/"
+ - Added files licenses for GPL3
+
+Version 0.2.0
+ - Added this change log
+ - Added virtual path (accesible in the browser) at the kernel
+ - Added servlet url in a class attribute
+ - Added detailed exception trace where are configured in web.xml
+ - Added in web.xml a config section with debug mode
+ - Added debug atribute in servlet class to realice the traces if the
project are in debug mode
+ - Added base redirect same a aspnet. If redirect url starts with "~/",
the url take the base project url
+ - Added masterpage functionality with secction page and dinamic code
same include and php code
+ - Added functionality when a path has ~/ chageit for virtual path same
a dotnet with runat server
+ - Updated the error page message that are reference at IDCS Server and
change its for "Punto Engine Server"
+ - Updated the HomeController class to a TestController with many
examples of templates use with masterpage
+ - Fixed the some exception pages showed when have a multiple errors.
Now stops the process when the error throwed
+ - Delete temporaly the PepAdminController from web.xml to can't access
it
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/config/admin.xml Wed Nov 2 14:09:30 2011
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Configuration xml to administrator access
+ @category config
+ @author Juan Benavides Romero <juan.benav...@gmail.com>
+ @since 0.3
+-->
+<Admin>
+ <Users>
+ <User>
+ <Credentials user="admin" pass="1234"/>
+ </User>
+ </Users>
+</Admin>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/config/database.xml Wed Nov 2 14:09:30 2011
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Configuration xml to access to database
+ @category config
+ @author Juan Benavides Romero <juan.benav...@gmail.com>
+ @since 0.3
+-->
+<Database>
+ <Connection>
+ <!-- Server of the database -->
+ <Server>localhost</Server>
+ <!-- User of the database. In local machines usualy are root user -->
+ <User>user</User>
+ <!-- Password of the user database -->
+ <Password>pass</Password>
+ <!-- Database name -->
+ <DB>database</DB>
+ </Connection>
+</Database>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/config/mimes.xml Wed Nov 2 14:09:30 2011
@@ -0,0 +1,3638 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Mimes>
+ <Mime type="application/andrew-inset">
+ <Extensions>
+ <Extension ext="ez" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/applixware">
+ <Extensions>
+ <Extension ext="aw" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/atom+xml">
+ <Extensions>
+ <Extension ext="atom" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/atomcat+xml">
+ <Extensions>
+ <Extension ext="atomcat" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/atomsvc+xml">
+ <Extensions>
+ <Extension ext="atomsvc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/ccxml+xml">
+ <Extensions>
+ <Extension ext="ccxml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cdmi-capability">
+ <Extensions>
+ <Extension ext="cdmia" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cdmi-container">
+ <Extensions>
+ <Extension ext="cdmic" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cdmi-domain">
+ <Extensions>
+ <Extension ext="cdmid" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cdmi-object">
+ <Extensions>
+ <Extension ext="cdmio" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cdmi-queue">
+ <Extensions>
+ <Extension ext="cdmiq" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/cu-seeme">
+ <Extensions>
+ <Extension ext="cu" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/davmount+xml">
+ <Extensions>
+ <Extension ext="davmount" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/dssc+der">
+ <Extensions>
+ <Extension ext="dssc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/dssc+xml">
+ <Extensions>
+ <Extension ext="xdssc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/ecmascript">
+ <Extensions>
+ <Extension ext="ecma" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/emma+xml">
+ <Extensions>
+ <Extension ext="emma" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/epub+zip">
+ <Extensions>
+ <Extension ext="epub" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/exi">
+ <Extensions>
+ <Extension ext="exi" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/font-tdpfr">
+ <Extensions>
+ <Extension ext="pfr" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/hyperstudio">
+ <Extensions>
+ <Extension ext="stk" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/ipfix">
+ <Extensions>
+ <Extension ext="ipfix" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/java-archive">
+ <Extensions>
+ <Extension ext="jar" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/java-serialized-object">
+ <Extensions>
+ <Extension ext="ser" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/java-vm">
+ <Extensions>
+ <Extension ext="class" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/javascript">
+ <Extensions>
+ <Extension ext="js" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/json">
+ <Extensions>
+ <Extension ext="json" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/lost+xml">
+ <Extensions>
+ <Extension ext="lostxml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mac-binhex40">
+ <Extensions>
+ <Extension ext="hqx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mac-compactpro">
+ <Extensions>
+ <Extension ext="cpt" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mads+xml">
+ <Extensions>
+ <Extension ext="mads" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/marc">
+ <Extensions>
+ <Extension ext="mrc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/marcxml+xml">
+ <Extensions>
+ <Extension ext="mrcx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mathematica">
+ <Extensions>
+ <Extension ext="ma" />
+ <Extension ext="nb" />
+ <Extension ext="mb" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mathml+xml">
+ <Extensions>
+ <Extension ext="mathml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mbox">
+ <Extensions>
+ <Extension ext="mbox" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mediaservercontrol+xml">
+ <Extensions>
+ <Extension ext="mscml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/metalink4+xml">
+ <Extensions>
+ <Extension ext="meta4" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mets+xml">
+ <Extensions>
+ <Extension ext="mets" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mods+xml">
+ <Extensions>
+ <Extension ext="mods" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mp21">
+ <Extensions>
+ <Extension ext="m21" />
+ <Extension ext="mp21" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mp4">
+ <Extensions>
+ <Extension ext="mp4s" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/msword">
+ <Extensions>
+ <Extension ext="doc" />
+ <Extension ext="dot" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/mxf">
+ <Extensions>
+ <Extension ext="mxf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/octet-stream">
+ <Extensions>
+ <Extension ext="bin" />
+ <Extension ext="dms" />
+ <Extension ext="lha" />
+ <Extension ext="lrf" />
+ <Extension ext="lzh" />
+ <Extension ext="so" />
+ <Extension ext="iso" />
+ <Extension ext="dmg" />
+ <Extension ext="dist" />
+ <Extension ext="distz" />
+ <Extension ext="pkg" />
+ <Extension ext="bpk" />
+ <Extension ext="dump" />
+ <Extension ext="elc" />
+ <Extension ext="deploy" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/oda">
+ <Extensions>
+ <Extension ext="oda" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/oebps-package+xml">
+ <Extensions>
+ <Extension ext="opf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/ogg">
+ <Extensions>
+ <Extension ext="ogx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/onenote">
+ <Extensions>
+ <Extension ext="onetoc" />
+ <Extension ext="onetoc2" />
+ <Extension ext="onetmp" />
+ <Extension ext="onepkg" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/patch-ops-error+xml">
+ <Extensions>
+ <Extension ext="xer" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pdf">
+ <Extensions>
+ <Extension ext="pdf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pgp-encrypted">
+ <Extensions>
+ <Extension ext="pgp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pgp-signature">
+ <Extensions>
+ <Extension ext="asc" />
+ <Extension ext="sig" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pics-rules">
+ <Extensions>
+ <Extension ext="prf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkcs10">
+ <Extensions>
+ <Extension ext="p10" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkcs7-mime">
+ <Extensions>
+ <Extension ext="p7m" />
+ <Extension ext="p7c" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkcs7-signature">
+ <Extensions>
+ <Extension ext="p7s" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkcs8">
+ <Extensions>
+ <Extension ext="p8" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkix-attr-cert">
+ <Extensions>
+ <Extension ext="ac" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkix-cert">
+ <Extensions>
+ <Extension ext="cer" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkix-crl">
+ <Extensions>
+ <Extension ext="crl" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkix-pkipath">
+ <Extensions>
+ <Extension ext="pkipath" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pkixcmp">
+ <Extensions>
+ <Extension ext="pki" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pls+xml">
+ <Extensions>
+ <Extension ext="pls" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/postscript">
+ <Extensions>
+ <Extension ext="ai" />
+ <Extension ext="eps" />
+ <Extension ext="ps" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/prs.cww">
+ <Extensions>
+ <Extension ext="cww" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/pskc+xml">
+ <Extensions>
+ <Extension ext="pskcxml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/rdf+xml">
+ <Extensions>
+ <Extension ext="rdf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/reginfo+xml">
+ <Extensions>
+ <Extension ext="rif" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/relax-ng-compact-syntax">
+ <Extensions>
+ <Extension ext="rnc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/resource-lists+xml">
+ <Extensions>
+ <Extension ext="rl" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/resource-lists-diff+xml">
+ <Extensions>
+ <Extension ext="rld" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/rls-services+xml">
+ <Extensions>
+ <Extension ext="rs" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/rsd+xml">
+ <Extensions>
+ <Extension ext="rsd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/rss+xml">
+ <Extensions>
+ <Extension ext="rss" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/rtf">
+ <Extensions>
+ <Extension ext="rtf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/sbml+xml">
+ <Extensions>
+ <Extension ext="sbml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/scvp-cv-request">
+ <Extensions>
+ <Extension ext="scq" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/scvp-cv-response">
+ <Extensions>
+ <Extension ext="scs" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/scvp-vp-request">
+ <Extensions>
+ <Extension ext="spq" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/scvp-vp-response">
+ <Extensions>
+ <Extension ext="spp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/sdp">
+ <Extensions>
+ <Extension ext="sdp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/set-payment-initiation">
+ <Extensions>
+ <Extension ext="setpay" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/set-registration-initiation">
+ <Extensions>
+ <Extension ext="setreg" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/shf+xml">
+ <Extensions>
+ <Extension ext="shf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/smil+xml">
+ <Extensions>
+ <Extension ext="smi" />
+ <Extension ext="smil" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/sparql-query">
+ <Extensions>
+ <Extension ext="rq" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/sparql-results+xml">
+ <Extensions>
+ <Extension ext="srx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/srgs">
+ <Extensions>
+ <Extension ext="gram" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/srgs+xml">
+ <Extensions>
+ <Extension ext="grxml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/sru+xml">
+ <Extensions>
+ <Extension ext="sru" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/ssml+xml">
+ <Extensions>
+ <Extension ext="ssml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/tei+xml">
+ <Extensions>
+ <Extension ext="tei" />
+ <Extension ext="teicorpus" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/thraud+xml">
+ <Extensions>
+ <Extension ext="tfi" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/timestamped-data">
+ <Extensions>
+ <Extension ext="tsd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.3gpp.pic-bw-large">
+ <Extensions>
+ <Extension ext="plb" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.3gpp.pic-bw-small">
+ <Extensions>
+ <Extension ext="psb" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.3gpp.pic-bw-var">
+ <Extensions>
+ <Extension ext="pvb" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.3gpp2.tcap">
+ <Extensions>
+ <Extension ext="tcap" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.3m.post-it-notes">
+ <Extensions>
+ <Extension ext="pwn" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.accpac.simply.aso">
+ <Extensions>
+ <Extension ext="aso" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.accpac.simply.imp">
+ <Extensions>
+ <Extension ext="imp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.acucobol">
+ <Extensions>
+ <Extension ext="acu" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.acucorp">
+ <Extensions>
+ <Extension ext="atc" />
+ <Extension ext="acutc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.adobe.air-application-installer-package+zip">
+ <Extensions>
+ <Extension ext="air" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.adobe.fxp">
+ <Extensions>
+ <Extension ext="fxp" />
+ <Extension ext="fxpl" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.adobe.xdp+xml">
+ <Extensions>
+ <Extension ext="xdp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.adobe.xfdf">
+ <Extensions>
+ <Extension ext="xfdf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.ahead.space">
+ <Extensions>
+ <Extension ext="ahead" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.airzip.filesecure.azf">
+ <Extensions>
+ <Extension ext="azf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.airzip.filesecure.azs">
+ <Extensions>
+ <Extension ext="azs" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.amazon.ebook">
+ <Extensions>
+ <Extension ext="azw" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.americandynamics.acc">
+ <Extensions>
+ <Extension ext="acc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.amiga.ami">
+ <Extensions>
+ <Extension ext="ami" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.android.package-archive">
+ <Extensions>
+ <Extension ext="apk" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.anser-web-certificate-issue-initiation">
+ <Extensions>
+ <Extension ext="cii" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.anser-web-funds-transfer-initiation">
+ <Extensions>
+ <Extension ext="fti" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.antix.game-component">
+ <Extensions>
+ <Extension ext="atx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.apple.installer+xml">
+ <Extensions>
+ <Extension ext="mpkg" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.apple.mpegurl">
+ <Extensions>
+ <Extension ext="m3u8" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.aristanetworks.swi">
+ <Extensions>
+ <Extension ext="swi" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.audiograph">
+ <Extensions>
+ <Extension ext="aep" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.blueice.multipass">
+ <Extensions>
+ <Extension ext="mpm" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.bmi">
+ <Extensions>
+ <Extension ext="bmi" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.businessobjects">
+ <Extensions>
+ <Extension ext="rep" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.chemdraw+xml">
+ <Extensions>
+ <Extension ext="cdxml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.chipnuts.karaoke-mmd">
+ <Extensions>
+ <Extension ext="mmd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cinderella">
+ <Extensions>
+ <Extension ext="cdy" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.claymore">
+ <Extensions>
+ <Extension ext="cla" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cloanto.rp9">
+ <Extensions>
+ <Extension ext="rp9" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.clonk.c4group">
+ <Extensions>
+ <Extension ext="c4g" />
+ <Extension ext="c4d" />
+ <Extension ext="c4f" />
+ <Extension ext="c4p" />
+ <Extension ext="c4u" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cluetrust.cartomobile-config">
+ <Extensions>
+ <Extension ext="c11amc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cluetrust.cartomobile-config-pkg">
+ <Extensions>
+ <Extension ext="c11amz" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.commonspace">
+ <Extensions>
+ <Extension ext="csp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.contact.cmsg">
+ <Extensions>
+ <Extension ext="cdbcmsg" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cosmocaller">
+ <Extensions>
+ <Extension ext="cmc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.crick.clicker">
+ <Extensions>
+ <Extension ext="clkx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.crick.clicker.keyboard">
+ <Extensions>
+ <Extension ext="clkk" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.crick.clicker.palette">
+ <Extensions>
+ <Extension ext="clkp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.crick.clicker.template">
+ <Extensions>
+ <Extension ext="clkt" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.crick.clicker.wordbank">
+ <Extensions>
+ <Extension ext="clkw" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.criticaltools.wbs+xml">
+ <Extensions>
+ <Extension ext="wbs" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.ctc-posml">
+ <Extensions>
+ <Extension ext="pml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.cups-ppd">
+ <Extensions>
+ <Extension ext="ppd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.curl.car">
+ <Extensions>
+ <Extension ext="car" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.curl.pcurl">
+ <Extensions>
+ <Extension ext="pcurl" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.data-vision.rdz">
+ <Extensions>
+ <Extension ext="rdz" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dece.data">
+ <Extensions>
+ <Extension ext="uvf" />
+ <Extension ext="uvvf" />
+ <Extension ext="uvd" />
+ <Extension ext="uvvd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dece.ttml+xml">
+ <Extensions>
+ <Extension ext="uvt" />
+ <Extension ext="uvvt" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dece.unspecified">
+ <Extensions>
+ <Extension ext="uvx" />
+ <Extension ext="uvvx" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.denovo.fcselayout-link">
+ <Extensions>
+ <Extension ext="fe_launch" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dna">
+ <Extensions>
+ <Extension ext="dna" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dolby.mlp">
+ <Extensions>
+ <Extension ext="mlp" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dpgraph">
+ <Extensions>
+ <Extension ext="dpg" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dreamfactory">
+ <Extensions>
+ <Extension ext="dfac" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dvb.ait">
+ <Extensions>
+ <Extension ext="ait" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dvb.service">
+ <Extensions>
+ <Extension ext="svc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.dynageo">
+ <Extensions>
+ <Extension ext="geo" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.ecowin.chart">
+ <Extensions>
+ <Extension ext="mag" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.enliven">
+ <Extensions>
+ <Extension ext="nml" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.epson.esf">
+ <Extensions>
+ <Extension ext="esf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.epson.msf">
+ <Extensions>
+ <Extension ext="msf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.epson.quickanime">
+ <Extensions>
+ <Extension ext="qam" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.epson.salt">
+ <Extensions>
+ <Extension ext="slt" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.epson.ssf">
+ <Extensions>
+ <Extension ext="ssf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.eszigno3+xml">
+ <Extensions>
+ <Extension ext="es3" />
+ <Extension ext="et3" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.ezpix-album">
+ <Extensions>
+ <Extension ext="ez2" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.ezpix-package">
+ <Extensions>
+ <Extension ext="ez3" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fdf">
+ <Extensions>
+ <Extension ext="fdf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fdsn.mseed">
+ <Extensions>
+ <Extension ext="mseed" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fdsn.seed">
+ <Extensions>
+ <Extension ext="seed" />
+ <Extension ext="dataless" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.flographit">
+ <Extensions>
+ <Extension ext="gph" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fluxtime.clip">
+ <Extensions>
+ <Extension ext="ftc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.framemaker">
+ <Extensions>
+ <Extension ext="fm" />
+ <Extension ext="frame" />
+ <Extension ext="maker" />
+ <Extension ext="book" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.frogans.fnc">
+ <Extensions>
+ <Extension ext="fnc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.frogans.ltf">
+ <Extensions>
+ <Extension ext="ltf" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fsc.weblaunch">
+ <Extensions>
+ <Extension ext="fsc" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujitsu.oasys">
+ <Extensions>
+ <Extension ext="oas" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujitsu.oasys2">
+ <Extensions>
+ <Extension ext="oa2" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujitsu.oasys3">
+ <Extensions>
+ <Extension ext="oa3" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujitsu.oasysgp">
+ <Extensions>
+ <Extension ext="fg5" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujitsu.oasysprs">
+ <Extensions>
+ <Extension ext="bh2" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujixerox.ddd">
+ <Extensions>
+ <Extension ext="ddd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujixerox.docuworks">
+ <Extensions>
+ <Extension ext="xdw" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fujixerox.docuworks.binder">
+ <Extensions>
+ <Extension ext="xbd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.fuzzysheet">
+ <Extensions>
+ <Extension ext="fzs" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.genomatix.tuxedo">
+ <Extensions>
+ <Extension ext="txd" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.geogebra.file">
+ <Extensions>
+ <Extension ext="ggb" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.geogebra.tool">
+ <Extensions>
+ <Extension ext="ggt" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.geometry-explorer">
+ <Extensions>
+ <Extension ext="gex" />
+ <Extension ext="gre" />
+ </Extensions>
+ </Mime>
+ <Mime type="application/vnd.geonext">
+ <Extensions>
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/config/web.xml Wed Nov 2 14:09:30 2011
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Configuration xml to call servlet controllers
+ @category config
+ @author Juan Benavides Romero <juan.benav...@gmail.com>
+ @since 0.3
+-->
+<Web>
+ <!-- Config section -->
+ <Config>
+ <!-- activate true for show detailed error trace in error page -->
+ <Debug activate="true" />
+ </Config>
+ <!-- Servlets container -->
+ <Servlets>
+ <!-- Admin servlet -->
+ <Servlet>
+ <Name>Admin</Name>
+ <Class>AdminController</Class>
+ <Namespace>core.admin</Namespace>
+ <Patterns>
+ <Pattern>/admin</Pattern>
+ <Pattern>/admin/*</Pattern>
+ </Patterns>
+ <Description>Framework administration</Description>
+ </Servlet>
+ <!-- Home example servlet -->
+ <Servlet>
+ <Name>Test</Name>
+ <Class>TestController</Class>
+ <Namespace>servlet</Namespace>
+ <Patterns>
+ <Pattern>/</Pattern>
+ <Pattern>/test</Pattern>
+ </Patterns>
+ <Description>Page with many examples</Description>
+ </Servlet>
+ </Servlets>
+</Web>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/controllers/ExampleController.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Source code of ExampleController class controller
+ * @category puntoengine
+ * @package controllers
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+
+
+/**
+ * ExampleController is a controller class of the many examples
+ * @category puntoengine
+ * @package servlets
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+class ExampleController extends HttpController {
+
+ /**
+ * Master page
+ * @var string
+ */
+ protected $master = 'Example/master.php';
+
+
+ /**
+ * Default action method
+ */
+ public function defaultAction() {
+ //Process the action, connect to database, etc
+ }//defaultAction
+
+
+ /**
+ * Other action method
+ */
+ public function otherAction() {
+ //Process the action, connect to database, etc
+ }//otherAction
+}//ExampleController
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/Kernel.php Wed Nov 2 14:09:30 2011
@@ -0,0 +1,453 @@
+<?php
+/**
+ * Source code of puntoengine Kernel
+ * @category puntoengine
+ * @package core
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+Kernel::import('core');
+Kernel::import('core.admin');
+Kernel::import('core.exceptions');
+Kernel::import('core.http');
+Kernel::import('core.xml');
+Kernel::import('core.plugin');
+Kernel::import('controllers');
+Kernel::import('servlets');
+Kernel::import('servlets.pepadmin');
+
+
+/**
+ * This function is a handler to load the class and function autmaticly.
+ * Call a kernel function to load it.
+ * @param string $functionName Name of the function of class to load
+ * @since 0.1.1
+ */
+function __autoload($functionName) {
+ Kernel::autoload($functionName);
+}//__autoload
+
+
+/**
+ * Kernel of the puntoengine application
+ * @category puntoengine
+ * @package core
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class Kernel {
+ /**
+ * Physical path of the application
+ * @var string
+ * @since 0.3
+ */
+ private static $path;
+
+
+ /**
+ * Virtual path of the project, accesible via browser
+ * @var string
+ * @since 0.3
+ */
+ private static $virtualPath;
+
+
+ /**
+ * Virtual namespace to load the functions and classes
+ * @var array
+ * @since 0.3
+ */
+ private static $importList;
+
+
+ /**
+ * Instance of Kernel
+ * @var Kernel
+ */
+ private static $instance;
+
+
+ /**
+ * Version of the puntoengine kernel. Indicate the version of
puntoengine
+ * @since 0.3
+ */
+ const VERSION = '0.4.0';
+
+
+
+ /**
+ * Default constructor of kernel.
+ * A private constructor for the singleton pattern
+ * @return Kernel
+ */
+ private function __construct() {
+ return;
+ }//__construct
+
+
+
+ /**
+ * Return the active instance of kernel
+ * @return Kernel
+ */
+ public static function instance() {
+ return Kernel::$instance;
+ }//instance
+
+
+
+ /**
+ * Return the real physical path of the puntoengine application
+ * @return string Path of the application
+ * @since 0.3
+ */
+ public static function getPath() {
+ return Kernel::$path;
+ }//getPath
+
+
+ /**
+ * Return the virtual path of the puntoengine application to access
via browser
+ * @return string Virtual path of the application
+ * @since 0.3
+ */
+ public static function getVirtualPath() {
+ return Kernel::$virtualPath;
+ }//getVirtualPath
+
+
+ /**
+ * Initialize the kernel application
+ * @param array $get GET params array
+ * @param array $post POST params array
+ * @param array $server SERVER params array
+ * @param array $cookies COOKIE params array
+ * @param array $files FILES param array
+ * @todo check if the request has double bars // and redirect with one
bar /
+ * @since 0.3
+ */
+ public static function process($get, $post, $server, $cookies, $files)
{
+ Kernel::garbageCollector();
+ Kernel::configure();
+
+ if(dirname($server['SCRIPT_NAME']) != '/') {
+ $servletName = str_replace(dirname($server['SCRIPT_NAME']), '',
$server['REQUEST_URI']);
+ } else {
+ $servletName = $server['REQUEST_URI'];
+ }
+
+ $servletNameTemp = explode('?', $servletName);
+ $servletName = $servletNameTemp[0];
+
+ if(is_file(Kernel::getPath().$servletName) && (substr($servletName, 1,
6) == 'design' || substr($servletName, 1, 6) == 'images' ||
substr($servletName, 1, 2) == 'js' || substr($servletName, 1, 3) == 'xml' |
| substr($servletName, 1, 14) == 'core/resources')) {
+ $extension = pathinfo(Kernel::getPath().$servletName,
PATHINFO_EXTENSION);
+
+ $document = new XmlDocument();
+ $document->loadXmlFile('/config/mimes.xml');
+
+ $contentType =
$document->selectSingleNode('/Mimes/Mime[Extensions/Extension/@ext
= "'.$extension.'"]/@type');
+
+ header('Content-Type: '.$contentType);
+
+ echo file_get_contents(Kernel::getPath().$servletName);
+ return;
+ }
+
+ $url = new Url($servletName);
+
+ $controller = Kernel::getController($url);
+
+ $requestArray = array();
+ $requestArray = array_merge($get, $post);
+
+ $request = new HttpRequest();
+ $request->setParams($requestArray);
+ $request->setSession($_SESSION);
+
+ $response = $controller->getResponse();
+
+ $response->process($request);
+ }//process
+
+
+ public static function getMime($extension) {
+ switch($extension) {
+ case 'css': $mime = 'text/css'; break;
+ case '.js': $mime = 'text/javascript'; break;
+ default: $mime = 'text/plain';
+ }
+
+ return $mime;
+ }
+
+
+ /**
+ * Clear the garbage of the diferents automatic variables of PHP
+ * @todo Reimplement
+ * @since 0.3
+ */
+ private static function garbageCollector() {
+ /*unset($_GET);
+ unset($_POST);
+ unset($_SERVER);
+ unset($_ENV);
+ unset($HTTP_ENV_VARS);
+ unset($HTTP_POST_VARS);
+ unset($HTTP_GET_VARS);
+ unset($HTTP_SERVER_VARS);
+ unset($_REQUEST);
+ //unset($GLOBALS);
+ //unset($_COOKIE);
+ unset($_FILES);*/
+ }//garbageCollector
+
+
+ /**
+ * Configure the kernel of the puntoengine
+ * @since 0.3
+ */
+ private static function configure() {
+ set_error_handler('Kernel::errorHandler');
+ set_exception_handler('Kernel::exceptionHandler');
+
+ date_default_timezone_set ('Europe/Madrid');
+
+ $path = dirname(__FILE__);
+ $path = str_replace('\\', '/', $path);
+ $path = str_replace('/core','', $path);
+
+ Kernel::$path = $path;
+ Kernel::$virtualPath = dirname($_SERVER['PHP_SELF']);
+ session_start();
+
+ Kernel::loadPlugins();
+ }//configure
+
+
+ /**
+ * Load all active plugins
+ * @since 0.3
+ * @todo implement with php_check_syntax to check include files are
correct
+ */
+ private static function loadPlugins() {
+
+ }
+
+
+ /**
+ * Load automaticly the class and the function search this in the
import
+ * list with the virtual paths
+ * @param string $functionName Name of the class or function to load
+ * @since 0.3
+ */
+ public static function autoload($functionName) {
+ for($i = 0; $i < count(Kernel::$importList); $i++) {
+ $dir = Kernel::getPath().'/'.str_replace('.', '/',
Kernel::$importList[$i]);
+ $file = $dir.'/'.$functionName.'.php';
+
+ if(is_file($file)) {
+ include_once($file);
+ }
+ }
+ }//autoload
+
+
+ /**
+ * Add a import virtual path namespace to load the classes
+ * @param string $import Virtual namespace path to load
+ * @since 0.3
+ */
+ public static function import($import) {
+ Kernel::$importList[] = $import;
+ }//import
+
+
+
+ /**
+ * Load a Controller by the name in the request. Search in controller
class
+ * and load the matched controller or throw a exception when don't
found a
+ * matched controller
+ * @param Url $url Url of request
+ * @return HttpController Controller who matched with the request
+ * @since 0.4
+ */
+ private static function getController(Url $url) {
+ $controllerName = null;
+ $methodName = null;
+
+ $controllers = $url->getControllers();
+
+ for($i = 0; $i < count($controllers); $i++) {
+ $tempController = array();
+ if(strpos($controllers[$i], '.')) {
+ $tempController = explode('.', $controllers[$i]);
+ $tempController[0] = ucfirst($tempController[0]);
+
+ if(class_exists($tempController[0].'Controller', true) &&
is_subclass_of($tempController[0].'Controller', 'HttpController')) {
+ if(method_exists($tempController[0].'Controller',
$tempController[1].'Action')) {
+ $controllerName = $tempController[0];
+ $methodName = $tempController[1];
+ }
+ }
+ } else {
+ $tempController[0] = ucfirst($controllers[$i]);
+
+ if(class_exists($tempController[0].'Controller', true) &&
is_subclass_of($tempController[0].'Controller', 'HttpController')) {
+ $controllerName = $tempController[0];
+ $methodName = 'default';
+ }
+ }
+
+ if($controllerName !== null && $methodName !== null) {
+ $i = count($controllers);
+ }
+ }
+
+
+ if($controllerName === null && $methodName === null) {
+ //TODO: catch error
+ } else {
+ $controllerClass = $controllerName.'Controller';
+ $methodAction = $methodName.'Action';
+
+ $controller = new $controllerClass();
+
+ $response = new HttpResponse();
+ $response->setController($controllerName);
+ $response->setAction($methodName);
+ $response->setMasterPage($controller->getMasterPage());
+
+ $controller->setResponse($response);
+ $controller->$methodAction();
+ }
+
+ return $controller;
+ }//getController
+
+
+
+ /**
+ * Load a Servlet by the name in the request. Search in configuration
xml
+ * and load the matched servlet or throw a exception when don't found a
+ * matched servlet
+ * @param string $servletName Name of request servlet to load
+ * @return HttpServlet Servlet who matched with the request
+ * @since 0.3
+ * @deprecated Since version 0.4.0 by getController
+ */
+ private static function getServlet($servletName) {
+ $url = new Url($servletName);
+
+ echo '<pre>';
+ print_r($url);
+ print_r($url->getControllers());
+
+ echo json_encode($url->getControllers());
+
+ $controlers = $url->getControllers();
+
+ for($i = 0; $i < count($controlers); $i++) {
+ $tempController = array();
+ if(strpos($controlers[$i], '.')) {
+ $tempController = explode('.', $controlers[$i]);
+ print_r($tempController);
+ //if(class_exists($tempController[0], true) && method_exists($object,
$method_name))
+ if(class_exists($tempController[0].'Controller', true) &&
is_subclass_of($tempController[0].'Controller', 'HttpController')) {
+ if(method_exists($tempController[0].'Controller',
$tempController[1].'Action')) {
+ echo 'si method';
+ } else {
+ echo 'no method';
+ }
+ }
+ } else {
+ $tempController[0] = $controlers[$i];
+
+ if(class_exists($tempController[0].'Controller', true)) {
+ echo 'existe';
+ }
+ }
+ }
+
+ echo '</pre>';
+ die;
+
+
+ $document = new XmlDocument();
+
+ $document->loadXmlFile('/config/web.xml');
+
+ try {
+ if(substr($servletName, -1) == '/') {
+ $servletClass =
$document->selectSingleNode('/Web/Servlets/Servlet[Patterns/Pattern
= "'.$servletName.'" or Patterns/Pattern = "'.substr($servletName, 0,
-1).'"]/Class');
+ } else {
+ $servletClass =
$document->selectSingleNode('/Web/Servlets/Servlet[Patterns/Pattern
= "'.$servletName.'"]/Class');
+ }
+ } catch(XmlException $exception) {
+ $servletAux = explode('/', $servletName);
+
+ $servletClass =
$document->selectSingleNode('/Web/Servlets/Servlet[Patterns/Pattern
= "/'.$servletAux[1].'/*"]/Class');
+ }
+
+ if(class_exists($servletClass)) {
+ eval('$servlet = new '.$servletClass.'();');
+ $servlet->setUrl($servletName);
+
+ if(isset($servletAux[2])) {
+ $servlet->setAction($servletAux[2]);
+ }
+ } else {
+ throw new
CoreException(ExceptionCodes::CORE_CLASSNOTFOUND, 'Class '.$servletClass.'
not found');
+ }
+
+ return $servlet;
+ }//getServlet
+
+
+
+ /**
+ * Catch a error and manage it with a internal exception manager
+ * @param int $code Error code
+ * @param string $message Descriptive error message
+ * @param string $file File where throw the error
+ * @param int $line Line where throw the error
+ * @param array $context Variables context when the error throwed
+ * @since 0.3
+ */
+ public static function errorHandler($code, $message, $file, $line,
$context) {
+ $exception = new CoreException(ExceptionCodes::CORE_EXCEPTION, $message);
+
+ Kernel::exceptionHandler($exception);
+ }//errorHandler
+
+
+ /**
+ * Catch a exception and manage it with a internal process
+ * @param Exception $exception Catched exception
+ * @since 0.3
+ */
+ public static function exceptionHandler(Exception $exception) {
+ $debug = false;
+
+ try {
+ $document = new XmlDocument();
+ $document->loadXmlFile('/config/web.xml');
+ $debug = $document->selectSingleNode('/Web/Config/Debug/@activate');
+
+ if($debug == 'true') {
+ $debug = true;
+ } else {
+ $debug = false;
+ }
+ } catch(Exception $ex) {
+ $debug = false;
+ }
+
+ $servlet = new HttpServlet();
+ $servlet->setDebug($debug);
+ $servlet->processException($exception);
+
+ echo $servlet->getOut();
+ die;
+ }//exceptionHandler
+}//Kernel
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/Object.php Wed Nov 2 14:09:30 2011
@@ -0,0 +1,171 @@
+<?php
+/**
+ * Source code of Object class
+ * @category puntoengine
+ * @package core
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+
+
+
+/**
+ * Object is a base class of all class of engine and
+ * @category puntoengine
+ * @package servlets
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+class Object {
+ /**
+ * This method is called when unset the object
+ * @since 0.4.0
+ * @todo Implements
+ */
+ public function __destruct() {
+ }//__destruct
+
+
+
+ /**
+ * Default method call
+ * @since 0.4.0
+ * @todo Implements
+ */
+ public function __invoke() {
+ }//__invoke
+
+
+
+ /**
+ * Call when serialize a object to string
+ * @since 0.4.0
+ * @todo Implements
+ */
+ public function __sleep() {
+ }//__sleep
+
+
+
+ /**
+ * Call when unserialize a object from string
+ * @since 0.4.0
+ * @todo Implements
+ */
+ public function __wakeup() {
+ }//__wakeup
+
+
+
+ /**
+ * Clone this class
+ * @return __CLASS__
+ * @since 0.4.0
+ */
+ public function __clone() {
+ return clone($this);
+ }//__clone
+
+
+
+ /**
+ * Override undefined call to a method
+ * @param string $name Name of undefined method
+ * @param array $arguments Params of the method
+ * @since 0.4.0
+ */
+ public function __call($name, $arguments) {
+ }//__call
+
+
+
+ /**
+ * Override undefined set property
+ * @param string $name Property name
+ * @param mixed $value Value to set
+ * @since 0.4.0
+ */
+ public function __set($name, $value) {
+ }//__set
+
+
+
+ /**
+ * Override the get property
+ * @param string $name Property name
+ * @return null
+ * @since 0.4.0
+ */
+ public function __get($name) {
+ return null;
+ }//__get
+
+
+
+ /**
+ * Override the isset function are called againt property of the class
+ * @param string $name Property name
+ * @return bool
+ * @since 0.4.0
+ */
+ public function __isset($name) {
+ return false;
+ }//__isset
+
+
+
+ /**
+ * Override the unset function are called againt property of the class
+ * @param string $name Property name
+ * @since 0.4.0
+ * @todo Implement this method
+ */
+ public function __unset($name) {
+ }//__unset
+
+
+
+ /**
+ * Render the class to a json encoding
+ * @return string
+ * @since 0.4.0
+ */
+ public function toJson() {
+ return json_encode($this);
+ }//toJson
+
+
+
+ /**
+ * Render the class to a string encoding
+ * @return string
+ * @since 0.4.0
+ */
+ public function toString() {
+ return $this->__toString();
+ }//toString
+
+
+
+ /**
+ * Render the class to a string encoding
+ * @return string
+ * @since 0.4.0
+ */
+ public function __toString() {
+ return serialize($this);
+ }//__toString
+
+
+
+ /**
+ * Render the class to a xml encoding
+ * @throws NotImplementedException
+ * @since 0.4.0
+ * @todo Implement this method
+ */
+ public function toXml() {
+ throw new NotImplementedException(__CLASS__ . '::' . __METHOD__);
+ }//toXml
+}//Object
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/admin/AdminController.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Source code of AdminController class controller
+ * @category puntoengine
+ * @package core
+ * @subpackage admin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3
+ */
+
+
+/**
+ * AdminController is a controller class of the default admin
+ * @category puntoengine
+ * @package core
+ * @subpackage admin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3
+ */
+class AdminController extends HttpServlet {
+ protected $master = '/core/admin/template/master.php';
+
+
+ /**
+ * Implement the GET method connection and load the login form
+ * @param HttpRequest $request Page request
+ */
+ protected function processRequest(HttpRequest $request) {
+ if($request->getSession('admin') == 'true') {
+ $this->sendRedirect('~/admin/home');
+ } else {
+ $this->sendRedirect('~/admin/login');
+ }
+ }//doGet
+
+
+ protected function login(HttpRequest $request) {
+ $this->addTemplateSection('content',
$this->addTemplate('/core/admin/template/login.php', $request));
+ }
+
+
+ protected function signup(HttpRequest $request) {
+ $document = new XmlDocument();
+ $document->loadXmlFile('/config/admin.xml');
+
+ try {
+ $admin =
$document->selectSingleNode('/Admin/Users/User[Credentials/@user="'.$request->getParam('user').'"
and Credentials/@pass="'.$request->getParam('pass').'"]');
+
+ if($admin != '') {
+ $request->addSession('admin', 'true');
+ }
+ } catch(Exception $ex) {
+ }
+
+ $this->sendRedirect('~/admin');
+ }
+
+
+ protected function home(HttpRequest $request) {
+ $this->addTemplateSection('content',
$this->addTemplate('/core/admin/template/home.php', $request));
+ }
+}//AdminController
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/admin/template/home.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,5 @@
+<div class="container minibox">
+ <div class="content">
+ <h2>PuntoEngine Administrator</h2>
+ </div>
+</div>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/admin/template/login.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,21 @@
+<div class="container minibox">
+ <div class="content">
+ <form method="post" action="~/admin/signup">
+ <p>
+ <label for="user">User:<br/>
+ <input type="text" name="user" id="user" autocomplete="off" />
+ </label>
+ </p>
+ <p>
+ <label for="pass">Password:<br/>
+ <input type="password" name="pass" id="pass" autocomplete="off" />
+ </label>
+ </p>
+ <div class="float">
+ <div class="right">
+ <input type="submit" name="login" value="Login" />
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/admin/template/master.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" />
+ <title>PuntoEngine - Administrator</title>
+ <link href="~/core/resources/css/admin.css" rel="stylesheet"
type="text/css" media="all" />
+ </head>
+ <body>
+ <header id="header">Administrator</header>
+ <div id="wrapper">
+ <div id="container">
+ <header>
+ <div id="logo" class="minibox center">
+ <img src="~/core/resources/images/logo.png" alt="PuntoEngine"
title="PuntoEngine" />
+ </div>
+ </header>
+ <article>
+ <pep:place name="content" />
+ </article>
+ <footer class="center">
+ <p>PuntoEngine &copy; 2011</p>
+ </footer>
+ </div>
+ </div>
+ </body>
+</html>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/database/Database.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Source code of Database class
+ * @category puntoengine
+ * @package core
+ * @subpackage database
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * Database class are the database connections core class and is the parent
+ * class of all datas class
+ * @category puntoengine
+ * @package core
+ * @subpackage database
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ * @todo Checks posible errors
+ */
+class Database {
+ /**
+ * PHP database connection resource
+ * @var resource
+ * @since 0.1.1
+ */
+ private static $connection;
+
+
+ /**
+ * PHP results of query database resource
+ * @var resource
+ * @since 0.1.1
+ */
+ private $results;
+
+
+ /**
+ * Default constructor, that load the configuration of the database
+ * connection
+ * @since 0.1.1
+ * @final
+ */
+ public function __construct() {
+ if(Database::$connection == null) {
+ $document = new XmlDocument();
+ $document->loadXmlFile('/config/database.xml');
+ $baseXpath = '/Database/Connection/';
+
+ $server = $document->selectSingleNode($baseXpath.'Server');
+ $user = $document->selectSingleNode($baseXpath.'User');
+ $pass = $document->selectSingleNode($baseXpath.'Password');
+ $database = $document->selectSingleNode($baseXpath.'DB');
+
+ $this->connection = mysql_connect($server, $user, $pass);
+ mysql_select_db($database, $this->connection);
+ }
+ }//__construct
+
+
+ /**
+ * Execute a query againts database
+ * @param string $query Query to execute in database
+ * @since 0.1.1
+ */
+ protected function query($query) {
+ $this->results = mysql_query($query, $this->connection);
+ }//query
+
+
+ /**
+ * Execute a fetch to results of the query
+ * @return array Array with the results of the query
+ * @since 0.1.1
+ */
+ protected function fetch() {
+ return mysql_fetch_assoc($this->results);
+ }//fetch
+}//Database
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/exceptions/CoreException.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Source code of CoreException class
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * CoreException as the base exception of puntoengine
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class CoreException extends Exception {
+ /**
+ * Default constructor. Inidates all params to trace the error.
+ * @param int $code Exception code
+ * @param string $message Exception message
+ * @param string $file File who throws the exception
+ * @param int $line Line where generate the error
+ * @param array $context Variables context when the exception was throw
+ * @since 0.1.1
+ */
+ public function __construct($code, $message, $file = null, $line =
null, $context = null) {
+ parent::__construct($message, $code);
+ }//__construct
+}//CoreException
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/exceptions/ExceptionCodes.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Source code of ExceptionCodes class
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * ExceptionCodes is a class who have the constant codes of all exceptions
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class ExceptionCodes {
+ /**
+ * General core exception. Throws if don't have a exception code for
+ * your exception or when throw a undetected error
+ * @since 0.1.1
+ */
+ const CORE_EXCEPTION = 1001;
+
+
+ /**
+ * Not implemented exception. Throws when declare a method, function,
+ * or functionality but it's not implemented yet.
+ * @since 0.1.1
+ */
+ const CORE_NOTIMPLEMENTED = 1002;
+
+
+ /**
+ * Dynamic exception that throws when class not found, for example when
+ * call a servlet and don't exist
+ * @since 0.1.1
+ */
+ const CORE_CLASSNOTFOUND = 1003;
+
+
+ /**
+ * File not found exception. Throws when load a file and it don't
exists
+ * @since 0.1.1
+ */
+ const IO_NOTFOUND = 1101;
+
+
+ /**
+ * Xml exception, when load a node that don't exists
+ * @since 0.1.1
+ */
+ const XML_NODENOTFOUND = 1201;
+}//ExceptionCodes
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/exceptions/IOException.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Source code of IOExcpetion class
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * IOException class is the exception base from input/ouput error same
+ * load a file that not exist, write a file without permissons, etc.
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class IOException extends CoreException {
+ /**
+ * IOException construct
+ * @param int $code Exception code
+ * @param string $file File that have a exception (the file load,
write, etc).
+ * @since 0.1.1
+ */
+ public function __construct($code, $file) {
+ $message = '';
+
+ if($code == ExceptionCodes::IO_NOTFOUND) {
+ $message = 'File not found: '.$file;
+ }
+
+ parent::__construct($code, $message);
+ }//CoreException
+}//IOException
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/exceptions/NotImplementedException.php Wed
Nov 2 14:09:30 2011
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Source code of NotImplementedException class
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * NotImplementedException class is the exception base from not implemented
+ * functionalities in the code
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class NotImplementedException extends CoreException {
+ /**
+ * NotImplementedException construct
+ * @param string $method Method that not implemented yet.
+ * @since 0.1.1
+ */
+ public function __construct($method) {
+ $message = 'Method not implemented: '.$method;
+ $code = ExceptionCodes::CORE_NOTIMPLEMENTED;
+
+ parent::__construct($code, $message);
+ }//__construct
+}//NotImplementedException
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/exceptions/XmlException.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Source code of XmlException class
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * XmlException class is the exception base xml manipulations errors
+ * @category puntoengine
+ * @package core
+ * @subpackage exceptions
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class XmlException extends CoreException {
+ /**
+ * XmlException construct
+ * @param int $code Exception code
+ * @param string $message Exception base message
+ */
+ public function __construct($code, $message) {
+ if($code == ExceptionCodes::XML_NODENOTFOUND) {
+ $message = 'Node not found: '.$message;
+ }
+
+ parent::__construct($code, $message);
+ }//__construct
+}//XmlException
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpController.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Source code of HttpController class
+ * @category puntoengine
+ * @package core
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+
+
+
+/**
+ * HttpController is a base controller class.
+ * The controller who are the request, have a differents methods
+ * to catch the differents types of request and others utilities methods
+ * same throw error, load a template or redirect to other page.
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+class HttpController extends Object {
+ /**
+ * Response for the web request
+ * @var HttpResponse
+ * @since 0.4.0
+ */
+ protected $response;
+
+
+
+ /**
+ * Masterpage for the request
+ * @var string
+ * @since 0.4.0
+ */
+ protected $master;
+
+
+
+ /**
+ * Return the request response
+ * @return HttpResponse Request response
+ * @since 0.4.0
+ */
+ public function getResponse() {
+ return $this->response;
+ }//getResponse
+
+
+
+ /**
+ * Set the response
+ * @param HttpResponse $response Request response
+ * @since 0.4.0
+ */
+ public function setResponse(HttpResponse $response) {
+ $this->response = $response;
+ }//setResponse
+
+
+
+ /**
+ * Return the master page
+ * @return string Master page
+ * @since 0.4.0
+ */
+ public function getMasterPage() {
+ return $this->master;
+ }//getMasterPage
+
+
+
+ /**
+ * Set the master page
+ * @param string Master page
+ * @since 0.4.0
+ */
+ public function setMasterPage($masterpage) {
+ $this->master = $masterpage;
+ }//setMasterPage
+}//HttpController
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpMethods.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Source code of HttpMethods class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * HttpMethods is a enumeration class with the types of the diferent
connection
+ * method at the server via http protocol
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class HttpMethods {
+ /**
+ * GET method is a convencional connection method
+ * @since 0.3
+ */
+ const GET = 'GET';
+ /**
+ * POST method is a form submition connection
+ * @since 0.3
+ */
+ const POST = 'POST';
+ /**
+ * SERVICE method is a xml webservice connection
+ * @since 0.3
+ */
+ const SERVICE = 'SERVICE';
+}//HttpMethods
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpRequest.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Source code of HttpRequest class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * HttpRequest is a request class of the connection process. When a user
+ * connect to a page, all request GET, POST, XML and SESSION parameters is
+ * envolved in this class to access more simply.
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class HttpRequest {
+ /**
+ * Request parameters
+ * @var array
+ * @since 0.3
+ */
+ private $params;
+
+
+ /**
+ * Session parameters
+ * @var array
+ * @since 0.3
+ */
+ private $session;
+
+
+ /**
+ * Returns a param value by the key
+ * @param string $name Key of the param
+ * @return mixed Value of the param
+ * @since 0.3
+ */
+ public function getParam($name) {
+ if(isset($this->params[$name])) {
+ return $this->params[$name];
+ } else {
+ return null;
+ }
+ }//getParam
+
+
+ /**
+ * Set the param array
+ * @param array $params Array of params to stablish in the request
+ * @since 0.3
+ */
+ public function setParams($params) {
+ $this->params = $params;
+ }//setParams
+
+
+ /**
+ * Returns a session param by the key
+ * @param string $name Key of the session param
+ * @return string Value of the session param
+ * @since 0.3
+ */
+ public function getSession($name) {
+ if(isset($this->session[$name])) {
+ return $this->session[$name];
+ } else {
+ return null;
+ }
+ }//getSession
+
+
+ /**
+ * Set the session param array
+ * @param array $session Array of session params to stablish in the
request
+ * @since 0.3
+ */
+ public function setSession($session) {
+ $this->session = $session;
+ }//setSession
+
+
+ /**
+ * Add a new session param
+ * @param string $key Key of the session param
+ * @param string $value Value of the session param
+ * @since 0.3
+ */
+ public function addSession($key, $value) {
+ $this->session[$key] = $value;
+ $_SESSION[$key] = $value;
+ }
+
+
+ /**
+ * Remove a session param
+ * @param string $key Key of the session param to remove it
+ * @since 0.3
+ */
+ public function removeSession($key) {
+ if(isset($this->session[$key])) {
+ unset($this->session[$key]);
+ }
+ if(isset($_SESSION[$key])) {
+ unset($_SESSION[$key]);
+ }
+ }
+
+
+ /**
+ * Add new param
+ * @param string $key Key of the param
+ * @param mixed $value Value of the param
+ * @since 0.3
+ */
+ public function addParam($key, $value) {
+ $this->params[$key] = $value;
+ }
+}//HttpRequest
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpResponse.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,199 @@
+<?php
+/**
+ * Source code of HttpResponse class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+
+
+/**
+ * HttpResponse is a response for the Controller.
+ * HttpResponse can set the response html, cookies, sessions, and any
header
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+class HttpResponse extends Object {
+ /**
+ * Controller name
+ * @var string
+ * @since 0.4.0
+ */
+ protected $controller;
+
+
+ /**
+ * Action name
+ * @var string
+ * @since 0.4.0
+ */
+ protected $action;
+
+
+
+ /**
+ * Master page
+ * @var string
+ * @since 0.4.0
+ */
+ protected $master;
+
+
+
+ /**
+ * Default constructor
+ * @since 0.4.0
+ */
+ public function __construct() {
+ }//__construct
+
+
+
+ /**
+ * Return the controller name
+ * @return string Controller name
+ * @since 0.4.0
+ */
+ public function getController() {
+ return $this->controller;
+ }//getController
+
+
+
+ /**
+ * Set the controller name
+ * @param string $controller Controller name
+ * @since 0.4.0
+ */
+ public function setController($controller) {
+ $this->controller = strtolower($controller);
+ }//setController
+
+
+
+ /**
+ * Return the action name
+ * @return string Action name
+ * @since 0.4.0
+ */
+ public function getAction() {
+ return $this->action;
+ }//getAction
+
+
+
+ /**
+ * Set the action name
+ * @param string $action Action name
+ * @since 0.4.0
+ */
+ public function setAction($action) {
+ $this->action = strtolower($action);
+ }//setAction
+
+
+
+ /**
+ * Return the master page
+ * @return string Master page
+ * @since 0.4.0
+ */
+ public function getMasterPage() {
+ return $this->master;
+ }//getMasterPage
+
+
+
+ /**
+ * Set the master page
+ * @param string Master page
+ * @since 0.4.0
+ */
+ public function setMasterPage($masterpage) {
+ $this->master = $masterpage;
+ }//setMasterPage
+
+
+
+ /**
+ * Process the response and draw or redirect, set the cookies, etc.
+ * @param HttpRequest $request Request page params
+ * @since 0.4.0
+ */
+ public function process(HttpRequest $request) {
+ ob_start();
+ ob_clean();
+
+ $content = $this->processView($request);
+
+ if($this->master != null) {
+ $master = $this->processMasterPage($request, $content);
+ $content = $master;
+ }
+
+ echo $content;
+
+ if(ob_get_length() != 0) {
+ ob_end_flush();
+ }
+ }//process
+
+
+
+ /**
+ * Process the masterpge and the content of the page loading the
dinamic content
+ * @param HttpRequest $request Request page params
+ * @since 0.4.0
+ */
+ protected function processMasterPage(HttpRequest $request, $content) {
+ $master = $this->addTemplate($this->master, $request);
+ preg_match('/<php:place\s*name="content"\s*\/>/', $master, $match);
+
+ $master = str_replace($match[0], $content, $master);
+
+ return $master;
+ }//processMasterPage
+
+
+
+ /**
+ * Process the view of the content of the page loading the dinamic
content
+ * @param HttpRequest $request Request page params
+ * @since 0.4.0
+ */
+ protected function processView(HttpRequest $request) {
+ $content =
$this->addTemplate('/template/'.$this->controller.'/'.$this->action.'.php',
$request);
+
+ return $content;
+ }//processView
+
+
+
+ /**
+ * Add a new template, same a addDispatcher but without static access
+ * @param string $template Template path
+ * @param HttpRequest $request Page request
+ * @return string Template content
+ * @since 0.4.0
+ */
+ protected function addTemplate($template, HttpRequest $request) {
+ if(file_exists(Kernel::getPath().'/template/'.$template)) {
+ include(Kernel::getPath().'/template/'.$template);
+ } elseif(file_exists(Kernel::getPath().$template)) {
+ include(Kernel::getPath().$template);
+ } else {
+ throw new IOException(ExceptionCodes::IO_NOTFOUND, $template);
+ }
+
+ $out = ob_get_contents();
+ ob_clean();
+
+ return $out;
+ }//addTemplate
+}//HttpResponse
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpServlet.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,395 @@
+<?php
+/**
+ * Source code of HttpServlet class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+Kernel::import('core.exceptions');
+
+
+/**
+ * HttpServlet is a class same a Java Servlet with a little modifications.
+ * The Servlet who are the request controller, have a differents methods
+ * to catch the differents types of request and others utilities methods
+ * same throw error, load a template or redirect to other page.
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class HttpServlet {
+ /**
+ * Page output
+ * @var string
+ * @since 0.3
+ */
+ protected $out;
+
+
+ /**
+ * Indicate if engine is in debug mode
+ * @var bool
+ * @since 0.3
+ */
+ protected $debug = false;
+
+
+ /**
+ * Url requested to load this servlet
+ * @var string
+ * @since 0.3
+ */
+ protected $url;
+
+
+ /**
+ * Indicate the master template to load the base content
+ * @var string
+ * @since 0.3
+ */
+ protected $master;
+
+
+ /**
+ * Sections of page to add the content dinamicly to this sections
+ * @var array
+ * @since 0.3
+ */
+ protected $templateSections;
+
+
+ /**
+ * Name of action to execute by the servlet
+ * @var string
+ * @since 0.3
+ */
+ protected $action;
+
+
+ /**
+ * Return the current page output
+ * @return string Page output
+ * @since 0.3
+ */
+ public function getOut() {
+ return $this->out;
+ }//getOut
+
+
+ /**
+ * Set the action to execute by the servlet
+ * @param string $action Action to execute
+ * @since 0.3
+ */
+ public function setAction($action) {
+ $this->action = $action;
+ }//setAction
+
+
+ /**
+ * Set if the engine is in debug mode
+ * @param bool $debug Engine are in debug mode
+ * @since 0.3
+ */
+ public function setDebug($debug) {
+ $this->debug = $debug;
+ }//setDebug
+
+
+ /**
+ * Set the request url
+ * @param string $url Request url
+ * @since 0.3
+ */
+ public function setUrl($url) {
+ $this->url = $url;
+ }//setUrl
+
+
+ /**
+ * Add a new section page content by the key
+ * @param string $key Key of the section page
+ * @param string $value Content of the section page
+ * @since 0.3
+ */
+ public function addTemplateSection($key, $value) {
+ $this->templateSections[$key] = $value;
+ }//addTemplateSection
+
+
+ /**
+ * Initialize the servlet with the request and the type to load the
+ * method controller in the child of servlet
+ * @param HttpRequest $request Page request
+ * @param string $type Method type
+ * @todo Implement the xml service controller
+ * @since 0.3
+ */
+ public function init(HttpRequest $request, $type) {
+ ob_start();
+
+ if($this->action != null && method_exists($this, $this->action)) {
+ call_user_func(array($this, $this->action), $request);
+ } else {
+ if($type == HttpMethods::GET) {
+ $this->doGet($request);
+ } elseif($type == HttpMethods::POST) {
+ $this->doPost($request);
+ } else {
+ $this->processRequest($request);
+ }
+ }
+
+ $this->processMasterPage($request);
+ echo $this->processOutput($this->out);
+
+ if(ob_get_length() != 0) {
+ ob_end_flush();
+ }
+ }//init
+
+
+ /**
+ * Base request controller when don't declare this method in the child
+ * @param HttpRequest $request Page request
+ * @since 0.3
+ */
+ protected function processRequest(HttpRequest $request) {
+ throw new NotImplementedException(__METHOD__);
+ }//processRequest
+
+
+ /**
+ * GET method controller
+ * @param HttpRequest $request Page request
+ * @todo Hook HookTypes::DO_BASE_GET
+ * @since 0.3
+ */
+ protected function doGet(HttpRequest $request) {
+ $this->processRequest($request);
+ }//doGet
+
+
+ /**
+ * POST method controller
+ * @param HttpRequest $request Page request
+ * @todo Hook HookTypes::DO_BASE_POST
+ * @since 0.3
+ */
+ protected function doPost(HttpRequest $request) {
+ $this->processRequest($request);
+ }//doPost
+
+
+ /**
+ * Service xml controller
+ * @todo Implement
+ * @todo Hook HookTypes::DO_BASE_SERVICE
+ * @since 0.3
+ */
+ protected function doService() {
+ throw new NotImplementedException(__METHOD__);
+ }//doService
+
+
+ /**
+ * Set the request dispatcher
+ * @param string $dispatcher File dispatcher of template
+ * @param HttpRequest $request Page request
+ * @since 0.3
+ */
+ protected function setRequestDispatcher($dispatcher, HttpRequest
$request) {
+ HttpServlet::addDispatcher($dispatcher, $request);
+ }//setRequestDispatcher
+
+
+ /**
+ * Add a dispatcher template
+ * @param string $dispatcher File dispatcher of template
+ * @param HttpRequest $request
+ * @deprecated Deprecated since version 0.2
+ * @since 0.2
+ */
+ public static function addDispatcher($dispatcher, HttpRequest
$request) {
+ if(file_exists($dispatcher)) {
+ include(Kernel::getPath().$dispatcher);
+ } elseif(file_exists(Kernel::getPath().$dispatcher)) {
+ include(Kernel::getPath().$dispatcher);
+ } else {
+ throw new IOException(ExceptionCodes::IO_NOTFOUND, $dispatcher);
+ }
+ }//addDispatcher
+
+
+ /**
+ * Add a new template, same a addDispatcher but without static access
+ * @param string $template Template path
+ * @param HttpRequest $request Page request
+ * @return string Template content
+ * @since 0.3
+ */
+ protected function addTemplate($template, HttpRequest $request) {
+ if(file_exists($template)) {
+ include(Kernel::getPath().$template);
+ } elseif(file_exists(Kernel::getPath().$template)) {
+ include(Kernel::getPath().$template);
+ } else {
+ throw new IOException(ExceptionCodes::IO_NOTFOUND, $template);
+ }
+
+ $out = ob_get_contents();
+ ob_clean();
+
+ return $out;
+ }//addTemplate
+
+
+ /**
+ * Process the masterpge and the content of the page loading the
dinamic content
+ * @param HttpRequest $request Request page params
+ * @since 0.3
+ */
+ protected function processMasterPage(HttpRequest $request) {
+ if($this->master != null) {
+ $this->out = $this->addTemplate($this->master, $request);
+ }
+
+ preg_match_all('/\<pep:place(.*)\/\>/Usi', $this->out, $pepPlaces);
+
+ for($i = 0; $i < count($pepPlaces[1]); $i++) {
+ preg_match_all('/([a-z]*)="(.*)"/Usi', $pepPlaces[1][$i], $pepPlace);
+
+ for($j = 0; $j < count($pepPlace[1]); $j++) {
+ if($pepPlace[1][$j] == 'name') {
+ if(isset($this->templateSections[$pepPlace[2][$j]])) {
+ $this->out = str_replace($pepPlaces[0][$i],
$this->templateSections[$pepPlace[2][$j]], $this->out);
+ break;
+ }
+ } else if($pepPlace[1][$j] == 'include') {
+ $tempOut = $this->addTemplate($pepPlace[2][$j], $request);
+ $this->out = str_replace($pepPlaces[0][$i], $tempOut, $this->out);
+ break;
+ }
+ }
+ }
+ }//processMasterPage
+
+
+ /**
+ * Post process output to change for example the path in links ~/ for
the project path
+ * @param string $output Page output
+ * @return string Post formated output
+ * @since 0.3
+ */
+ protected function processOutput($output) {
+ $path = Kernel::getVirtualPath();
+
+ if($path == '/') {
+ $path = '';
+ }
+
+ $output = str_replace('~/', $path.'/', $output);
+
+ return $output;
+ }//processOutput
+
+
+ /**
+ * Redirect the request to other url
+ * @param string $url Url to redirect the page
+ * @todo Implement the 301 redirect
+ * @todo Hook HookTypes::SEND_REDIRECT
+ * @since 0.3
+ */
+ protected function sendRedirect($url) {
+ if(substr($url, 0, 2) == '~/') {
+ $url = str_replace('~/', Kernel::getVirtualPath().'/', $url);
+ }
+
+ header('Location: '.$url);
+ }//sendRedirect
+
+
+ /**
+ * Proccess a exception in the servlet to load a default exception page
+ * @param CoreException $exception Exception to draw a error page
+ * @todo Hook HookTypes::CALL_PROCESS_EXCEPTION
+ * @since 0.3
+ */
+ public function processException(CoreException $exception) {
+
PluginManager::instance()->executeHook(HookTypes::CALL_PROCESS_EXCEPTION,
array('exception' => $exception));
+
+ $exceptionType = 'Exception';
+
+ switch($exception->getCode()) {
+ case ExceptionCodes::CORE_EXCEPTION:
+ $exceptionType = 'core.exception.CoreException';
+ break;
+ case ExceptionCodes::CORE_NOTIMPLEMENTED:
+ $exceptionType = 'core.exception.NotImplementedException';
+ break;
+ case ExceptionCodes::CORE_NOTIMPLEMENTED:
+ $exceptionType = 'core.exception.ClassNotFound';
+ break;
+ case ExceptionCodes::IO_NOTFOUND:
+ $exceptionType = 'core.exception.IOException';
+ break;
+ case ExceptionCodes::XML_NODENOTFOUND:
+ $exceptionType = 'core.exception.XmlException';
+ break;
+ default:
+ $exceptionType = 'php.Exception';
+ break;
+ }
+
+ $trace = $exception->getTrace();
+
+ $body = '<h1 class="title">Core error - status 500</h1>'."\n";
+ $body .= '<hr/>'."\n";
+ $body .= '<p><span class="title">type</span> Exception report</p>'."\n";
+ $body .= '<p><span
class="title">message</span> '.$exception->getMessage().'</p>'."\n";
+ $body .= '<p><span
class="title">exception</span> '.$exceptionType.'</p>'."\n";
+ $body .= '<p><span class="title">cause</span><br/>'."\n";
+
+ for($i = 0; $i < count($trace); $i++) {
+ $line = '';
+
+ if(isset($trace[$i - 1]['line'])) {
+ $line = '('.$trace[$i - 1]['line'].')';
+ }
+
+
$body .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$trace[$i]['class'].$trace[$i]['type'].$trace[$i]['function'].$line.'<br/>'."\n";
+ }
+
+ if($this->debug == true) {
+ $body .= '<p><span class="title">trace</span>'."\n";
+ $body .= '<pre>'.$exception->getTraceAsString().'</pre>';
+ $body .= '</p>'."\n";
+ }
+
+ $body .= '</p>'."\n";
+ $body .= '<p><span class="title">note</span> The full stack trace of the
cause is available in the PuntoEngine Server/'.Kernel::VERSION.'
logs</p>'."\n";
+ $body .= '<hr/>'."\n";
+ $body .= '<h2 class="title">Punto Engine
Server/'.Kernel::VERSION.'</h2>'."\n";
+
+ $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
+ $html .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"
lang="es-ES">'."\n";
+ $html .= '<head profile="http://gmpg.org/xfn/11">'."\n";
+ $html .= '<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />'."\n";
+ $html .= '<title>Core exception</title>'."\n";
+ $html .= '<link
href="'.Kernel::getVirtualPath().'/core/resources/css/exception.css"
class="theme" rel="stylesheet" media="all" />'."\n";
+ $html .= '</style>'."\n";
+ $html .= '</head>'."\n";
+ $html .= '<body>'."\n";
+ $html .= $body."\n";
+ $html .= '</body>'."\n";
+ $html .= '</html>'."\n";
+
+ $this->out = $html;
+ }//processException
+}//HttpServlet
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/HttpWebConnection.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Source code of HttpWebConnection class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+
+
+/**
+ * HttpRequest is a class to connect same a robot o crawler to other page
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.1.1
+ */
+class HttpWebConnection {
+ /**
+ * Url to connect it
+ * @var string
+ * @since 0.3
+ */
+ private $url;
+
+
+ /**
+ * Useragent to identify the crawler
+ * @since 0.3
+ */
+ private $userAgent = 'puntoengine (crawler)';
+
+
+ /**
+ * Default constructor
+ * @since 0.3
+ */
+ public function __construct() {
+ }//__construct
+
+
+ /**
+ * Set the url to connect it
+ * @param string $url Url to connect the crawler
+ * @since 0.3
+ */
+ public function setUrl($url) {
+ $this->url = $url;
+ }//setUrl
+
+
+ /**
+ * Connect to the url with the data previusly indicated and return the
+ * content of the page connection same a browser
+ * @return string Page result of the connection
+ * @since 0.3
+ */
+ public function connect() {
+ $curlResource = curl_init();
+
+ curl_setopt($curlResource, CURLOPT_URL, $this->url);
+ curl_setopt($curlResource, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curlResource, CURLOPT_USERAGENT, $this->userAgent);
+
+ $response = curl_exec($curlResource);
+
+ curl_close($curlResource);
+
+ return $response;
+ }//connect
+}//HttpWebConnection
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/http/Url.php Wed Nov 2 14:09:30 2011
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Source code of Url class
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+
+
+/**
+ * Url class is a class to content and parse urls for puntoengine
+ * @category puntoengine
+ * @package core
+ * @subpackage http
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.4.0
+ */
+class Url extends Object {
+ /**
+ * Url path
+ * @var string
+ */
+ protected $url;
+
+
+ /**
+ * Diferentes url parth separated in directories
+ * @var array
+ */
+ protected $urlParts;
+
+
+
+ /**
+ * Construct to specified the url to parse
+ * @param string $url Url to parse
+ * @since 0.4.0
+ */
+ public function __construct($url) {
+ $this->url = $url;
+
+ $this->urlParts = explode('/', ((substr($url, 0, 1) == '/') ?
substr($url, 1) : $url));
+
+ unset($url);
+ }//__construct
+
+
+ /**
+ * Return the posibles controllers are content in the url
+ * @return array
+ * @since 0.4.0
+ */
+ public function getControllers() {
+ $controllers = array();
+
+ for($i = count($this->urlParts) - 1; $i >= 0; $i--) {
+ if($i == count($this->urlParts) - 1) {
+ if(isset($this->urlParts[$i - 1]) && strpos($this->urlParts[$i], '.')
=== false && strpos($this->urlParts[$i - 1], '.') === false) {
+ $controllers[] = $this->urlParts[$i - 1].'.'.$this->urlParts[$i];
+ }
+ } else if($i != count($this->urlParts) - 2) {
+ if(isset($this->urlParts[$i + 1]) && strpos($this->urlParts[$i], '.')
=== false && strpos($this->urlParts[$i + 1], '.') === false) {
+ $controllers[] = $this->urlParts[$i].'.'.$this->urlParts[$i + 1];
+ }
+ }
+
+ $controllers[] = $this->urlParts[$i];
+ }
+
+ unset($i);
+
+ return $controllers;
+ }//getControllers
+}//Url
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/plugin/Hook.php Wed Nov 2 14:09:30 2011
@@ -0,0 +1,191 @@
+<?php
+/**
+ * Source code of puntoengine Hook
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+
+
+/**
+ * Hook are a model class for the hooks
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+class Hook {
+ /**
+ * Internal name of the hook (for logs)
+ * @var string
+ * @since 0.3.0
+ */
+ private $name;
+
+
+ /**
+ * Name of plugin who call this hook
+ * @var string
+ * @since 0.3.0
+ */
+ private $plugin;
+
+
+ /**
+ * Creation time of hook object
+ * @var int
+ * @since 0.3.0
+ */
+ private $creationTime;
+
+
+ /**
+ * Execution time of hook process
+ * @var int
+ * @since 0.3.0
+ */
+ private $executionTime;
+
+
+ /**
+ * Callback function who invoke when hook is called
+ * @var mixed
+ * @since 0.3.0
+ */
+ private $callback;
+
+
+ /**
+ * Type of hook
+ * @var string
+ * @see HookTypes
+ * @since 0.3.0
+ */
+ private $hookType;
+
+
+ /**
+ * Return the internal name of hook
+ * @return string Internal name of hook
+ * @since 0.3.0
+ */
+ public function getName() {
+ return $this->name;
+ }//getName
+
+
+ /**
+ * Set the internal name of hook
+ * @param string $name Internal name of hook
+ * @since 0.3.0
+ */
+ public function setName($name) {
+ $this->name = $name;
+ }//setName
+
+
+ /**
+ * Return the name of plugin that create this hook
+ * @return string Name of plugin
+ * @since 0.3.0
+ */
+ public function getPlugin() {
+ return $this->plugin;
+ }//getPlugin
+
+
+ /**
+ * Set the name of plugin that create this hook
+ * @param string $plugin Name of plugin
+ * @since 0.3.0
+ */
+ public function setPlugin($plugin) {
+ $this->plugin = $plugin;
+ }//setPlugin
+
+
+ /**
+ * Return the creation time of hook
+ * @return int Creation time of hook
+ * @since 0.3.0
+ */
+ public function getCreationTime() {
+ return $this->creationTime;
+ }//getCreationTime
+
+
+ /**
+ * Set the creation time of hook
+ * @param int $creationTime Creation time of hook
+ * @since 0.3.0
+ */
+ public function setCreationTime($creationTime) {
+ $this->creationTime = $creationTime;
+ }//setCreationTime
+
+
+ /**
+ * Return the execution time of hook
+ * @return int Execution time of hook
+ * @since 0.3.0
+ */
+ public function getExecutionTime() {
+ return $this->executionTime;
+ }//getExecutionTime
+
+
+ /**
+ * Set the execution time of hook
+ * @param int $executionTime Execution time of hook
+ * @since 0.3.0
+ */
+ public function setExecutionTime($executionTime) {
+ $this->executionTime = $executionTime;
+ }//setExecutionTime
+
+
+ /**
+ * Return the callback object
+ * @return mixed Callback object
+ * @since 0.3.0
+ */
+ public function getCallback() {
+ return $this->callback;
+ }//getCallback
+
+
+ /**
+ * Set the callback object
+ * @param mixed $callback Callback object
+ * @since 0.3.0
+ */
+ public function setCallback($callback) {
+ $this->callback = $callback;
+ }//setCallback
+
+
+ /**
+ * Return the type of this hook
+ * @return string Type of hook
+ * @see HookTypes
+ * @since 0.3.0
+ */
+ public function getHookType() {
+ return $this->hookType;
+ }//getHookType
+
+
+ /**
+ * Set the type of hook
+ * @param string $hookType
+ * @see HookTypes
+ * @since 0.3.0
+ */
+ public function setHookType($hookType) {
+ $this->hookType = $hookType;
+ }//setHookType
+}//Hook
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/plugin/HookTypes.php Wed Nov 2 14:09:30
2011
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Source code of puntoengine HookTypes
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+
+
+/**
+ * HookTypes are a constants used same a enumerator
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+class HookTypes {
+ /**
+ * Hook launched in the last process of exception (when draw the error
page)
+ * @since 0.3
+ */
+ const CALL_PROCESS_EXCEPTION = 'CALL_PROCESS_EXCEPTION';
+
+
+ /**
+ * Hook launched when redirect
+ * @since 0.3
+ */
+ const CALL_SEND_REDIRECT = 'CALL_SEND_REDIRECT';
+
+
+ /**
+ * Hook launched when not implemented the GET request and his is called
+ * @since 0.3
+ */
+ const CALL_DO_BASE_GET = 'CALL_DO_BASE_GET';
+
+
+ /**
+ * Hook launched when not implemented the POST request and his is called
+ * @since 0.3
+ */
+ const CALL_DO_BASE_POST = 'CALL_DO_BASE_POST';
+
+
+ /**
+ * Hook launched when not implemented the SERVICE request and his is
called
+ * @since 0.3
+ */
+ const CALL_DO_BASE_SERVICE = 'CALL_DO_BASE_SERVICE';
+}//HookTypes
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/plugin/Plugin.php Wed Nov 2 14:09:30 2011
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Source code of puntoengine Plugin Base class
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+
+
+/**
+ * Plugin base of the puntoengine application who extends all plugins
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+abstract class Plugin {
+ /**
+ * List of hooks
+ * @var array
+ */
+ protected $hookList = array();
+
+
+ /**
+ * Default constructor
+ */
+ public function __construct() {
+ }//__construct
+
+
+ /**
+ * Return all declared hooks
+ */
+ public function getHookList() {
+ return $this->hookList;
+ }//getHookList
+
+
+ /**
+ * Define in the childs all available hooks
+ */
+ abstract public function declareHooks();
+}//Plugin
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/plugin/PluginManager.php Wed Nov 2
14:09:30 2011
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Source code of puntoengine PluginManager
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+
+
+/**
+ * PluginManager are a class to manage the diferents hooks in the
framework to
+ * are catched by plugins loaded
+ * @category puntoengine
+ * @package core
+ * @subpackage plugin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3.0
+ */
+class PluginManager {
+ /**
+ * List of all loaded hooks
+ * @var array<Hook>
+ * @since 0.3
+ */
+ private $hookList = array();
+
+
+ /**
+ * Singleton instance of HookManager
+ * @var PluginManager
+ * @since 0.3
+ */
+ private static $instance;
+
+
+ /**
+ * Private contruct for singleton
+ * @since 0.3
+ */
+ private function __construct() {
+ }//__construct
+
+
+ /**
+ * Return the unique (singleton) instance of class PluginManager
+ * @return PluginManager Instance of PluginManager
+ * @since 0.3
+ */
+ public static function instance() {
+ if(self::$instance == null) {
+ self::$instance = new PluginManager();
+ }
+
+ return self::$instance;
+ }//instance
+
+
+ /**
+ * Add a new hook to PluginManager
+ * @param Hook $hook New hook
+ * @since 0.3
+ */
+ public function addHook(Hook $hook) {
+ $this->hookList[$hook->getHookType()][] = $hook;
+ }//addHook
+
+
+ /**
+ * Execute any hooks of this type
+ * @param string $hookType Type of hook
+ * @param array $data Parameters in a array
+ * @return mixed Modified result
+ * @see HookTypes
+ * @since 0.3
+ */
+ public function executeHook($hookType, $parameters) {
+ if(isset($this->hookList[$hookType])) {
+ for($i = 0; $i < count($this->hookList[$hookType]); $i++) {
+ $data['results'] =
call_user_func_array($this->hookList[$hookType][$i]->getCallback(),
$parameters);
+ }
+ }
+
+ if(isset($data['results'])) {
+ return $data['results'];
+ } else {
+ return null;
+ }
+ }//executeHook
+}//HookManager
+?>
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/resources/css/admin.css Wed Nov 2
14:09:30 2011
@@ -0,0 +1,95 @@
+body {
+ background-color: #f9f9f9;
+ margin: 0px;
+ padding: 0px;
+ font-family: Arial;
+ font-size: 64.5%;
+}
+
+a {
+ color: #f47c01;
+}
+
+#header {
+ width: 100%;
+ height: 32px;
+ background: url('../images/titlebar.png') repeat-x;
+ line-height: 32px;
+ font-size: 1.3em;
+ font-weight: bold;
+ color: #bebebe;
+ text-align: center;
+}
+
+#wrapper {
+ width: 850px;
+ margin: 20px auto 20px auto;
+ color: #444444;
+}
+
+.container {
+ border-radius: 7px;
+ background: #ffffff;
+ -webkit-box-shadow: #cccccc 2px 2px 10px;
+ color: #767875;
+}
+
+.content {
+ margin: 10px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+.minibox {
+ width: 350px;
+ margin: 0px auto 0px auto;
+}
+
+.center {
+ text-align: center;
+}
+
+.float {
+ overflow: hidden;
+}
+
+.left {
+ float: left;
+}
+
+.right {
+ float: right;
+}
+
+label {
+ font-size: 1.4em;
+ font-weight: bold;
+}
+
+label.normal {
+ font-size: 1.2em;
+ font-weight: normal;
+}
+
+input {
+ width: 100%;
+ background-color: #fbfbfb;
+ border: solid 1px #e5e5e5;
+ font-size: 1.5em;
+ color: #767875;
+}
+
+input[type="checkbox"] {
+ width: auto;
+}
+
+input[type="submit"] {
+ border: solid 1px #000000;
+ border-radius: 30px;
+ line-height: 24px;
+ color: #ffffff;
+ background: #2e2e2e url('../images/black-button.png') repeat-x;
+ padding-right: 10px;
+ padding-left: 10px;
+ cursor: pointer;
+}
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/resources/css/exception.css Wed Nov 2
14:09:30 2011
@@ -0,0 +1,12 @@
+@CHARSET "UTF-8";
+body {
+ font-family: sans-serif; font-size: 14px;
+}
+
+.title {
+ background: #006699; color: #ffffff;
+}
+
+hr {
+ border: solid 1px #000000;
+}
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/resources/images/black-button.png Wed Nov
2 14:09:30 2011
@@ -0,0 +1,8 @@
+‰PNG
+
+
+IHDR 6Òç sBIT | dˆ pHYs ÒÝ~ü
+tEXtSoftware Adobe Fireworks CS5qµã6 tEXtCreation
Time 29/6/11ò¸Œ½ „IDAT(‘•’K 1 CŸ#®˜ûŸ$ÐEEš™ºª&»Èøƒ
+æœ% ÷¢ª, ’ÈL
+;2 §°A+{ %m•¯@ý—ô‡é<{àY Óû™l7 k-Ë´ž*èÍ£Ö ¬ñö³%œ
+Er­Où©Ð êP?/á²çYøöì´Ž ™É ß C¬òå¿ ­xsÛÏfNû IEND®B`‚
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/resources/images/logo.png Wed Nov 2
14:09:30 2011
Binary file, no diff available.
=======================================
--- /dev/null
+++ /tags/puntoengine_0.4.0/core/resources/images/titlebar.png Wed Nov 2
14:09:30 2011
@@ -0,0 +1,5 @@
+‰PNG
+
+
+IHDR q %¬—‚ sBIT | dˆ
pHYs ÒÝ~ü tEXtSoftware Macromedia Fireworks
8µhÒx tEXtCreation Time 06/27/11ô ¸T ŠIDATh íÖÁ
+ ! DÑeCÕÖëÝ Ô"8 þ«€d2@Œ1Χ§ÅœÓ —ç˜áëþî Tg l"€M °‰ 6 À& ØD › `ˆ † àM 0D ×)€! "€7 À \§ 6
#¢{ åÞ»{ y ÀÇ À& "€ë
×ZÝ3¨è • 0 é êù IEND®B`‚
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages