New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.3.0 #47

Merged
merged 74 commits into from Sep 25, 2016
Commits
Jump to file or symbol
Failed to load files and symbols.
+18,183 −15,252
Diff settings

Always

Just for now

Copy path View file
@@ -5,4 +5,8 @@ composer.phar
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
# composer.lock
### PHPUnit Tests
/tests/temp/cache/
/tests/temp/compiled/
Copy path View file
@@ -1,3 +1,27 @@
## 1.3.0 (2016-09-25)
`Added`
* Add namespaces.
* Add new PHPDoc block **Copyright** for each files.
`Changed`
* Follows [PHP Coding Standards Fixer](http://cs.sensiolabs.org/).
* Refactoring code, following [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) Standard.
* Follows PSR-1: Basic Coding Standard.
* Follows PSR-2: Cosing Style Guide.
* Follows PSR-4: Autoloader Standard instead of PSR-0.
* Update **README** examples with namespace.
* Move all plugins from `plugins/builtin` to `Dwoo/Plugins`.
* Processor `smarty_compat` become `PluginSmartyCompatible`.
* All plugins **functions** and **classes** names MUST start with `Plugin` keyword.
* All plugins filename MUST have the same name as the **function** or **class**.
* Plugins name changed from **underscore_case** to **CamelCase** (e.g. `Dwoo_Plugin_assign_compile` is now `PluginAssignCompile`).
* Helper `Dwoo_Plugin_array_compile` move to `Dwoo\Plugins\Helpers\PluginArrayCompile`.
`Removed`
* Delete `Dwoo` class, now you need to use: `new Dwoo\Core()`.
* Delete method `Dwoo\Core::output()`, use now `echo Dwoo\Core::get()` method.
* Last parameter `$_output` of `Dwoo\Core::get()` method has been removed, use `echo Dwoo\Core::get()` instead.
## 1.2.3 (2016-09-15)
`Added`
* Continuously integrated **Travis** config file.
@@ -15,7 +39,7 @@
* Fix return statements in correlation with PHPDoc.
`Deprecated`
* Method `Dwoo\Core::output()` is now deprecated, will be removed in **1.3.0**.
* Method `Dwoo_Core::output()` is now deprecated, will be removed in **1.3.0**.
## 1.2.2 (2016-09-10)
`Added`
@@ -31,6 +55,7 @@
* Support for Composer, adding `composer.json` file.
`Changed`
* Follows PSR-0: Autoloader Standard.
* Minimum PHP version required is now **PHP 5.3**
`Deprecated`
Copy path View file
25 LICENSE

This file was deleted.

Oops, something went wrong.
Copy path View file
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Copy path View file
@@ -1,5 +1,11 @@
WHAT IS DWOO? [![Build Status](https://travis-ci.org/dwoo-project/dwoo.svg?branch=1.2)](https://travis-ci.org/dwoo-project/dwoo) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/dwoo-project/dwoo/badges/quality-score.png?b=1.2)](https://scrutinizer-ci.com/g/dwoo-project/dwoo/?branch=1.2)
=============
Dwoo
====
[![Latest Stable Version](https://poser.pugx.org/dwoo/dwoo/v/stable?format=flat-square)](https://packagist.org/packages/dwoo/dwoo)
[![Total Downloads](https://poser.pugx.org/dwoo/dwoo/downloads?format=flat-square)](https://packagist.org/packages/dwoo/dwoo)
[![License](https://poser.pugx.org/dwoo/dwoo/license?format=flat-square)](https://packagist.org/packages/dwoo/dwoo)
[![Build Status](https://travis-ci.org/dwoo-project/dwoo.svg?branch=1.2)](https://travis-ci.org/dwoo-project/dwoo)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/dwoo-project/dwoo/badges/quality-score.png?b=1.2)](https://scrutinizer-ci.com/g/dwoo-project/dwoo/?branch=1.2)
Dwoo is a PHP5/PHP7 Template Engine that was started in early 2008. The idea came
from the fact that Smarty, a well known template engine, is getting older and
older. It carries the weight of it's age, having old features that are
@@ -12,9 +18,9 @@ So far it has proven to be faster than Smarty in many areas, and it provides
a compatibility layer to allow developers that have been using Smarty for
years to switch their application over to Dwoo progressively.
> ⚠ Dwoo **1.2.x** is only compatible with **PHP 5.x**
> ⚠ Dwoo **1.3.x** is only compatible from **PHP 5.3.x** to **PHP 5.6.x**
DOCUMENTATION
Documentation
=============
Dwoo's website to get the latest version is at http://dwoo.org/
The wiki/documentation pages are available at http://dwoo.org/documentation/
@@ -25,38 +31,36 @@ Requirements
* PHP <= **7.0**
* [Multibyte String](http://php.net/manual/en/book.mbstring.php)
LICENSE
License
=======
Dwoo is released under the [Modified BSD](./LICENSE) license.
See the LICENSE file included in the archive or go to the URL below to obtain
a copy.
Dwoo is released under the [GNU LESSER GENERAL PUBLIC LICENSE V3](./LICENSE.md) license.
QUICK START - RUNNING DWOO
Quick start - Running Dwoo
==========================
Basic Example
-------------
```php
<?php
// Include the main class (it should handle the rest on its own)
require 'vendor/autoload.php';
require __DIR__ . '/vendor/autoload.php';
// Create the controller, this is reusable
$dwoo = new Dwoo();
$dwoo = new Dwoo\Core();
// Load a template file (name it as you please), this is reusable
// if you want to render multiple times the same template with different data
$tpl = new Dwoo_Template_File('path/to/index.tpl');
$tpl = new Dwoo\Template\File('path/to/index.tpl');
// Create a data set, if you don't like this you can directly input an
// associative array in $dwoo->output()
$data = new Dwoo_Data();
// associative array in $dwoo->get()
$data = new Dwoo\Data();
// Fill it with some data
$data->assign('foo', 'BAR');
$data->assign('bar', 'BAZ');
// Outputs the result ...
$dwoo->output($tpl, $data);
echo $dwoo->get($tpl, $data);
// ... or get it to use it somewhere else
$dwoo->get($tpl, $data);
```
@@ -68,17 +72,18 @@ Loop Example
// To loop over multiple articles of a blog for instance, if you have a
// template file representing an article, you could do the following :
require 'vendor/autoload.php';
require __DIR__ . '/vendor/autoload.php';
$dwoo = new Dwoo();
$tpl = new Dwoo_Template_File('path/to/article.tpl');
$dwoo = new Dwoo\Core();
$tpl = new Dwoo\Template\File('path/to/article.tpl');
$pageContent = '';
$articles = array();
// Loop over articles that have been retrieved from the DB
foreach($articles as $article) {
// Either associate variables one by one
$data = new Dwoo_Data();
$data = new Dwoo\Data();
$data->assign('title', $article['title']);
$data->assign('content', $article['content']);
$pageContent .= $dwoo->get($tpl, $data);
Copy path View file
@@ -2,18 +2,23 @@
"name": "dwoo/dwoo",
"license": "LGPL",
"type": "library",
"description": "Dwoo is a PHP5 template engine which is (almost) fully compatible with Smarty templates and plugins, but is written from scratch for PHP5, and adds many features.",
"description": "Dwoo is a PHP5/PHP7 template engine which is (almost) fully compatible with Smarty templates and plugins, but is written from scratch for PHP5, and adds many features.",
"authors": [
{
"name": "David Sanchez",
"email": "david38sanchez@gmail.com"
}
],
"autoload": {
"psr-0": {
"": "lib/"
"psr-4": {
"Dwoo\\": "lib/Dwoo/"
}
},
},
"autoload-dev": {
"psr-4": {
"Dwoo\\Tests\\": "tests/"
}
},
"require": {
"php": ">=5.3"
},
Copy path View file

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.