Plugin Directory

Changeset 1463492


Ignore:
Timestamp:
07/29/2016 10:09:21 PM (10 years ago)
Author:
wellhandled
Message:

Release 1.5

Location:
well-handled/trunk
Files:
32 added
1 deleted
15 edited
3 copied

Legend:

Unmodified
Added
Removed
  • well-handled/trunk/.lib/composer/LICENSE

    r1387766 r1463492  
    1 
    2 Copyright (c) 2015 Nils Adermann, Jordi Boggiano
    3 
    4 Permission is hereby granted, free of charge, to any person obtaining a copy
    5 of this software and associated documentation files (the "Software"), to deal
    6 in the Software without restriction, including without limitation the rights
    7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    8 copies of the Software, and to permit persons to whom the Software is furnished
    9 to do so, subject to the following conditions:
    10 
    11 The above copyright notice and this permission notice shall be included in all
    12 copies or substantial portions of the Software.
    13 
    14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    20 THE SOFTWARE.
    21 
     1Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
     2Upstream-Name: Composer
     3Upstream-Contact: Jordi Boggiano <[email protected]>
     4Source: https://github.com/composer/composer
     5
     6Files: *
     7Copyright: 2016, Nils Adermann <[email protected]>
     8           2016, Jordi Boggiano <[email protected]>
     9License: Expat
     10
     11Files: res/cacert.pem
     12Copyright: 2015, Mozilla Foundation
     13License: MPL-2.0
     14
     15Files: src/Composer/Util/RemoteFilesystem.php
     16       src/Composer/Util/TlsHelper.php
     17Copyright: 2016, Nils Adermann <[email protected]>
     18           2016, Jordi Boggiano <[email protected]>
     19           2013, Evan Coury <[email protected]>
     20License: Expat and BSD-2-Clause
     21
     22License: BSD-2-Clause
     23 Redistribution and use in source and binary forms, with or without modification,
     24 are permitted provided that the following conditions are met:
     25 .
     26     * Redistributions of source code must retain the above copyright notice,
     27       this list of conditions and the following disclaimer.
     28 .
     29     * Redistributions in binary form must reproduce the above copyright notice,
     30       this list of conditions and the following disclaimer in the documentation
     31       and/or other materials provided with the distribution.
     32 .
     33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
     34 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     35 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     36 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
     37 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     38 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     39 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
     40 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     41 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     42 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     43
     44License: Expat
     45 Permission is hereby granted, free of charge, to any person obtaining a copy
     46 of this software and associated documentation files (the "Software"), to deal
     47 in the Software without restriction, including without limitation the rights
     48 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     49 copies of the Software, and to permit persons to whom the Software is furnished
     50 to do so, subject to the following conditions:
     51 .
     52 The above copyright notice and this permission notice shall be included in all
     53 copies or substantial portions of the Software.
     54 .
     55 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     56 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     57 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     58 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     59 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     60 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     61 THE SOFTWARE.
     62
     63License: MPL-2.0
     64 1. Definitions
     65 --------------
     66 .
     67 1.1. "Contributor"
     68     means each individual or legal entity that creates, contributes to
     69     the creation of, or owns Covered Software.
     70 .
     71 1.2. "Contributor Version"
     72     means the combination of the Contributions of others (if any) used
     73     by a Contributor and that particular Contributor's Contribution.
     74 .
     75 1.3. "Contribution"
     76     means Covered Software of a particular Contributor.
     77 .
     78 1.4. "Covered Software"
     79     means Source Code Form to which the initial Contributor has attached
     80     the notice in Exhibit A, the Executable Form of such Source Code
     81     Form, and Modifications of such Source Code Form, in each case
     82     including portions thereof.
     83 .
     84 1.5. "Incompatible With Secondary Licenses"
     85     means
     86 .
     87     (a) that the initial Contributor has attached the notice described
     88         in Exhibit B to the Covered Software; or
     89 .
     90     (b) that the Covered Software was made available under the terms of
     91         version 1.1 or earlier of the License, but not also under the
     92         terms of a Secondary License.
     93 .
     94 1.6. "Executable Form"
     95     means any form of the work other than Source Code Form.
     96 .
     97 1.7. "Larger Work"
     98     means a work that combines Covered Software with other material, in
     99     a separate file or files, that is not Covered Software.
     100 .
     101 1.8. "License"
     102     means this document.
     103 .
     104 1.9. "Licensable"
     105     means having the right to grant, to the maximum extent possible,
     106     whether at the time of the initial grant or subsequently, any and
     107     all of the rights conveyed by this License.
     108 .
     109 1.10. "Modifications"
     110     means any of the following:
     111 .
     112     (a) any file in Source Code Form that results from an addition to,
     113         deletion from, or modification of the contents of Covered
     114         Software; or
     115 .
     116     (b) any new file in Source Code Form that contains any Covered
     117         Software.
     118 .
     119 1.11. "Patent Claims" of a Contributor
     120     means any patent claim(s), including without limitation, method,
     121     process, and apparatus claims, in any patent Licensable by such
     122     Contributor that would be infringed, but for the grant of the
     123     License, by the making, using, selling, offering for sale, having
     124     made, import, or transfer of either its Contributions or its
     125     Contributor Version.
     126 .
     127 1.12. "Secondary License"
     128     means either the GNU General Public License, Version 2.0, the GNU
     129     Lesser General Public License, Version 2.1, the GNU Affero General
     130     Public License, Version 3.0, or any later versions of those
     131     licenses.
     132 .
     133 1.13. "Source Code Form"
     134     means the form of the work preferred for making modifications.
     135 .
     136 1.14. "You" (or "Your")
     137     means an individual or a legal entity exercising rights under this
     138     License. For legal entities, "You" includes any entity that
     139     controls, is controlled by, or is under common control with You. For
     140     purposes of this definition, "control" means (a) the power, direct
     141     or indirect, to cause the direction or management of such entity,
     142     whether by contract or otherwise, or (b) ownership of more than
     143     fifty percent (50%) of the outstanding shares or beneficial
     144     ownership of such entity.
     145 .
     146 2. License Grants and Conditions
     147 --------------------------------
     148 .
     149 2.1. Grants
     150 .
     151 Each Contributor hereby grants You a world-wide, royalty-free,
     152 non-exclusive license:
     153 .
     154 (a) under intellectual property rights (other than patent or trademark)
     155     Licensable by such Contributor to use, reproduce, make available,
     156     modify, display, perform, distribute, and otherwise exploit its
     157     Contributions, either on an unmodified basis, with Modifications, or
     158     as part of a Larger Work; and
     159 .
     160 (b) under Patent Claims of such Contributor to make, use, sell, offer
     161     for sale, have made, import, and otherwise transfer either its
     162     Contributions or its Contributor Version.
     163 .
     164 2.2. Effective Date
     165 .
     166 The licenses granted in Section 2.1 with respect to any Contribution
     167 become effective for each Contribution on the date the Contributor first
     168 distributes such Contribution.
     169 .
     170 2.3. Limitations on Grant Scope
     171 .
     172 The licenses granted in this Section 2 are the only rights granted under
     173 this License. No additional rights or licenses will be implied from the
     174 distribution or licensing of Covered Software under this License.
     175 Notwithstanding Section 2.1(b) above, no patent license is granted by a
     176 Contributor:
     177 .
     178 (a) for any code that a Contributor has removed from Covered Software;
     179     or
     180 .
     181 (b) for infringements caused by: (i) Your and any other third party's
     182     modifications of Covered Software, or (ii) the combination of its
     183     Contributions with other software (except as part of its Contributor
     184     Version); or
     185 .
     186 (c) under Patent Claims infringed by Covered Software in the absence of
     187     its Contributions.
     188 .
     189 This License does not grant any rights in the trademarks, service marks,
     190 or logos of any Contributor (except as may be necessary to comply with
     191 the notice requirements in Section 3.4).
     192 .
     193 2.4. Subsequent Licenses
     194 .
     195 No Contributor makes additional grants as a result of Your choice to
     196 distribute the Covered Software under a subsequent version of this
     197 License (see Section 10.2) or under the terms of a Secondary License (if
     198 permitted under the terms of Section 3.3).
     199 .
     200 2.5. Representation
     201 .
     202 Each Contributor represents that the Contributor believes its
     203 Contributions are its original creation(s) or it has sufficient rights
     204 to grant the rights to its Contributions conveyed by this License.
     205 .
     206 2.6. Fair Use
     207 .
     208 This License is not intended to limit any rights You have under
     209 applicable copyright doctrines of fair use, fair dealing, or other
     210 equivalents.
     211 .
     212 2.7. Conditions
     213 .
     214 Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
     215 in Section 2.1.
     216 .
     217 3. Responsibilities
     218 -------------------
     219 .
     220 3.1. Distribution of Source Form
     221 .
     222 All distribution of Covered Software in Source Code Form, including any
     223 Modifications that You create or to which You contribute, must be under
     224 the terms of this License. You must inform recipients that the Source
     225 Code Form of the Covered Software is governed by the terms of this
     226 License, and how they can obtain a copy of this License. You may not
     227 attempt to alter or restrict the recipients' rights in the Source Code
     228 Form.
     229 .
     230 3.2. Distribution of Executable Form
     231 .
     232 If You distribute Covered Software in Executable Form then:
     233 .
     234 (a) such Covered Software must also be made available in Source Code
     235     Form, as described in Section 3.1, and You must inform recipients of
     236     the Executable Form how they can obtain a copy of such Source Code
     237     Form by reasonable means in a timely manner, at a charge no more
     238     than the cost of distribution to the recipient; and
     239 .
     240 (b) You may distribute such Executable Form under the terms of this
     241     License, or sublicense it under different terms, provided that the
     242     license for the Executable Form does not attempt to limit or alter
     243     the recipients' rights in the Source Code Form under this License.
     244 .
     245 3.3. Distribution of a Larger Work
     246 .
     247 You may create and distribute a Larger Work under terms of Your choice,
     248 provided that You also comply with the requirements of this License for
     249 the Covered Software. If the Larger Work is a combination of Covered
     250 Software with a work governed by one or more Secondary Licenses, and the
     251 Covered Software is not Incompatible With Secondary Licenses, this
     252 License permits You to additionally distribute such Covered Software
     253 under the terms of such Secondary License(s), so that the recipient of
     254 the Larger Work may, at their option, further distribute the Covered
     255 Software under the terms of either this License or such Secondary
     256 License(s).
     257 .
     258 3.4. Notices
     259 .
     260 You may not remove or alter the substance of any license notices
     261 (including copyright notices, patent notices, disclaimers of warranty,
     262 or limitations of liability) contained within the Source Code Form of
     263 the Covered Software, except that You may alter any license notices to
     264 the extent required to remedy known factual inaccuracies.
     265 .
     266 3.5. Application of Additional Terms
     267 .
     268 You may choose to offer, and to charge a fee for, warranty, support,
     269 indemnity or liability obligations to one or more recipients of Covered
     270 Software. However, You may do so only on Your own behalf, and not on
     271 behalf of any Contributor. You must make it absolutely clear that any
     272 such warranty, support, indemnity, or liability obligation is offered by
     273 You alone, and You hereby agree to indemnify every Contributor for any
     274 liability incurred by such Contributor as a result of warranty, support,
     275 indemnity or liability terms You offer. You may include additional
     276 disclaimers of warranty and limitations of liability specific to any
     277 jurisdiction.
     278 .
     279 4. Inability to Comply Due to Statute or Regulation
     280 ---------------------------------------------------
     281 .
     282 If it is impossible for You to comply with any of the terms of this
     283 License with respect to some or all of the Covered Software due to
     284 statute, judicial order, or regulation then You must: (a) comply with
     285 the terms of this License to the maximum extent possible; and (b)
     286 describe the limitations and the code they affect. Such description must
     287 be placed in a text file included with all distributions of the Covered
     288 Software under this License. Except to the extent prohibited by statute
     289 or regulation, such description must be sufficiently detailed for a
     290 recipient of ordinary skill to be able to understand it.
     291 .
     292 5. Termination
     293 --------------
     294 .
     295 5.1. The rights granted under this License will terminate automatically
     296 if You fail to comply with any of its terms. However, if You become
     297 compliant, then the rights granted under this License from a particular
     298 Contributor are reinstated (a) provisionally, unless and until such
     299 Contributor explicitly and finally terminates Your grants, and (b) on an
     300 ongoing basis, if such Contributor fails to notify You of the
     301 non-compliance by some reasonable means prior to 60 days after You have
     302 come back into compliance. Moreover, Your grants from a particular
     303 Contributor are reinstated on an ongoing basis if such Contributor
     304 notifies You of the non-compliance by some reasonable means, this is the
     305 first time You have received notice of non-compliance with this License
     306 from such Contributor, and You become compliant prior to 30 days after
     307 Your receipt of the notice.
     308 .
     309 5.2. If You initiate litigation against any entity by asserting a patent
     310 infringement claim (excluding declaratory judgment actions,
     311 counter-claims, and cross-claims) alleging that a Contributor Version
     312 directly or indirectly infringes any patent, then the rights granted to
     313 You by any and all Contributors for the Covered Software under Section
     314 2.1 of this License shall terminate.
     315 .
     316 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
     317 end user license agreements (excluding distributors and resellers) which
     318 have been validly granted by You or Your distributors under this License
     319 prior to termination shall survive termination.
     320 .
     321  ************************************************************************
     322  *                                                                      *
     323  *  6. Disclaimer of Warranty                                           *
     324  *  -------------------------                                           *
     325  *                                                                      *
     326  *  Covered Software is provided under this License on an "as is"       *
     327  *  basis, without warranty of any kind, either expressed, implied, or  *
     328  *  statutory, including, without limitation, warranties that the       *
     329  *  Covered Software is free of defects, merchantable, fit for a        *
     330  *  particular purpose or non-infringing. The entire risk as to the     *
     331  *  quality and performance of the Covered Software is with You.        *
     332  *  Should any Covered Software prove defective in any respect, You     *
     333  *  (not any Contributor) assume the cost of any necessary servicing,   *
     334  *  repair, or correction. This disclaimer of warranty constitutes an   *
     335  *  essential part of this License. No use of any Covered Software is   *
     336  *  authorized under this License except under this disclaimer.         *
     337  *                                                                      *
     338  ************************************************************************
     339 .
     340  ************************************************************************
     341  *                                                                      *
     342  *  7. Limitation of Liability                                          *
     343  *  --------------------------                                          *
     344  *                                                                      *
     345  *  Under no circumstances and under no legal theory, whether tort      *
     346  *  (including negligence), contract, or otherwise, shall any           *
     347  *  Contributor, or anyone who distributes Covered Software as          *
     348  *  permitted above, be liable to You for any direct, indirect,         *
     349  *  special, incidental, or consequential damages of any character      *
     350  *  including, without limitation, damages for lost profits, loss of    *
     351  *  goodwill, work stoppage, computer failure or malfunction, or any    *
     352  *  and all other commercial damages or losses, even if such party      *
     353  *  shall have been informed of the possibility of such damages. This   *
     354  *  limitation of liability shall not apply to liability for death or   *
     355  *  personal injury resulting from such party's negligence to the       *
     356  *  extent applicable law prohibits such limitation. Some               *
     357  *  jurisdictions do not allow the exclusion or limitation of           *
     358  *  incidental or consequential damages, so this exclusion and          *
     359  *  limitation may not apply to You.                                    *
     360  *                                                                      *
     361  ************************************************************************
     362 .
     363 8. Litigation
     364 -------------
     365 .
     366 Any litigation relating to this License may be brought only in the
     367 courts of a jurisdiction where the defendant maintains its principal
     368 place of business and such litigation shall be governed by laws of that
     369 jurisdiction, without reference to its conflict-of-law provisions.
     370 Nothing in this Section shall prevent a party's ability to bring
     371 cross-claims or counter-claims.
     372 .
     373 9. Miscellaneous
     374 ----------------
     375 .
     376 This License represents the complete agreement concerning the subject
     377 matter hereof. If any provision of this License is held to be
     378 unenforceable, such provision shall be reformed only to the extent
     379 necessary to make it enforceable. Any law or regulation which provides
     380 that the language of a contract shall be construed against the drafter
     381 shall not be used to construe this License against a Contributor.
     382 .
     383 10. Versions of the License
     384 ---------------------------
     385 .
     386 10.1. New Versions
     387 .
     388 Mozilla Foundation is the license steward. Except as provided in Section
     389 10.3, no one other than the license steward has the right to modify or
     390 publish new versions of this License. Each version will be given a
     391 distinguishing version number.
     392 .
     393 10.2. Effect of New Versions
     394 .
     395 You may distribute the Covered Software under the terms of the version
     396 of the License under which You originally received the Covered Software,
     397 or under the terms of any subsequent version published by the license
     398 steward.
     399 .
     400 10.3. Modified Versions
     401 .
     402 If you create software not governed by this License, and you want to
     403 create a new license for such software, you may create and use a
     404 modified version of this License if you rename the license and remove
     405 any references to the name of the license steward (except to note that
     406 such modified license differs from this License).
     407 .
     408 10.4. Distributing Source Code Form that is Incompatible With Secondary
     409 Licenses
     410 .
     411 If You choose to distribute Source Code Form that is Incompatible With
     412 Secondary Licenses under the terms of this version of the License, the
     413 notice described in Exhibit B of this License must be attached.
     414 .
     415 Exhibit A - Source Code Form License Notice
     416 -------------------------------------------
     417 .
     418   This Source Code Form is subject to the terms of the Mozilla Public
     419   License, v. 2.0. If a copy of the MPL was not distributed with this
     420   file, You can obtain one at http://mozilla.org/MPL/2.0/.
     421 .
     422 If it is not possible or desirable to put the notice in a particular
     423 file, then You may include the notice in a location (such as a LICENSE
     424 file in a relevant directory) where a recipient would be likely to look
     425 for such a notice.
     426 .
     427 You may add additional accurate notices of copyright ownership.
     428 .
     429 Exhibit B - "Incompatible With Secondary Licenses" Notice
     430 ---------------------------------------------------------
     431 .
     432   This Source Code Form is "Incompatible With Secondary Licenses", as
     433   defined by the Mozilla Public License, v. 2.0.
  • well-handled/trunk/.lib/composer/autoload_namespaces.php

    r1387766 r1463492  
    88return array(
    99    'Parsedown' => array($vendorDir . '/erusev/parsedown'),
    10     'Handlebars' => array($vendorDir . '/voodoophp/handlebars/src'),
     10    'Handlebars' => array($vendorDir . '/xamin/handlebars.php/src'),
    1111    'ForceUTF8\\' => array($vendorDir . '/neitanod/forceutf8/src'),
    1212);
  • well-handled/trunk/.lib/composer/installed.json

    r1387766 r1463492  
    126126    },
    127127    {
    128         "name": "symfony/css-selector",
    129         "version": "v3.0.3",
    130         "version_normalized": "3.0.3.0",
    131         "source": {
    132             "type": "git",
    133             "url": "https://github.com/symfony/css-selector.git",
    134             "reference": "6605602690578496091ac20ec7a5cbd160d4dff4"
    135         },
    136         "dist": {
    137             "type": "zip",
    138             "url": "https://api.github.com/repos/symfony/css-selector/zipball/6605602690578496091ac20ec7a5cbd160d4dff4",
    139             "reference": "6605602690578496091ac20ec7a5cbd160d4dff4",
    140             "shasum": ""
    141         },
    142         "require": {
    143             "php": ">=5.5.9"
    144         },
    145         "time": "2016-01-27 05:14:46",
    146         "type": "library",
    147         "extra": {
    148             "branch-alias": {
    149                 "dev-master": "3.0-dev"
    150             }
    151         },
    152         "installation-source": "dist",
    153         "autoload": {
    154             "psr-4": {
    155                 "Symfony\\Component\\CssSelector\\": ""
    156             },
    157             "exclude-from-classmap": [
    158                 "/Tests/"
    159             ]
    160         },
    161         "notification-url": "https://packagist.org/downloads/",
    162         "license": [
    163             "MIT"
    164         ],
    165         "authors": [
    166             {
    167                 "name": "Jean-François Simon",
    168                 "email": "[email protected]"
    169             },
    170             {
    171                 "name": "Fabien Potencier",
    172                 "email": "[email protected]"
    173             },
    174             {
    175                 "name": "Symfony Community",
    176                 "homepage": "https://symfony.com/contributors"
    177             }
    178         ],
    179         "description": "Symfony CssSelector Component",
    180         "homepage": "https://symfony.com"
    181     },
    182     {
    183128        "name": "tijsverkoyen/css-to-inline-styles",
    184129        "version": "1.5.5",
     
    230175    },
    231176    {
    232         "name": "voodoophp/handlebars",
    233         "version": "2.2.2",
    234         "version_normalized": "2.2.2.0",
    235         "source": {
    236             "type": "git",
    237             "url": "https://github.com/mardix/Handlebars.git",
    238             "reference": "cfd8efa3a02573e9cefc9adc05aa7df097a9691d"
    239         },
    240         "dist": {
    241             "type": "zip",
    242             "url": "https://api.github.com/repos/mardix/Handlebars/zipball/cfd8efa3a02573e9cefc9adc05aa7df097a9691d",
    243             "reference": "cfd8efa3a02573e9cefc9adc05aa7df097a9691d",
    244             "shasum": ""
    245         },
    246         "require": {
    247             "php": ">=5.4.0"
    248         },
    249         "time": "2014-02-21 04:28:49",
    250         "type": "library",
    251         "installation-source": "dist",
    252         "autoload": {
    253             "psr-0": {
    254                 "Handlebars": "src/"
    255             }
    256         },
    257         "notification-url": "https://packagist.org/downloads/",
    258         "license": [
    259             "MIT"
    260         ],
    261         "authors": [
    262             {
    263                 "name": "fzerorubigd",
    264                 "email": "[email protected]"
    265             },
    266             {
    267                 "name": "Behrooz Shabani (everplays)",
    268                 "email": "[email protected]"
    269             },
    270             {
    271                 "name": "Mardix",
    272                 "homepage": "https://github.com/mardix"
    273             }
    274         ],
    275         "description": "Handlebars processor for php",
    276         "homepage": "http://voodoophp.org/docs/handlebars",
    277         "keywords": [
    278             "handlebars",
    279             "mustache",
    280             "templating"
    281         ]
    282     },
    283     {
    284177        "name": "daniel-zahariev/php-aws-ses",
    285         "version": "0.8.7",
    286         "version_normalized": "0.8.7.0",
     178        "version": "0.8.8",
     179        "version_normalized": "0.8.8.0",
    287180        "source": {
    288181            "type": "git",
    289182            "url": "https://github.com/daniel-zahariev/php-aws-ses.git",
    290             "reference": "3b132db49a90b44b6c56d1b9058594d27bb543db"
    291         },
    292         "dist": {
    293             "type": "zip",
    294             "url": "https://api.github.com/repos/daniel-zahariev/php-aws-ses/zipball/3b132db49a90b44b6c56d1b9058594d27bb543db",
    295             "reference": "3b132db49a90b44b6c56d1b9058594d27bb543db",
     183            "reference": "d537ce71d189c8a5f45e68ad3e2dff188688dd03"
     184        },
     185        "dist": {
     186            "type": "zip",
     187            "url": "https://api.github.com/repos/daniel-zahariev/php-aws-ses/zipball/d537ce71d189c8a5f45e68ad3e2dff188688dd03",
     188            "reference": "d537ce71d189c8a5f45e68ad3e2dff188688dd03",
    296189            "shasum": ""
    297190        },
     
    300193            "php": ">=5.0.0"
    301194        },
    302         "time": "2016-03-22 11:16:38",
     195        "time": "2016-06-12 13:07:07",
    303196        "type": "library",
    304197        "installation-source": "dist",
     
    328221            "ses"
    329222        ]
     223    },
     224    {
     225        "name": "symfony/css-selector",
     226        "version": "v3.1.2",
     227        "version_normalized": "3.1.2.0",
     228        "source": {
     229            "type": "git",
     230            "url": "https://github.com/symfony/css-selector.git",
     231            "reference": "2851e1932d77ce727776154d659b232d061e816a"
     232        },
     233        "dist": {
     234            "type": "zip",
     235            "url": "https://api.github.com/repos/symfony/css-selector/zipball/2851e1932d77ce727776154d659b232d061e816a",
     236            "reference": "2851e1932d77ce727776154d659b232d061e816a",
     237            "shasum": ""
     238        },
     239        "require": {
     240            "php": ">=5.5.9"
     241        },
     242        "time": "2016-06-29 05:41:56",
     243        "type": "library",
     244        "extra": {
     245            "branch-alias": {
     246                "dev-master": "3.1-dev"
     247            }
     248        },
     249        "installation-source": "dist",
     250        "autoload": {
     251            "psr-4": {
     252                "Symfony\\Component\\CssSelector\\": ""
     253            },
     254            "exclude-from-classmap": [
     255                "/Tests/"
     256            ]
     257        },
     258        "notification-url": "https://packagist.org/downloads/",
     259        "license": [
     260            "MIT"
     261        ],
     262        "authors": [
     263            {
     264                "name": "Jean-François Simon",
     265                "email": "[email protected]"
     266            },
     267            {
     268                "name": "Fabien Potencier",
     269                "email": "[email protected]"
     270            },
     271            {
     272                "name": "Symfony Community",
     273                "homepage": "https://symfony.com/contributors"
     274            }
     275        ],
     276        "description": "Symfony CssSelector Component",
     277        "homepage": "https://symfony.com"
     278    },
     279    {
     280        "name": "xamin/handlebars.php",
     281        "version": "dev-master",
     282        "version_normalized": "9999999-dev",
     283        "source": {
     284            "type": "git",
     285            "url": "https://github.com/XaminProject/handlebars.php.git",
     286            "reference": "5e1db1d1c7969fae32eab331a3b4d9b93257a709"
     287        },
     288        "dist": {
     289            "type": "zip",
     290            "url": "https://api.github.com/repos/XaminProject/handlebars.php/zipball/5e1db1d1c7969fae32eab331a3b4d9b93257a709",
     291            "reference": "5e1db1d1c7969fae32eab331a3b4d9b93257a709",
     292            "shasum": ""
     293        },
     294        "require-dev": {
     295            "phpunit/phpunit": "~4.4",
     296            "squizlabs/php_codesniffer": "~1.5"
     297        },
     298        "time": "2015-08-06 22:16:36",
     299        "type": "library",
     300        "installation-source": "source",
     301        "autoload": {
     302            "psr-0": {
     303                "Handlebars": "src/"
     304            }
     305        },
     306        "notification-url": "https://packagist.org/downloads/",
     307        "license": [
     308            "MIT"
     309        ],
     310        "authors": [
     311            {
     312                "name": "fzerorubigd",
     313                "email": "[email protected]"
     314            },
     315            {
     316                "name": "Behrooz Shabani (everplays)",
     317                "email": "[email protected]"
     318            }
     319        ],
     320        "description": "Handlebars processor for php",
     321        "homepage": "https://github.com/XaminProject/handlebars.php"
    330322    }
    331323]
  • well-handled/trunk/.lib/daniel-zahariev/php-aws-ses/README.md

    r1387766 r1463492  
    88****
    99
     10## Table of Contents
     11
     12- [Installation](#installation)
     13- [Basic Usage](#basic-usage)
     14- [Recipients](#recipients)
     15- [Message body](#message-body)
     16- [Attachments](#attachments)
     17- [Sending Bulk Messages](#sending-bulk-messages)
     18- [API Endpoints](#api-endpoints)
     19- [Helper Methods](#helper-methods)
     20
     21
    1022### Installation
    1123Install the latest version with
     
    1729```php
    1830<?php
    19    
     31
    2032require_once 'vendor/autoload.php';
    2133
     
    7688$m->setMessageFromURL($texturl, $htmlurl);
    7789
    78 // Remember that setMessageFromString, setMessageFromFile, and setMessageFromURL are mutually exclusive. 
     90// Remember that setMessageFromString, setMessageFromFile, and setMessageFromURL are mutually exclusive.
    7991// If you call more than one, then whichever call you make last will be the message used.
    8092
     
    105117```
    106118
     119### Sending Bulk Messages
     120When hundreds of emails have to be sent in bulk it's best to use the Bulk mode which essentially reuses a CURL handler and reduces the number of SSL handshakes and this gives a better performance.
     121
     122```php
     123<?php
     124
     125// Enable bulk sending mode (reuse of CURL handler)
     126$ses->setBulkMode(true);
     127
     128// Send the messages
     129foreach($messages as $message) {
     130    $ses->sendEmail($message);
     131}
     132
     133// Disable bulk sending mode
     134$ses->setBulkMode(false);
     135```
     136
    107137### API Endpoints
    108138Few [Regions and Amazon SES endpoints](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html) are available and they can be used like this:
     
    110140```php
    111141<?php
     142
    112143$region_endpoint = SimpleEmailService::AWS_US_EAST_1;
    113144$ses = new SimpleEmailService('AccessKey', 'SecretKey', $region_endpoint);
    114 
    115145```
    116146
     
    119149```php
    120150<?php
     151
    121152// Get the addresses that have been verified in your AWS SES account
    122153$ses->listVerifiedEmailAddresses();
     
    139170```php
    140171<?php
     172
    141173// Set the default behaviour for handling errors
    142174$trigger_error = true;
     
    152184
    153185### Changelog
     186v.0.8.8
     187
     188- Issues fixed: #24, #25, #30, #31
     189- added a method `setBulkMode` in `SimpleEmailService` which can enable reuse of `SimpleEmailServiceRequest` object for bulk sending of requests to AWS SES
     190- new methods in `SimpleEmailService`: `getVerifyPeer`, `setVerifyPeer`, `getVerifyHost`, `setVerifyHost`, `getBulkMode`, `setBulkMode`, `getRequestHandler` (protected)
     191- methods marked as deprecated in `SimpleEmailService`: `enableVerifyHost`, `enableVerifyPeer`, `verifyHost`, `verifyPeer`
     192- new methods in `SimpleEmailServiceMessage`: `clearTo`, `clearCC`, `clearBCC`, `clearReplyTo`, `clearRecipients`
     193- new methods in `SimpleEmailServiceRequest`: `setVerb`, `clearParameters`, `getCurlHandler` (protected)
     194- updated `validate` method in `SimpleEmailServiceMessage`
     195- added some phpDocumentor blocks
     196
     197v.0.8.7
     198
     199- Minor updates
     200
    154201v.0.8.6
    155202
  • well-handled/trunk/.lib/daniel-zahariev/php-aws-ses/src/SimpleEmailService.php

    r1387766 r1463492  
    4747* @link https://github.com/daniel-zahariev/php-aws-ses
    4848* @package AmazonSimpleEmailService
     49* @version v0.8.8
    4950*/
    5051class SimpleEmailService
     
    5758    const AWS_EU_WEST1 = 'email.eu-west-1.amazonaws.com';
    5859
    59     protected $__accessKey; // AWS Access key
    60     protected $__secretKey; // AWS Secret key
     60    // AWS SES Target host of region
    6161    protected $__host;
     62
     63    // AWS SES Access key
     64    protected $__accessKey;
     65
     66    // AWS Secret key
     67    protected $__secretKey;
     68
     69    // Enable/disable
    6270    protected $__trigger_errors;
    6371
    64     public function getAccessKey() { return $this->__accessKey; }
    65     public function getSecretKey() { return $this->__secretKey; }
    66     public function getHost() { return $this->__host; }
    67 
     72    // Controls the reuse of CURL hander for sending a bulk of messages
     73    protected $__bulk_sending_mode = false;
     74
     75    // Optionally reusable SimpleEmailServiceRequest instance
     76    protected $__ses_request = null;
     77
     78    // Controls CURLOPT_SSL_VERIFYHOST setting for SimpleEmailServiceRequest's curl handler
    6879    protected $__verifyHost = true;
     80
     81    // Controls CURLOPT_SSL_VERIFYPEER setting for SimpleEmailServiceRequest's curl handler
    6982    protected $__verifyPeer = true;
    70 
    71     // verifyHost and verifyPeer determine whether curl verifies ssl certificates.
    72     // It may be necessary to disable these checks on certain systems.
    73     // These only have an effect if SSL is enabled.
    74     public function verifyHost() { return $this->__verifyHost; }
    75     public function enableVerifyHost($enable = true) { $this->__verifyHost = $enable; }
    76     public function verifyPeer() { return $this->__verifyPeer; }
    77     public function enableVerifyPeer($enable = true) { $this->__verifyPeer = $enable; }
    7883
    7984    /**
     
    108113    }
    109114
     115    // DEPRECATED
     116    public function enableVerifyHost($enable = true) { $this->__verifyHost = (bool)$enable; return $this; }
     117    // DEPRECATED
     118    public function enableVerifyPeer($enable = true) { $this->__verifyPeer = (bool)$enable; return $this; }
     119    // DEPRECATED
     120    public function verifyHost() { return $this->__verifyHost; }
     121    // DEPRECATED
     122    public function verifyPeer() { return $this->__verifyPeer; }
     123
     124
     125    /**
     126    * Get AWS target host
     127    * @return boolean
     128    */
     129    public function getHost() { return $this->__host; }
     130
     131    /**
     132    * Get AWS SES auth access key
     133    * @return string
     134    */
     135    public function getAccessKey() { return $this->__accessKey; }
     136
     137    /**
     138    * Get AWS SES auth secret key
     139    * @return string
     140    */
     141    public function getSecretKey() { return $this->__secretKey; }
     142
     143    /**
     144    * Get the verify peer CURL mode
     145    * @return boolean
     146    */
     147    public function getVerifyPeer() { return $this->__verifyPeer; }
     148
     149    /**
     150    * Get the verify host CURL mode
     151    * @return boolean
     152    */
     153    public function getVerifyHost() { return $this->__verifyHost; }
     154
     155    /**
     156    * Get bulk email sending mode
     157    * @return boolean
     158    */
     159    public function getBulkMode() { return $this->__bulk_sending_mode; }
     160
     161
     162    /**
     163    * Enable/disable CURLOPT_SSL_VERIFYHOST for SimpleEmailServiceRequest's curl handler
     164    * verifyHost and verifyPeer determine whether curl verifies ssl certificates.
     165    * It may be necessary to disable these checks on certain systems.
     166    * These only have an effect if SSL is enabled.
     167    *
     168    * @param boolean $enable New status for the mode
     169    * @return SimpleEmailService $this
     170    */
     171    public function setVerifyHost($enable = true) {
     172        $this->__verifyHost = (bool)$enable;
     173        return $this;
     174    }
     175
     176    /**
     177    * Enable/disable CURLOPT_SSL_VERIFYPEER for SimpleEmailServiceRequest's curl handler
     178    * verifyHost and verifyPeer determine whether curl verifies ssl certificates.
     179    * It may be necessary to disable these checks on certain systems.
     180    * These only have an effect if SSL is enabled.
     181    *
     182    * @param boolean $enable New status for the mode
     183    * @return SimpleEmailService $this
     184    */
     185    public function setVerifyPeer($enable = true) {
     186        $this->__verifyPeer = (bool)$enable;
     187        return $this;
     188    }
     189
     190    /**
     191    * Enable/disable bulk email sending mode
     192    *
     193    * @param boolean $enable New status for the mode
     194    * @return SimpleEmailService $this
     195    */
     196    public function setBulkMode($enable = true) {
     197        $this->__bulk_sending_mode = (bool)$enable;
     198        // clear request handler on disable
     199        if (!$enable) $this->__ses_request = null;
     200        return $this;
     201    }
     202
    110203    /**
    111204    * Lists the email addresses that have been verified and can be used as the 'From' address
     
    114207    */
    115208    public function listVerifiedEmailAddresses() {
    116         $rest = new SimpleEmailServiceRequest($this, 'GET');
    117         $rest->setParameter('Action', 'ListVerifiedEmailAddresses');
    118 
    119         $rest = $rest->getResponse();
    120         if($rest->error === false && $rest->code !== 200) {
    121             $rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
    122         }
    123         if($rest->error !== false) {
    124             $this->__triggerError('listVerifiedEmailAddresses', $rest->error);
     209        $ses_request = $this->getRequestHandler('GET');
     210        $ses_request->setParameter('Action', 'ListVerifiedEmailAddresses');
     211
     212        $ses_response = $ses_request->getResponse();
     213        if($ses_response->error === false && $ses_response->code !== 200) {
     214            $ses_response->error = array('code' => $ses_response->code, 'message' => 'Unexpected HTTP status');
     215        }
     216        if($ses_response->error !== false) {
     217            $this->__triggerError('listVerifiedEmailAddresses', $ses_response->error);
    125218            return false;
    126219        }
    127220
    128221        $response = array();
    129         if(!isset($rest->body)) {
     222        if(!isset($ses_response->body)) {
    130223            return $response;
    131224        }
    132225
    133226        $addresses = array();
    134         foreach($rest->body->ListVerifiedEmailAddressesResult->VerifiedEmailAddresses->member as $address) {
     227        foreach($ses_response->body->ListVerifiedEmailAddressesResult->VerifiedEmailAddresses->member as $address) {
    135228            $addresses[] = (string)$address;
    136229        }
    137230
    138231        $response['Addresses'] = $addresses;
    139         $response['RequestId'] = (string)$rest->body->ResponseMetadata->RequestId;
     232        $response['RequestId'] = (string)$ses_response->body->ResponseMetadata->RequestId;
    140233
    141234        return $response;
     
    153246    */
    154247    public function verifyEmailAddress($email) {
    155         $rest = new SimpleEmailServiceRequest($this, 'POST');
    156         $rest->setParameter('Action', 'VerifyEmailAddress');
    157         $rest->setParameter('EmailAddress', $email);
    158 
    159         $rest = $rest->getResponse();
    160         if($rest->error === false && $rest->code !== 200) {
    161             $rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
    162         }
    163         if($rest->error !== false) {
    164             $this->__triggerError('verifyEmailAddress', $rest->error);
     248        $ses_request = $this->getRequestHandler('POST');
     249        $ses_request->setParameter('Action', 'VerifyEmailAddress');
     250        $ses_request->setParameter('EmailAddress', $email);
     251
     252        $ses_response = $ses_request->getResponse();
     253        if($ses_response->error === false && $ses_response->code !== 200) {
     254            $ses_response->error = array('code' => $ses_response->code, 'message' => 'Unexpected HTTP status');
     255        }
     256        if($ses_response->error !== false) {
     257            $this->__triggerError('verifyEmailAddress', $ses_response->error);
    165258            return false;
    166259        }
    167260
    168         $response['RequestId'] = (string)$rest->body->ResponseMetadata->RequestId;
     261        $response['RequestId'] = (string)$ses_response->body->ResponseMetadata->RequestId;
    169262        return $response;
    170263    }
     
    177270    */
    178271    public function deleteVerifiedEmailAddress($email) {
    179         $rest = new SimpleEmailServiceRequest($this, 'DELETE');
    180         $rest->setParameter('Action', 'DeleteVerifiedEmailAddress');
    181         $rest->setParameter('EmailAddress', $email);
    182 
    183         $rest = $rest->getResponse();
    184         if($rest->error === false && $rest->code !== 200) {
    185             $rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
    186         }
    187         if($rest->error !== false) {
    188             $this->__triggerError('deleteVerifiedEmailAddress', $rest->error);
     272        $ses_request = $this->getRequestHandler('DELETE');
     273        $ses_request->setParameter('Action', 'DeleteVerifiedEmailAddress');
     274        $ses_request->setParameter('EmailAddress', $email);
     275
     276        $ses_response = $ses_request->getResponse();
     277        if($ses_response->error === false && $ses_response->code !== 200) {
     278            $ses_response->error = array('code' => $ses_response->code, 'message' => 'Unexpected HTTP status');
     279        }
     280        if($ses_response->error !== false) {
     281            $this->__triggerError('deleteVerifiedEmailAddress', $ses_response->error);
    189282            return false;
    190283        }
    191284
    192         $response['RequestId'] = (string)$rest->body->ResponseMetadata->RequestId;
     285        $response['RequestId'] = (string)$ses_response->body->ResponseMetadata->RequestId;
    193286        return $response;
    194287    }
     
    201294    */
    202295    public function getSendQuota() {
    203         $rest = new SimpleEmailServiceRequest($this, 'GET');
    204         $rest->setParameter('Action', 'GetSendQuota');
    205 
    206         $rest = $rest->getResponse();
    207         if($rest->error === false && $rest->code !== 200) {
    208             $rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
    209         }
    210         if($rest->error !== false) {
    211             $this->__triggerError('getSendQuota', $rest->error);
     296        $ses_request = $this->getRequestHandler('GET');
     297        $ses_request->setParameter('Action', 'GetSendQuota');
     298
     299        $ses_response = $ses_request->getResponse();
     300        if($ses_response->error === false && $ses_response->code !== 200) {
     301            $ses_response->error = array('code' => $ses_response->code, 'message' => 'Unexpected HTTP status');
     302        }
     303        if($ses_response->error !== false) {
     304            $this->__triggerError('getSendQuota', $ses_response->error);
    212305            return false;
    213306        }
    214307
    215308        $response = array();
    216         if(!isset($rest->body)) {
     309        if(!isset($ses_response->body)) {
    217310            return $response;
    218311        }
    219312
    220         $response['Max24HourSend'] = (string)$rest->body->GetSendQuotaResult->Max24HourSend;
    221         $response['MaxSendRate'] = (string)$rest->body->GetSendQuotaResult->MaxSendRate;
    222         $response['SentLast24Hours'] = (string)$rest->body->GetSendQuotaResult->SentLast24Hours;
    223         $response['RequestId'] = (string)$rest->body->ResponseMetadata->RequestId;
     313        $response['Max24HourSend'] = (string)$ses_response->body->GetSendQuotaResult->Max24HourSend;
     314        $response['MaxSendRate'] = (string)$ses_response->body->GetSendQuotaResult->MaxSendRate;
     315        $response['SentLast24Hours'] = (string)$ses_response->body->GetSendQuotaResult->SentLast24Hours;
     316        $response['RequestId'] = (string)$ses_response->body->ResponseMetadata->RequestId;
    224317
    225318        return $response;
     
    233326    */
    234327    public function getSendStatistics() {
    235         $rest = new SimpleEmailServiceRequest($this, 'GET');
    236         $rest->setParameter('Action', 'GetSendStatistics');
    237 
    238         $rest = $rest->getResponse();
    239         if($rest->error === false && $rest->code !== 200) {
    240             $rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
    241         }
    242         if($rest->error !== false) {
    243             $this->__triggerError('getSendStatistics', $rest->error);
     328        $ses_request = $this->getRequestHandler('GET');
     329        $ses_request->setParameter('Action', 'GetSendStatistics');
     330
     331        $ses_response = $ses_request->getResponse();
     332        if($ses_response->error === false && $ses_response->code !== 200) {
     333            $ses_response->error = array('code' => $ses_response->code, 'message' => 'Unexpected HTTP status');
     334        }
     335        if($ses_response->error !== false) {
     336            $this->__triggerError('getSendStatistics', $ses_response->error);
    244337            return false;
    245338        }
    246339
    247340        $response = array();
    248         if(!isset($rest->body)) {
     341        if(!isset($ses_response->body)) {
    249342            return $response;
    250343        }
    251344
    252345        $datapoints = array();
    253         foreach($rest->body->GetSendStatisticsResult->SendDataPoints->member as $datapoint) {
     346        foreach($ses_response->body->GetSendStatisticsResult->SendDataPoints->member as $datapoint) {
    254347            $p = array();
    255348            $p['Bounces'] = (string)$datapoint->Bounces;
     
    263356
    264357        $response['SendDataPoints'] = $datapoints;
    265         $response['RequestId'] = (string)$rest->body->ResponseMetadata->RequestId;
     358        $response['RequestId'] = (string)$ses_response->body->ResponseMetadata->RequestId;
    266359
    267360        return $response;
     
    285378        }
    286379
    287         $rest = new SimpleEmailServiceRequest($this, 'POST');
     380        $ses_request = $this->getRequestHandler('POST');
    288381        $action = !empty($sesMessage->attachments) || $use_raw_request ? 'SendRawEmail' : 'SendEmail';
    289         $rest->setParameter('Action', $action);
     382        $ses_request->setParameter('Action', $action);
    290383
    291384        if($action == 'SendRawEmail') {
    292385            // echo $sesMessage->getRawMessage();return;
    293             $rest->setParameter('RawMessage.Data', $sesMessage->getRawMessage());
     386            $ses_request->setParameter('RawMessage.Data', $sesMessage->getRawMessage());
    294387        } else {
    295388            $i = 1;
    296389            foreach($sesMessage->to as $to) {
    297                 $rest->setParameter('Destination.ToAddresses.member.'.$i, $sesMessage->encodeRecipients($to));
     390                $ses_request->setParameter('Destination.ToAddresses.member.'.$i, $sesMessage->encodeRecipients($to));
    298391                $i++;
    299392            }
     
    302395                $i = 1;
    303396                foreach($sesMessage->cc as $cc) {
    304                     $rest->setParameter('Destination.CcAddresses.member.'.$i, $sesMessage->encodeRecipients($cc));
     397                    $ses_request->setParameter('Destination.CcAddresses.member.'.$i, $sesMessage->encodeRecipients($cc));
    305398                    $i++;
    306399                }
     
    310403                $i = 1;
    311404                foreach($sesMessage->bcc as $bcc) {
    312                     $rest->setParameter('Destination.BccAddresses.member.'.$i, $sesMessage->encodeRecipients($bcc));
     405                    $ses_request->setParameter('Destination.BccAddresses.member.'.$i, $sesMessage->encodeRecipients($bcc));
    313406                    $i++;
    314407                }
     
    318411                $i = 1;
    319412                foreach($sesMessage->replyto as $replyto) {
    320                     $rest->setParameter('ReplyToAddresses.member.'.$i, $sesMessage->encodeRecipients($replyto));
     413                    $ses_request->setParameter('ReplyToAddresses.member.'.$i, $sesMessage->encodeRecipients($replyto));
    321414                    $i++;
    322415                }
    323416            }
    324417
    325             $rest->setParameter('Source', $sesMessage->encodeRecipients($sesMessage->from));
     418            $ses_request->setParameter('Source', $sesMessage->encodeRecipients($sesMessage->from));
    326419
    327420            if($sesMessage->returnpath != null) {
    328                 $rest->setParameter('ReturnPath', $sesMessage->returnpath);
     421                $ses_request->setParameter('ReturnPath', $sesMessage->returnpath);
    329422            }
    330423
    331424            if($sesMessage->subject != null && strlen($sesMessage->subject) > 0) {
    332                 $rest->setParameter('Message.Subject.Data', $sesMessage->subject);
     425                $ses_request->setParameter('Message.Subject.Data', $sesMessage->subject);
    333426                if($sesMessage->subjectCharset != null && strlen($sesMessage->subjectCharset) > 0) {
    334                     $rest->setParameter('Message.Subject.Charset', $sesMessage->subjectCharset);
     427                    $ses_request->setParameter('Message.Subject.Charset', $sesMessage->subjectCharset);
    335428                }
    336429            }
     
    338431
    339432            if($sesMessage->messagetext != null && strlen($sesMessage->messagetext) > 0) {
    340                 $rest->setParameter('Message.Body.Text.Data', $sesMessage->messagetext);
     433                $ses_request->setParameter('Message.Body.Text.Data', $sesMessage->messagetext);
    341434                if($sesMessage->messageTextCharset != null && strlen($sesMessage->messageTextCharset) > 0) {
    342                     $rest->setParameter('Message.Body.Text.Charset', $sesMessage->messageTextCharset);
     435                    $ses_request->setParameter('Message.Body.Text.Charset', $sesMessage->messageTextCharset);
    343436                }
    344437            }
    345438
    346439            if($sesMessage->messagehtml != null && strlen($sesMessage->messagehtml) > 0) {
    347                 $rest->setParameter('Message.Body.Html.Data', $sesMessage->messagehtml);
     440                $ses_request->setParameter('Message.Body.Html.Data', $sesMessage->messagehtml);
    348441                if($sesMessage->messageHtmlCharset != null && strlen($sesMessage->messageHtmlCharset) > 0) {
    349                     $rest->setParameter('Message.Body.Html.Charset', $sesMessage->messageHtmlCharset);
     442                    $ses_request->setParameter('Message.Body.Html.Charset', $sesMessage->messageHtmlCharset);
    350443                }
    351444            }
    352445        }
    353446
    354         $rest = $rest->getResponse();
    355         if($rest->error === false && $rest->code !== 200) {
     447        $ses_response = $ses_request->getResponse();
     448        if($ses_response->error === false && $ses_response->code !== 200) {
    356449            $response = array(
    357                 'code' => $rest->code,
     450                'code' => $ses_response->code,
    358451                'error' => array('Error' => array('message' => 'Unexpected HTTP status')),
    359452            );
    360453            return $response;
    361454        }
    362         if($rest->error !== false) {
     455        if($ses_response->error !== false) {
    363456            if (($this->__trigger_errors && ($trigger_error !== false)) || $trigger_error === true) {
    364                 $this->__triggerError('sendEmail', $rest->error);
     457                $this->__triggerError('sendEmail', $ses_response->error);
    365458                return false;
    366459            }
    367             return $rest;
     460            return $ses_response;
    368461        }
    369462
    370463        $response = array(
    371             'MessageId' => (string)$rest->body->{"{$action}Result"}->MessageId,
    372             'RequestId' => (string)$rest->body->ResponseMetadata->RequestId,
     464            'MessageId' => (string)$ses_response->body->{"{$action}Result"}->MessageId,
     465            'RequestId' => (string)$ses_response->body->ResponseMetadata->RequestId,
    373466        );
    374467        return $response;
     
    402495        }
    403496    }
     497
     498    /**
     499    *
     500    */
     501    protected function getRequestHandler($verb) {
     502        if ($this->__bulk_sending_mode && !empty($this->__ses_request)) {
     503            $this->__ses_request->setVerb($verb);
     504            return $this->__ses_request;
     505        }
     506        $this->__ses_request = new SimpleEmailServiceRequest($this, $verb);
     507
     508        return $this->__ses_request;
     509    }
    404510}
  • well-handled/trunk/.lib/daniel-zahariev/php-aws-ses/src/SimpleEmailServiceMessage.php

    r1387766 r1463492  
    55* @link https://github.com/daniel-zahariev/php-aws-ses
    66* @package AmazonSimpleEmailService
     7* @version v0.8.8
    78*/
    89final class SimpleEmailServiceMessage {
     
    3940    * If a single address is passed, it is appended to the current list of addresses.
    4041    * If an array of addresses is passed, that array is merged into the current list.
     42    *
     43    * @link http://docs.aws.amazon.com/ses/latest/APIReference/API_Destination.html
    4144    */
    4245    public function addTo($to) {
     
    5154    }
    5255
     56    /**
     57    * Clear the To: email address(es) for the message
     58    */
     59    public function clearTo() {
     60        $this->to = array();
     61
     62        return $this;
     63    }
     64
     65    /**
     66    * @see addTo()
     67    */
    5368    public function addCC($cc) {
    5469        if(!is_array($cc)) {
     
    6277    }
    6378
     79    /**
     80    * Clear the CC: email address(es) for the message
     81    */
     82    public function clearCC() {
     83        $this->cc = array();
     84
     85        return $this;
     86    }
     87
     88    /**
     89    * @see addTo()
     90    */
    6491    public function addBCC($bcc) {
    6592        if(!is_array($bcc)) {
     
    73100    }
    74101
     102    /**
     103    * Clear the BCC: email address(es) for the message
     104    */
     105    public function clearBCC() {
     106        $this->bcc = array();
     107
     108        return $this;
     109    }
     110
     111    /**
     112    * @see addTo()
     113    */
    75114    public function addReplyTo($replyto) {
    76115        if(!is_array($replyto)) {
     
    84123    }
    85124
     125    /**
     126    * Clear the Reply-To: email address(es) for the message
     127    */
     128    public function clearReplyTo() {
     129        $this->replyto = array();
     130
     131        return $this;
     132    }
     133
     134    /**
     135    * Clear all of the message recipients in one go
     136    *
     137    * @uses clearTo()
     138    * @uses clearCC()
     139    * @uses clearBCC()
     140    * @uses clearReplyTo()
     141    */
     142    public function clearRecipients() {
     143        $this->clearTo();
     144        $this->clearCC();
     145        $this->clearBCC();
     146        $this->clearReplyTo();
     147    }
     148
    86149    public function setFrom($from) {
    87150        $this->from = $from;
     
    114177    }
    115178
     179    /**
     180    * @link http://docs.aws.amazon.com/ses/latest/APIReference/API_Message.html
     181    */
    116182    public function setMessageFromString($text, $html = null) {
    117183        $this->messagetext = $text;
     
    336402    */
    337403    public function validate() {
     404        // at least one To: destination is required
    338405        if(count($this->to) == 0)
    339406            return false;
     407
     408        // sender is required
    340409        if($this->from == null || strlen($this->from) == 0)
    341410            return false;
    342         // messages require at least one of: subject, messagetext, messagehtml.
    343         if(($this->subject == null || strlen($this->subject) == 0)
    344             && ($this->messagetext == null || strlen($this->messagetext) == 0)
    345             && ($this->messagehtml == null || strlen($this->messagehtml) == 0))
     411
     412        // subject is required
     413        if(($this->subject == null || strlen($this->subject) == 0)) return false;
     414
     415        // message is required
     416        if ((empty($this->messagetext) || strlen((string)$this->messagetext) == 0)
     417            && (empty($this->messagehtml) || strlen((string)$this->messagehtml) == 0))
    346418        {
    347419            return false;
  • well-handled/trunk/.lib/daniel-zahariev/php-aws-ses/src/SimpleEmailServiceRequest.php

    r1387766 r1463492  
    55* @link https://github.com/daniel-zahariev/php-aws-ses
    66* @package AmazonSimpleEmailService
     7* @version v0.8.8
    78*/
    89final class SimpleEmailServiceRequest
    910{
    1011    private $ses, $verb, $parameters = array();
    11     public $response;
     12
     13    // CURL request handler that can be reused
     14    protected $curl_handler = null;
     15
     16    // Holds the response from calling AWS's API
     17    protected $response;
     18
     19    //
    1220    public static $curlOptions = array();
    1321
     
    1927    * @return void
    2028    */
    21     function __construct($ses, $verb) {
     29    public function __construct($ses, $verb = 'GET') {
    2230        $this->ses = $ses;
    2331        $this->verb = $verb;
    2432        $this->response = (object) array('body' => '', 'code' => 0, 'error' => false);
     33    }
     34
     35    /**
     36    * Set HTTP method
     37    *
     38    * @return SimpleEmailServiceRequest $this
     39    */
     40    public function setVerb($verb) {
     41        $this->verb = $verb;
     42        return $this;
    2543    }
    2644
     
    3452    */
    3553    public function setParameter($key, $value, $replace = true) {
    36         if(!$replace && isset($this->parameters[$key]))
    37         {
     54        if(!$replace && isset($this->parameters[$key])) {
    3855            $temp = (array)($this->parameters[$key]);
    3956            $temp[] = $value;
    4057            $this->parameters[$key] = $temp;
    41         }
    42         else
    43         {
     58        } else {
    4459            $this->parameters[$key] = $value;
    4560        }
     
    4964
    5065    /**
    51     * Get the response
    52     *
    53     * @return object | false
    54     */
    55     public function getResponse() {
    56 
     66    * Get the params for the reques
     67    *
     68    * @return array $params
     69    */
     70    public function getParametersEncoded() {
    5771        $params = array();
    58         foreach ($this->parameters as $var => $value)
    59         {
    60             if(is_array($value))
    61             {
    62                 foreach($value as $v)
    63                 {
     72
     73        foreach ($this->parameters as $var => $value) {
     74            if(is_array($value)) {
     75                foreach($value as $v) {
    6476                    $params[] = $var.'='.$this->__customUrlEncode($v);
    6577                }
    66             }
    67             else
    68             {
     78            } else {
    6979                $params[] = $var.'='.$this->__customUrlEncode($value);
    7080            }
     
    7383        sort($params, SORT_STRING);
    7484
     85        return $params;
     86    }
     87
     88    /**
     89    * Clear the request parameters
     90    * @return SimpleEmailServiceRequest $this
     91    */
     92    public function clearParameters() {
     93        $this->parameters = array();
     94        return $this;
     95    }
     96
     97    /**
     98    * Instantiate and setup CURL handler for sending requests.
     99    * Instance is cashed in `$this->curl_handler`
     100    *
     101    * @return resource $curl_handler
     102    */
     103    protected function getCurlHandler() {
     104        if (!empty($this->curl_handler))
     105            return $this->curl_handler;
     106
     107        $curl = curl_init();
     108        curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');
     109
     110        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 2 : 0));
     111        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));
     112        curl_setopt($curl, CURLOPT_HEADER, false);
     113        curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
     114        curl_setopt($curl, CURLOPT_WRITEFUNCTION, array(&$this, '__responseWriteCallback'));
     115        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
     116
     117        foreach(self::$curlOptions as $option => $value) {
     118            curl_setopt($curl, $option, $value);
     119        }
     120
     121        $this->curl_handler = $curl;
     122
     123        return $this->curl_handler;
     124    }
     125
     126    /**
     127    * Get the response
     128    *
     129    * @return object | false
     130    */
     131    public function getResponse() {
     132
    75133        // must be in format 'Sun, 06 Nov 1994 08:49:37 GMT'
    76134        $date = gmdate('D, d M Y H:i:s e');
    77 
    78         $query = implode('&', $params);
     135        $query = implode('&', $this->getParametersEncoded());
     136        $auth = 'AWS3-HTTPS AWSAccessKeyId='.$this->ses->getAccessKey();
     137        $auth .= ',Algorithm=HmacSHA256,Signature='.$this->__getSignature($date);
     138        $url = 'https://'.$this->ses->getHost().'/';
    79139
    80140        $headers = array();
    81141        $headers[] = 'Date: ' . $date;
    82142        $headers[] = 'Host: ' . $this->ses->getHost();
    83 
    84         $auth = 'AWS3-HTTPS AWSAccessKeyId='.$this->ses->getAccessKey();
    85         $auth .= ',Algorithm=HmacSHA256,Signature='.$this->__getSignature($date);
    86143        $headers[] = 'X-Amzn-Authorization: ' . $auth;
    87144
    88         $url = 'https://'.$this->ses->getHost().'/';
    89 
    90         // Basic setup
    91         $curl = curl_init();
    92         curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');
    93 
    94         curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 2 : 0));
    95         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));
     145        $curl_handler = $this->getCurlHandler();
     146        curl_setopt($curl_handler, CURLOPT_CUSTOMREQUEST, $this->verb);
    96147
    97148        // Request types
    98149        switch ($this->verb) {
    99150            case 'GET':
     151            case 'DELETE':
    100152                $url .= '?'.$query;
    101153                break;
     154
    102155            case 'POST':
    103                 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->verb);
    104                 curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
     156                curl_setopt($curl_handler, CURLOPT_POSTFIELDS, $query);
    105157                $headers[] = 'Content-Type: application/x-www-form-urlencoded';
    106             break;
    107             case 'DELETE':
    108                 $url .= '?'.$query;
    109                 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
    110             break;
    111             default: break;
    112         }
    113         curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    114         curl_setopt($curl, CURLOPT_HEADER, false);
    115 
    116         curl_setopt($curl, CURLOPT_URL, $url);
    117         curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
    118         curl_setopt($curl, CURLOPT_WRITEFUNCTION, array(&$this, '__responseWriteCallback'));
    119         curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    120 
    121         foreach(self::$curlOptions as $option => $value) {
    122             curl_setopt($curl, $option, $value);
    123         }
     158                break;
     159        }
     160        curl_setopt($curl_handler, CURLOPT_HTTPHEADER, $headers);
     161        curl_setopt($curl_handler, CURLOPT_URL, $url);
     162
    124163
    125164        // Execute, grab errors
    126         if (curl_exec($curl)) {
    127             $this->response->code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
     165        if (curl_exec($curl_handler)) {
     166            $this->response->code = curl_getinfo($curl_handler, CURLINFO_HTTP_CODE);
    128167        } else {
    129168            $this->response->error = array(
    130169                'curl' => true,
    131                 'code' => curl_errno($curl),
    132                 'message' => curl_error($curl),
     170                'code' => curl_errno($curl_handler),
     171                'message' => curl_error($curl_handler),
    133172            );
    134173        }
    135174
    136         @curl_close($curl);
     175        // cleanup for reusing the current instance for multiple requests
     176        curl_setopt($curl_handler, CURLOPT_POSTFIELDS, '');
     177        $this->parameters = array();
    137178
    138179        // Parse body into XML
     
    157198        }
    158199
    159         return $this->response;
     200        $response = $this->response;
     201        $this->response = (object) array('body' => '', 'code' => 0, 'error' => false);
     202
     203        return $response;
     204    }
     205
     206    /**
     207    * Destroy any leftover handlers
     208    */
     209    public function __destruct() {
     210        if (!empty($this->curl_handler))
     211            @curl_close($this->curl_handler);
    160212    }
    161213
  • well-handled/trunk/.lib/symfony/css-selector/CssSelectorConverter.php

    r1387766 r1463492  
    3030
    3131    /**
    32      * @param bool $html Whether HTML support should be enabled. Disable it for XML documents.
     32     * @param bool $html Whether HTML support should be enabled. Disable it for XML documents
    3333     */
    3434    public function __construct($html = true)
     
    5454     * expression with the $prefix parameter.
    5555     *
    56      * @param string $cssExpr The CSS expression.
    57      * @param string $prefix  An optional prefix for the XPath expression.
     56     * @param string $cssExpr The CSS expression
     57     * @param string $prefix  An optional prefix for the XPath expression
    5858     *
    5959     * @return string
  • well-handled/trunk/.lib/symfony/css-selector/Parser/Parser.php

    r1387766 r1463492  
    5959     * @param Token[] $tokens
    6060     *
     61     * @return array
     62     *
    6163     * @throws SyntaxErrorException
    62      *
    63      * @return array
    6464     */
    6565    public static function parseSeries(array $tokens)
     
    134134     * @param TokenStream $stream
    135135     *
     136     * @return Node\SelectorNode
     137     *
    136138     * @throws SyntaxErrorException
    137      *
    138      * @return Node\SelectorNode
    139139     */
    140140    private function parserSelectorNode(TokenStream $stream)
     
    174174     * @param bool        $insideNegation
    175175     *
     176     * @return array
     177     *
    176178     * @throws SyntaxErrorException
    177      *
    178      * @return array
    179179     */
    180180    private function parseSimpleSelector(TokenStream $stream, $insideNegation = false)
     
    331331     * @param TokenStream        $stream
    332332     *
     333     * @return Node\AttributeNode
     334     *
    333335     * @throws SyntaxErrorException
    334      *
    335      * @return Node\AttributeNode
    336336     */
    337337    private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream)
  • well-handled/trunk/.lib/symfony/css-selector/Parser/TokenStream.php

    r1387766 r1463492  
    8686     * Returns next token.
    8787     *
     88     * @return Token
     89     *
    8890     * @throws InternalErrorException If there is no more token
    89      *
    90      * @return Token
    9191     */
    9292    public function getNext()
     
    134134     * Returns nex identifier token.
    135135     *
     136     * @return string The identifier token value
     137     *
    136138     * @throws SyntaxErrorException If next token is not an identifier
    137      *
    138      * @return string The identifier token value
    139139     */
    140140    public function getNextIdentifier()
     
    152152     * Returns nex identifier or star delimiter token.
    153153     *
     154     * @return null|string The identifier token value or null if star found
     155     *
    154156     * @throws SyntaxErrorException If next token is not an identifier or a star delimiter
    155      *
    156      * @return null|string The identifier token value or null if star found
    157157     */
    158158    public function getNextIdentifierOrStar()
  • well-handled/trunk/.lib/symfony/css-selector/XPath/Translator.php

    r1387766 r1463492  
    269269     * @param string    $value
    270270     *
    271      * @throws ExpressionErrorException
    272      *
    273      * @return XPathExpr
     271     * @return XPathExpr
     272     *
     273     * @throws ExpressionErrorException
    274274     */
    275275    public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value)
  • well-handled/trunk/.lib/xamin/handlebars.php/src/Handlebars/Handlebars.php

    • Property svn:eol-style set to native
    • Property svn:executable set to *
    r1393481 r1463492  
    11<?php
    22/**
    3  * Handlebars
     3 * This file is part of Handlebars-php
     4 * Based on mustache-php https://github.com/bobthecow/mustache.php
     5 *
     6 * PHP version 5.3
    47 *
    58 * @category  Xamin
     
    710 * @author    fzerorubigd <[email protected]>
    811 * @author    Behrooz Shabani <[email protected]>
    9  * @author    Mardix <https://github.com/mardix>
     12 * @author    Jeff Turcotte <[email protected]>
     13 * @author    Mária Šormanová <[email protected]>
     14 * @copyright 2010-2012 (c) Justin Hileman
    1015 * @copyright 2012 (c) ParsPooyesh Co
    1116 * @copyright 2013 (c) Behrooz Shabani
    12  * @copyright 2014 (c) Mardix
    13  * @license   MIT
    14  * @link      http://voodoophp.org/docs/handlebars
     17 * @license   MIT <http://opensource.org/licenses/MIT>
     18 * @version   GIT: $Id$
     19 * @link      http://xamin.ir
    1520 */
    1621
     
    1823use Handlebars\Loader\StringLoader;
    1924use Handlebars\Cache\Dummy;
    20 use InvalidArgumentException;
    21 
     25
     26/**
     27 * Handlebars template engine, based on mustache.
     28 *
     29 * @category  Xamin
     30 * @package   Handlebars
     31 * @author    fzerorubigd <[email protected]>
     32 * @copyright 2012 (c) ParsPooyesh Co
     33 * @license   MIT <http://opensource.org/licenses/MIT>
     34 * @version   Release: @package_version@
     35 * @link      http://xamin.ir
     36 */
    2237
    2338class Handlebars
    2439{
    25     private static $instance = null;
    26     const VERSION = '2.2';
     40    private static $_instance = false;
     41    const VERSION = '1.1.0';
    2742
    2843    /**
     
    3550    public static function factory($options = array())
    3651    {
    37         if (! self::$instance) {
    38             self::$instance = new self($options);
    39         }
    40 
    41         return self::$instance;
     52        if (self::$_instance === false) {
     53            self::$_instance = new Handlebars($options);
     54        }
     55
     56        return self::$_instance;
    4257    }
    4358
     
    4560     * @var Tokenizer
    4661     */
    47     private $tokenizer;
     62    private $_tokenizer;
    4863
    4964    /**
    5065     * @var Parser
    5166     */
    52     private $parser;
     67    private $_parser;
    5368
    5469    /**
    5570     * @var Helpers
    5671     */
    57     private $helpers;
     72    private $_helpers;
    5873
    5974    /**
    6075     * @var Loader
    6176     */
    62     private $loader;
     77    private $_loader;
    6378
    6479    /**
    6580     * @var Loader
    6681     */
    67     private $partialsLoader;
     82    private $_partialsLoader;
    6883
    6984    /**
    7085     * @var Cache
    7186     */
    72     private $cache;
     87    private $_cache;
     88
     89    /**
     90     * @var int time to live parameter in seconds for the cache usage
     91     *          default set to 0 which means that entries stay in cache
     92     *          forever and are never purged
     93     */
     94    private $_ttl = 0;
     95
     96    /**
     97     * @var string the class to use for the template
     98     */
     99    private $_templateClass = 'Handlebars\\Template';
    73100
    74101    /**
    75102     * @var callable escape function to use
    76103     */
    77     private $escape = 'htmlspecialchars';
     104    private $_escape = 'htmlspecialchars';
    78105
    79106    /**
    80107     * @var array parametes to pass to escape function
    81108     */
    82     private $escapeArgs = array(
     109    private $_escapeArgs = array(
    83110        ENT_COMPAT,
    84111        'UTF-8'
    85112    );
    86113
    87     private $aliases = array();
     114    private $_aliases = array();
    88115
    89116    /**
     
    96123     * partials_loader => Loader object
    97124     * cache          => Cache object
     125     * template_class => the class to use for the template object
    98126     *
    99127     * @param array $options array of options to set
     
    101129     * @throws \InvalidArgumentException
    102130     */
    103     public function __construct(Array $options = [])
     131    public function __construct(array $options = array())
    104132    {
    105133        if (isset($options['helpers'])) {
     
    119147        }
    120148
     149        if (isset($options['ttl'])) {
     150            $this->setTtl($options['ttl']);
     151        }
     152
     153        if (isset($options['template_class'])) {
     154            $this->setTemplateClass($options['template_class']);
     155        }
     156
    121157        if (isset($options['escape'])) {
    122158            if (!is_callable($options['escape'])) {
    123                 throw new InvalidArgumentException(
     159                throw new \InvalidArgumentException(
    124160                    'Handlebars Constructor "escape" option must be callable'
    125161                );
    126162            }
    127             $this->escape = $options['escape'];
     163
     164            $this->_escape = $options['escape'];
    128165        }
    129166
     
    132169                $options['escapeArgs'] = array($options['escapeArgs']);
    133170            }
    134             $this->escapeArgs = $options['escapeArgs'];
     171            $this->_escapeArgs = $options['escapeArgs'];
    135172        }
    136173
     
    138175            && is_array($options['partials_alias'])
    139176        ) {
    140             $this->aliases = $options['partials_alias'];
    141         }
    142     }
    143 
     177            $this->_aliases = $options['partials_alias'];
     178        }
     179    }
    144180
    145181
     
    151187     * @param string $template template name
    152188     * @param mixed  $data     data to use as context
     189     *
    153190     * @return string Rendered template
     191     * @see Handlebars::loadTemplate
     192     * @see Template::render
    154193     */
    155194    public function render($template, $data)
     
    157196        return $this->loadTemplate($template)->render($data);
    158197    }
    159     /**
    160      * To invoke when this object is called as a function
    161      *
    162      * @param string $template template name
    163      * @param mixed  $data     data to use as context
    164      * @return string Rendered template
    165      */
    166     public function __invoke($template, $data)
    167     {
    168         return $this->render($template, $data);
    169     }
    170198
    171199    /**
     
    178206    public function setHelpers(Helpers $helpers)
    179207    {
    180         $this->helpers = $helpers;
     208        $this->_helpers = $helpers;
    181209    }
    182210
     
    188216    public function getHelpers()
    189217    {
    190         if (!isset($this->helpers)) {
    191             $this->helpers = new Helpers();
    192         }
    193         return $this->helpers;
     218        if (!isset($this->_helpers)) {
     219            $this->_helpers = new Helpers();
     220        }
     221
     222        return $this->_helpers;
    194223    }
    195224
     
    211240     *
    212241     * @param string $name helper name
     242     *
    213243     * @return callable Helper
    214244     */
     
    222252     *
    223253     * @param string $name helper name
     254     *
    224255     * @return boolean True if the helper is present
    225256     */
     
    233264     *
    234265     * @param string $name helper name
     266     *
    235267     * @return void
    236268     */
     
    244276     *
    245277     * @param Loader $loader handlebars loader
     278     *
    246279     * @return void
    247280     */
    248281    public function setLoader(Loader $loader)
    249282    {
    250         $this->loader = $loader;
     283        $this->_loader = $loader;
    251284    }
    252285
     
    258291    public function getLoader()
    259292    {
    260         if (! isset($this->loader)) {
    261             $this->loader = new StringLoader();
    262         }
    263         return $this->loader;
     293        if (!isset($this->_loader)) {
     294            $this->_loader = new StringLoader();
     295        }
     296
     297        return $this->_loader;
    264298    }
    265299
     
    268302     *
    269303     * @param Loader $loader handlebars loader
     304     *
    270305     * @return void
    271306     */
    272307    public function setPartialsLoader(Loader $loader)
    273308    {
    274         $this->partialsLoader = $loader;
     309        $this->_partialsLoader = $loader;
    275310    }
    276311
     
    282317    public function getPartialsLoader()
    283318    {
    284         if (!isset($this->partialsLoader)) {
    285             $this->partialsLoader = new StringLoader();
    286         }
    287         return $this->partialsLoader;
     319        if (!isset($this->_partialsLoader)) {
     320            $this->_partialsLoader = new StringLoader();
     321        }
     322
     323        return $this->_partialsLoader;
    288324    }
    289325
     
    292328     *
    293329     * @param Cache $cache handlebars cache
     330     *
    294331     * @return void
    295332     */
    296333    public function setCache(Cache $cache)
    297334    {
    298         $this->cache = $cache;
     335        $this->_cache = $cache;
    299336    }
    300337
     
    306343    public function getCache()
    307344    {
    308         if (!isset($this->cache)) {
    309             $this->cache = new Dummy();
    310         }
    311         return $this->cache;
     345        if (!isset($this->_cache)) {
     346            $this->_cache = new Dummy();
     347        }
     348
     349        return $this->_cache;
     350    }
     351
     352    /**
     353     * Set time to live for the used cache
     354     *
     355     * @param int $ttl time to live in seconds
     356     *
     357     * @return void
     358     */
     359    public function setTtl($ttl)
     360    {
     361        $this->_ttl = $ttl;
     362    }
     363
     364    /**
     365     * Get ttl
     366     *
     367     * @return int
     368     */
     369    public function getTtl()
     370    {
     371        return $this->_ttl;
    312372    }
    313373
     
    319379    public function getEscape()
    320380    {
    321         return $this->escape;
     381        return $this->_escape;
    322382    }
    323383
     
    326386     *
    327387     * @param callable $escape function
     388     *
    328389     * @throws \InvalidArgumentException
    329390     * @return void
     
    332393    {
    333394        if (!is_callable($escape)) {
    334             throw new InvalidArgumentException(
     395            throw new \InvalidArgumentException(
    335396                'Escape function must be a callable'
    336397            );
    337398        }
    338         $this->escape = $escape;
     399        $this->_escape = $escape;
    339400    }
    340401
     
    346407    public function getEscapeArgs()
    347408    {
    348         return $this->escapeArgs;
     409        return $this->_escapeArgs;
    349410    }
    350411
     
    353414     *
    354415     * @param array $escapeArgs arguments to pass as extra arg to function
     416     *
    355417     * @return void
    356418     */
    357419    public function setEscapeArgs($escapeArgs)
    358420    {
    359         if (! is_array($escapeArgs)) {
     421        if (!is_array($escapeArgs)) {
    360422            $escapeArgs = array($escapeArgs);
    361423        }
    362         $this->escapeArgs = $escapeArgs;
     424        $this->_escapeArgs = $escapeArgs;
    363425    }
    364426
     
    368430     *
    369431     * @param Tokenizer $tokenizer tokenizer
     432     *
    370433     * @return void
    371434     */
    372435    public function setTokenizer(Tokenizer $tokenizer)
    373436    {
    374         $this->tokenizer = $tokenizer;
     437        $this->_tokenizer = $tokenizer;
    375438    }
    376439
     
    385448    public function getTokenizer()
    386449    {
    387         if (! isset($this->tokenizer)) {
    388             $this->tokenizer = new Tokenizer();
    389         }
    390 
    391         return $this->tokenizer;
     450        if (!isset($this->_tokenizer)) {
     451            $this->_tokenizer = new Tokenizer();
     452        }
     453
     454        return $this->_tokenizer;
    392455    }
    393456
     
    396459     *
    397460     * @param Parser $parser parser object
     461     *
    398462     * @return void
    399463     */
    400464    public function setParser(Parser $parser)
    401465    {
    402         $this->parser = $parser;
     466        $this->_parser = $parser;
    403467    }
    404468
     
    413477    public function getParser()
    414478    {
    415         if (! isset($this->parser)) {
    416             $this->parser = new Parser();
    417         }
    418         return $this->parser;
     479        if (!isset($this->_parser)) {
     480            $this->_parser = new Parser();
     481        }
     482
     483        return $this->_parser;
     484    }
     485
     486    /**
     487     * Sets the class to use for the template object
     488     *
     489     * @param string $class the class name
     490     *
     491     * @return void
     492     */
     493    public function setTemplateClass($class)
     494    {
     495        if (!is_a($class, 'Handlebars\\Template', true)) {
     496            throw new \InvalidArgumentException(
     497                sprintf(
     498                    'Custom template class "%s" must extend Template',
     499                    $class
     500                )
     501            );
     502        }
     503
     504        $this->_templateClass = $class;
    419505    }
    420506
     
    429515    {
    430516        $source = $this->getLoader()->load($name);
    431         $tree = $this->tokenize($source);
    432         return new Template($this, $tree, $source);
     517        $tree = $this->_tokenize($source);
     518
     519        return new $this->_templateClass($this, $tree, $source);
    433520    }
    434521
     
    442529    public function loadPartial($name)
    443530    {
    444         if (isset($this->aliases[$name])) {
    445             $name = $this->aliases[$name];
     531        if (isset($this->_aliases[$name])) {
     532            $name = $this->_aliases[$name];
    446533        }
    447534        $source = $this->getPartialsLoader()->load($name);
    448         $tree = $this->tokenize($source);
    449         return new Template($this, $tree, $source);
     535        $tree = $this->_tokenize($source);
     536
     537        return new $this->_templateClass($this, $tree, $source);
    450538    }
    451539
     
    455543     * @param string $alias   Partial alias
    456544     * @param string $content The real value
     545     *
    457546     * @return void
    458547     */
    459548    public function registerPartial($alias, $content)
    460549    {
    461         $this->aliases[$alias] = $content;
     550        $this->_aliases[$alias] = $content;
    462551    }
    463552
     
    466555     *
    467556     * @param string $alias Partial alias
     557     *
    468558     * @return void
    469559     */
    470560    public function unRegisterPartial($alias)
    471561    {
    472         if (isset($this->aliases[$alias])) {
    473             unset($this->aliases[$alias]);
     562        if (isset($this->_aliases[$alias])) {
     563            unset($this->_aliases[$alias]);
    474564        }
    475565    }
     
    479569     *
    480570     * @param string $source string to load
     571     *
    481572     * @return Template
    482573     */
    483574    public function loadString($source)
    484575    {
    485         $tree = $this->tokenize($source);
    486         return new Template($this, $tree, $source);
    487     }
    488 
    489     /**
    490      * try to tokenize source, or get them from cache if available
     576        $tree = $this->_tokenize($source);
     577
     578        return new $this->_templateClass($this, $tree, $source);
     579    }
     580
     581    /**
     582     * Try to tokenize source, or get them from cache if available
    491583     *
    492584     * @param string $source handlebars source code
     585     *
    493586     * @return array handlebars parsed data into array
    494587     */
    495     private function tokenize($source)
     588    private function _tokenize($source)
    496589    {
    497590        $hash = md5(sprintf('version: %s, data : %s', self::VERSION, $source));
     
    500593            $tokens = $this->getTokenizer()->scan($source);
    501594            $tree = $this->getParser()->parse($tokens);
    502             $this->getCache()->set($hash, $tree);
    503         }
     595            $this->getCache()->set($hash, $tree, $this->_ttl);
     596        }
     597
    504598        return $tree;
    505599    }
  • well-handled/trunk/.lib/xamin/handlebars.php/src/Handlebars/Loader/FilesystemLoader.php

    • Property svn:eol-style set to native
    r1393481 r1463492  
    11<?php
     2
    23/**
     4 * This file is part of Handlebars-php
     5 * Base on mustache-php https://github.com/bobthecow/mustache.php
     6 *
     7 * PHP version 5.3
    38 *
    49 * @category  Xamin
     
    813 * @author    Craig Bass <[email protected]>
    914 * @author    ^^         <[email protected]>
     15 * @author    Dave Stein <[email protected]>
     16 * @copyright 2010-2012 (c) Justin Hileman
    1017 * @copyright 2012 (c) ParsPooyesh Co
    1118 * @copyright 2013 (c) Behrooz Shabani
    12  * @license   MIT
    13  * @link      http://voodoophp.org/docs/handlebars
     19 * @license   MIT <http://opensource.org/licenses/MIT>
     20 * @version   GIT: $Id$
     21 * @link      http://xamin.ir
    1422 */
    1523
    1624namespace Handlebars\Loader;
     25
    1726use Handlebars\Loader;
    18 use Handlebars\String;
    19 
     27use Handlebars\StringWrapper;
     28
     29/**
     30 * Handlebars Template filesystem Loader implementation.
     31 *
     32 * @category  Xamin
     33 * @package   Handlebars
     34 * @author    fzerorubigd <[email protected]>
     35 * @copyright 2010-2012 (c) Justin Hileman
     36 * @copyright 2012 (c) ParsPooyesh Co
     37 * @license   MIT <http://opensource.org/licenses/MIT>
     38 * @version   Release: @package_version@
     39 * @link      http://xamin.ir *
     40 */
    2041
    2142class FilesystemLoader implements Loader
    2243{
    23     private $_baseDir;
     44    protected $baseDir;
    2445    private $_extension = '.handlebars';
    2546    private $_prefix = '';
     
    4162     * @throws \RuntimeException if $baseDir does not exist.
    4263     */
    43     public function __construct($baseDirs, Array $options = [])
     64    public function __construct($baseDirs, array $options = array())
     65    {
     66        $this->setBaseDir($baseDirs);
     67        $this->handleOptions($options);
     68    }
     69
     70    /**
     71     * Load a Template by name.
     72     *
     73     *     $loader = new FilesystemLoader(dirname(__FILE__).'/views');
     74     *     // loads "./views/admin/dashboard.handlebars";
     75     *     $loader->load('admin/dashboard');
     76     *
     77     * @param string $name template name
     78     *
     79     * @return StringWrapper Handlebars Template source
     80     */
     81    public function load($name)
     82    {
     83        if (!isset($this->_templates[$name])) {
     84            $this->_templates[$name] = $this->loadFile($name);
     85        }
     86
     87        return new StringWrapper($this->_templates[$name]);
     88    }
     89
     90    /**
     91     * Sets directories to load templates from
     92     *
     93     * @param string|array $baseDirs A path contain template files or array of paths
     94     *
     95     * @return void
     96     */
     97    protected function setBaseDir($baseDirs)
    4498    {
    4599        if (is_string($baseDirs)) {
    46             $baseDirs = array(rtrim(realpath($baseDirs), '/'));
     100            $baseDirs = array($this->sanitizeDirectory($baseDirs));
    47101        } else {
    48102            foreach ($baseDirs as &$dir) {
    49                 $dir = rtrim(realpath($dir), '/');
    50             } unset( $dir );
    51         }
    52 
    53         $this->_baseDir = $baseDirs;
    54 
    55         foreach ($this->_baseDir as $dir) {
     103                $dir = $this->sanitizeDirectory($dir);
     104            }
     105            unset($dir);
     106        }
     107
     108        foreach ($baseDirs as $dir) {
    56109            if (!is_dir($dir)) {
    57110                throw new \RuntimeException(
     
    61114        }
    62115
     116        $this->baseDir = $baseDirs;
     117    }
     118
     119    /**
     120     * Puts directory into standardized format
     121     *
     122     * @param String $dir The directory to sanitize
     123     *
     124     * @return String
     125     */
     126    protected function sanitizeDirectory($dir)
     127    {
     128        return rtrim(realpath($dir), '/');
     129    }
     130
     131    /**
     132     * Sets properties based on options
     133     *
     134     * @param array $options Array of Loader options (default: array())
     135     *
     136     * @return void
     137     */
     138    protected function handleOptions(array $options = array())
     139    {
    63140        if (isset($options['extension'])) {
    64141            $this->_extension = '.' . ltrim($options['extension'], '.');
     
    71148
    72149    /**
    73      * Load a Template by name.
    74      *
    75      *     $loader = new FilesystemLoader(dirname(__FILE__).'/views');
    76      *     // loads "./views/admin/dashboard.handlebars";
    77      *     $loader->load('admin/dashboard');
    78      *
    79      * @param string $name template name
    80      *
    81      * @return String Handlebars Template source
    82      */
    83     public function load($name)
    84     {
    85         if (!isset($this->_templates[$name])) {
    86             $this->_templates[$name] = $this->loadFile($name);
    87         }
    88 
    89         return new String($this->_templates[$name]);
    90     }
    91 
    92     /**
    93150     * Helper function for loading a Handlebars file by name.
    94151     *
     
    118175    protected function getFileName($name)
    119176    {
    120         foreach ($this->_baseDir as $baseDir) {
     177        foreach ($this->baseDir as $baseDir) {
    121178            $fileName = $baseDir . '/';
    122179            $fileParts = explode('/', $name);
  • well-handled/trunk/.lib/xamin/handlebars.php/src/Handlebars/Tokenizer.php

    • Property svn:eol-style set to native
    r1393481 r1463492  
    11<?php
     2/**
     3 * This file is part of Mustache.php.
     4 * For the full copyright and license information, please view the LICENSE
     5 * file that was distributed with this source code.
     6 * Changes to match xamin-std and handlebars made by xamin team
     7 *
     8 * PHP version 5.3
     9 *
     10 * @category  Xamin
     11 * @package   Handlebars
     12 * @author    Justin Hileman <[email protected]>
     13 * @author    fzerorubigd <[email protected]>
     14 * @author    Behrooz Shabani <[email protected]>
     15 * @author    Dmitriy Simushev <[email protected]>
     16 * @copyright 2010-2012 (c) Justin Hileman
     17 * @copyright 2012 (c) ParsPooyesh Co
     18 * @copyright 2013 (c) Behrooz Shabani
     19 * @license   MIT <http://opensource.org/licenses/mit-license.php>
     20 * @version   GIT: $Id$
     21 * @link      http://xamin.ir
     22 */
     23
     24namespace Handlebars;
     25
    226/**
    327 * Handlebars tokenizer (based on mustache)
     
    731 * @author    Justin Hileman <[email protected]>
    832 * @author    fzerorubigd <[email protected]>
    9  * @author    Behrooz Shabani <[email protected]>
    10  * @author    Mardix <https://github.com/mardix>
    11  * @copyright 2012 (c) ParsPooyesh Co
    12  * @copyright 2013 (c) Behrooz Shabani
    13  * @copyright 2013 (c) Mardix
    14  * @license   MIT
    15  * @link      http://voodoophp.org/docs/handlebars
     33 * @copyright 2012 Justin Hileman
     34 * @license   MIT <http://opensource.org/licenses/mit-license.php>
     35 * @version   Release: @package_version@
     36 * @link      http://xamin.ir
    1637 */
    17 
    18 namespace Handlebars;
    1938
    2039class Tokenizer
     
    3958    const T_UNESCAPED_2 = '&';
    4059    const T_TEXT = '_t';
     60    const T_ESCAPE = "\\";
     61    const T_SINGLE_Q = "'";
     62    const T_DOUBLE_Q = "\"";
     63    const T_TRIM = "~";
    4164
    4265    // Valid token types
    43     private $tagTypes = [
     66    private static $_tagTypes = array(
    4467        self::T_SECTION => true,
    4568        self::T_INVERTED => true,
     
    5275        self::T_UNESCAPED => true,
    5376        self::T_UNESCAPED_2 => true,
    54     ];
     77    );
    5578
    5679    // Interpolated tags
    57     private $interpolatedTags = [
     80    private static $_interpolatedTags = array(
    5881        self::T_ESCAPED => true,
    5982        self::T_UNESCAPED => true,
    6083        self::T_UNESCAPED_2 => true,
    61     ];
     84    );
    6285
    6386    // Token properties
     
    7295    const VALUE = 'value';
    7396    const ARGS = 'args';
     97    const TRIM_LEFT = 'tleft';
     98    const TRIM_RIGHT = 'tright';
    7499
    75100    protected $state;
    76101    protected $tagType;
    77102    protected $tag;
    78     protected $buffer;
     103    protected $buffer = '';
    79104    protected $tokens;
    80105    protected $seenTag;
     
    82107    protected $otag;
    83108    protected $ctag;
     109    protected $escaped;
     110    protected $escaping;
     111    protected $trimLeft;
     112    protected $trimRight;
    84113
    85114    /**
    86115     * Scan and tokenize template source.
    87116     *
    88      * @param string $text       Mustache template source to tokenize
    89      * @param string $delimiters Optional, pass opening and closing delimiters
     117     * @param string $text Mustache template source to tokenize
     118     *
     119     * @internal string $delimiters Optional, pass opening and closing delimiters
    90120     *
    91121     * @return array Set of Mustache tokens
    92122     */
    93     public function scan($text, $delimiters = null)
    94     {
    95         if ($text instanceof String) {
     123    public function scan($text/*, $delimiters = null*/)
     124    {
     125        if ($text instanceof StringWrapper) {
    96126            $text = $text->getString();
    97127        }
    98128        $this->reset();
    99129
     130        /* Actually we not support this. so this code is not used at all, yet.
    100131        if ($delimiters = trim($delimiters)) {
    101132            list($otag, $ctag) = explode(' ', $delimiters);
     
    103134            $this->ctag = $ctag;
    104135        }
    105 
     136        */
    106137        $len = strlen($text);
    107138        for ($i = 0; $i < $len; $i++) {
     139            $this->escaping = $this->tagChange(self::T_ESCAPE, $text, $i);
     140
     141            // To play nice with helpers' arguments quote and apostrophe marks
     142            // should be additionally escaped only when they are not in a tag.
     143            $quoteInTag = $this->state != self::IN_TEXT
     144                && ($text[$i] == self::T_SINGLE_Q || $text[$i] == self::T_DOUBLE_Q);
     145
     146            if ($this->escaped && !$this->tagChange($this->otag, $text, $i) && !$quoteInTag) {
     147                $this->buffer .= "\\";
     148            }
     149
    108150            switch ($this->state) {
    109151            case self::IN_TEXT:
    110                 if ($this->tagChange($this->otag, $text, $i)) {
     152                // Handlebars.js does not think that openning curly brace in
     153                // "\\\{{data}}" template is escaped. Instead it removes one
     154                // slash and leaves others "as is". To emulate similar behavior
     155                // we have to check the last character in the buffer. If it's a
     156                // slash we actually does not need to escape openning curly
     157                // brace.
     158                $prev_slash = substr($this->buffer, -1) == '\\';
     159
     160                if ($this->tagChange($this->otag. self::T_TRIM, $text, $i) and (!$this->escaped || $prev_slash)) {
     161                    $this->flushBuffer();
     162                    $this->state = self::IN_TAG_TYPE;
     163                    $this->trimLeft = true;
     164                } elseif ($this->tagChange(self::T_UNESCAPED.$this->otag, $text, $i) and $this->escaped) {
     165                    $this->buffer .= "{{{";
     166                    $i += 2;
     167                    continue;
     168                } elseif ($this->tagChange($this->otag, $text, $i) and (!$this->escaped || $prev_slash)) {
    111169                    $i--;
    112170                    $this->flushBuffer();
    113171                    $this->state = self::IN_TAG_TYPE;
    114                 } else {
     172                } elseif ($this->escaped and $this->escaping) {
     173                    // We should not add extra slash before opening tag because
     174                    // doubled slash where should be transformed to single one
     175                    if (($i + 1) < $len && !$this->tagChange($this->otag, $text, $i + 1)) {
     176                        $this->buffer .= "\\";
     177                    }
     178                } elseif (!$this->escaping) {
    115179                    if ($text[$i] == "\n") {
    116180                        $this->filterLine();
     
    124188
    125189                $i += strlen($this->otag) - 1;
    126                 if (isset($this->tagTypes[$text[$i + 1]])) {
     190                if (isset(self::$_tagTypes[$text[$i + 1]])) {
    127191                    $tag = $text[$i + 1];
    128192                    $this->tagType = $tag;
     
    145209
    146210            default:
     211                if ($this->tagChange(self::T_TRIM . $this->ctag, $text, $i)) {
     212                    $this->trimRight = true;
     213                    continue;
     214                }
    147215                if ($this->tagChange($this->ctag, $text, $i)) {
    148216                    // Sections (Helpers) can accept parameters
    149217                    // Same thing for Partials (little known fact)
    150                     if (in_array($this->tagType, [
    151                                     self::T_SECTION,
    152                                     self::T_PARTIAL,
    153                                     self::T_PARTIAL_2]
    154                             )) {
     218                    if (($this->tagType == self::T_SECTION)
     219                        || ($this->tagType == self::T_PARTIAL)
     220                        || ($this->tagType == self::T_PARTIAL_2)
     221                    ) {
    155222                        $newBuffer = explode(' ', trim($this->buffer), 2);
    156223                        $args = '';
     
    160227                        $this->buffer = $newBuffer[0];
    161228                    }
    162                     $t = [
     229                    $t = array(
    163230                        self::TYPE => $this->tagType,
    164231                        self::NAME => trim($this->buffer),
     
    168235                            $this->seenTag - strlen($this->otag) :
    169236                            $i + strlen($this->ctag),
    170                     ];
     237                        self::TRIM_LEFT => $this->trimLeft,
     238                        self::TRIM_RIGHT => $this->trimRight
     239                    );
    171240                    if (isset($args)) {
    172241                        $t[self::ARGS] = $args;
     
    176245                    unset($args);
    177246                    $this->buffer = '';
     247                    $this->trimLeft = false;
     248                    $this->trimRight = false;
    178249                    $i += strlen($this->ctag) - 1;
    179250                    $this->state = self::IN_TEXT;
     
    181252                        if ($this->ctag == '}}') {
    182253                            $i++;
    183                         } else {
     254                        } /* else { // I can't remember why this part is here! the ctag is always }} and
    184255                            // Clean up `{{{ tripleStache }}}` style tokens.
    185256                            $lastIndex = count($this->tokens) - 1;
     
    190261                                );
    191262                            }
    192                         }
     263                        } */
    193264                    }
    194265                } else {
     
    197268                break;
    198269            }
     270
     271            $this->escaped = ($this->escaping and !$this->escaped);
    199272        }
    200273
     
    212285    {
    213286        $this->state = self::IN_TEXT;
     287        $this->escaped = false;
     288        $this->escaping = false;
    214289        $this->tagType = null;
    215290        $this->tag = null;
    216291        $this->buffer = '';
    217         $this->tokens = [];
     292        $this->tokens = array();
    218293        $this->seenTag = false;
    219294        $this->lineStart = 0;
    220295        $this->otag = '{{';
    221296        $this->ctag = '}}';
     297        $this->trimLeft = false;
     298        $this->trimRight = false;
    222299    }
    223300
     
    229306    protected function flushBuffer()
    230307    {
    231         if (!empty($this->buffer)) {
    232             $this->tokens[] = [
     308        if ($this->buffer !== '') {
     309            $this->tokens[] = array(
    233310                self::TYPE => self::T_TEXT,
    234311                self::VALUE => $this->buffer
    235             ];
     312            );
    236313            $this->buffer = '';
    237314        }
     
    248325        for ($j = $this->lineStart; $j < $tokensCount; $j++) {
    249326            $token = $this->tokens[$j];
    250             if (isset($this->tagTypes[$token[self::TYPE]])) {
    251                 if (isset($this->interpolatedTags[$token[self::TYPE]])) {
     327            if (isset(self::$_tagTypes[$token[self::TYPE]])) {
     328                if (isset(self::$_interpolatedTags[$token[self::TYPE]])) {
    252329                    return false;
    253330                }
     
    287364            }
    288365        } elseif (!$noNewLine) {
    289             $this->tokens[] = [self::TYPE => self::T_TEXT, self::VALUE => "\n"];
     366            $this->tokens[] = array(self::TYPE => self::T_TEXT, self::VALUE => "\n");
    290367        }
    291368
     
    295372
    296373    /**
    297      * Change the current Mustache delimiters. Set new `otag` and `ctag` values.
     374     * Change the current Handlebars delimiters. Set new `otag` and `ctag` values.
    298375     *
    299376     * @param string $text  Mustache template source
     
    322399     *
    323400     * @param string $tag   Current tag name
    324      * @param string $text  Mustache template source
     401     * @param string $text  Handlebars template source
    325402     * @param int    $index Current tokenizer index
    326403     *
  • well-handled/trunk/help/hook.md

    r1387766 r1463492  
    127127#### Parameters
    128128 * (string) **'recipient_email'**: the recipient email.
     129
     130
     131## Shortcodes ##
     132
     133Well-Handled templates include full support for WordPress shortcodes. Shortcode processing takes place before anything else, so any mail-specific filters and operations being applied to the HTML will be applied to the whole HTML.
     134
     135The plugin also comes with its own handy shortcodes:
     136
     137### wh-fragment
     138
     139Available to WH Pro users, this powerful shortcode allows you to embed the HTML from other WH templates. This allows you to, for example, share a common header and footer or other elements without having to duplicate a ton of code.
     140
     141    <html>
     142        [wh-fragment template="your-template-slug" /]
     143
     144#### Parameters
     145 * (string) **'template'**: the fragment's template slug.
  • well-handled/trunk/help/template.md

    r1387766 r1463492  
    55    <?php
    66    $data = [
    7                 "title"     =>  "The Title",
    8                 "url"       =>  "http://blog.com",
    9                 "author"    =>  [
    10                                     "name"  =>  "Jane",
    11                                     "email" =>  "[email protected]"
    12                                 ],
    13                 "tags"      =>  ["tech","design","email"],
    14                 "related"   =>  [
    15                                     [
    16                                         "title" =>  "Post One",
    17                                         "url"   =>  "http://blog.com/one"
    18                                     ],
    19                                     [
    20                                         "title" =>  "Post Two",
    21                                         "url"   =>  "http://blog.com/two"
    22                                     ]
    23                                 ]
    24             ];
     7        "title" => "The Title",
     8        "url" => "http://blog.com",
     9        "author" => [
     10            "name" => "Jane",
     11            "email" => "[email protected]"
     12        ],
     13        "tags" => ["tech","design","email"],
     14        "related" => [
     15            [
     16                "title" => "Post One",
     17                "url" => "http://blog.com/one"
     18            ],
     19            [
     20                "title" => "Post Two",
     21                "url" => "http://blog.com/two"
     22            ]
     23        ]
     24    ];
    2525
    2626Handlebars expressions are the basic unit of a Handlebars template. You can use them alone in a {{mustache}}, pass them to a Handlebars helper, or use them as values in hash arguments.
     
    6161## Control Structures
    6262
    63 `if/else`, `ifEqual/else`, and `unless` control structures are implemented as regular Handlebars helpers.
     63`if/else`, `ifEqual/else`, `ifGreater/else`, `ifLesser/else`, and `unless` control structures are implemented as regular Handlebars helpers.
    6464
    6565
     
    7777### IfEqual/Else
    7878
    79 `ifEqual` works the same way as `if`, except the comparison involes a specific value.
     79`ifEqual` works the same way as `if`, except the comparison involes a specific value. If the first value equals the second, Yay!, else, Nay!
    8080
    8181    {{#ifEqual mySubject "Linux"}}
     
    8484        Otherwise you get this
    8585    {{/ifEqual}}
     86
     87
     88### IfGreater/Else
     89
     90`ifGreater` returns true if your variable is greater than the passed value.
     91
     92    {{#ifGreater myAmount 0}}
     93        This part will be shown if myAmount > 0
     94    {{else}}
     95        Otherwise you get this
     96    {{/ifGreater}}
     97
     98
     99### IfLesser/Else
     100
     101`ifGreater` returns true if your variable is less than the passed value.
     102
     103    {{#ifLesser myAmount 0}}
     104        This part will be shown if myAmount < 0
     105    {{else}}
     106        Otherwise you get this
     107    {{/ifLesser}}
    86108
    87109
     
    112134    {{/each}}
    113135
     136    <!--this also works-->
     137    {{#related}}
     138        <a href="{{this.url}}">{{this.title}}</a>
     139    {{/related}}
     140
    114141
    115142### Each/Else
     
    125152
    126153
    127 ### Slice Eeach Array[start:end]
    128 
    129 The #each helper also has the ability to slice the data
    130 
    131  * {{#each Array[start:end]}} = starts at start trhough end -1
    132  * {{#each Array[start:]}} = Starts at start though the rest of the array
    133  * {{#each Array[:end]}} = Starts at the beginning through end -1
    134  * {{#each Array[:]}} = A copy of the whole array
    135  * {{#each Array[-1]}}
    136  * {{#each Array[-2:]}} = Last two items
    137  * {{#each Array[:-2]}} = Everything except last two items
    138 
    139 See the following:
    140 
    141     <h2>Article Tags:</h2>
    142     {{#each tags[0:10]}}
    143         {{.}}
    144     {{else}}
    145         This article is not about anything in particular.
    146     {{/each}}
    147 
    148 
    149 #### {{@INDEX}} and {{@KEY}}
    150 
    151 When looping through items in each, you can optionally reference the current loop index via {{@index}}
    152 
    153     {{#each array}}
    154       {{@index}}: {{this}}
    155     {{/each}}
    156 
    157     {{#each object}}
    158       {{@key}}: {{this}}
    159     {{/each}}
    160 
    161 
    162 ---
    163 
     154
     155---
    164156
    165157## Change Context: With
     
    169161    <?php
    170162    $data = [
    171                 "genres"    =>  ["Hip-Hop", "Rap", "Techno", "Country"],
    172                 "other"     =>  [
    173                                     "genres"    => ["Hip-Hop", "Rap", "Techno", "Country"]
    174                                 ]
    175             ];
     163        "genres" => ["Hip-Hop", "Rap", "Techno", "Country"],
     164        "other" => [
     165            "genres" => ["Rock", "Classical", "Opera", "Showtunes"]
     166        ]
     167    ];
    176168
    177169---
     
    204196    {{else}}
    205197        Otherwise you get this
    206     {{/if}}
     198    {{/ifEqual}}
     199
     200### IfGreater
     201
     202    {{#ifGreater amount 0}}
     203        This part will show if amount > 0
     204    {{else}}
     205        Otherwise you get this
     206    {{/ifGreater}}
     207
     208### IfLesser
     209
     210    {{#ifLesser amount 0}}
     211        This part will show if amount < 0
     212    {{else}}
     213        Otherwise you get this
     214    {{/ifLesser}}
    207215
    208216### Unless
     
    230238    {{/with}}
    231239
    232 ### Upper
    233 
    234 To format string to uppercase.
    235 
    236     {{#upper title}}
     240### Avg
     241
     242Return the average value from an array of numbers.
     243
     244    {{#avg myarray}}
     245
     246### Capitalize
     247
     248To capitalize the first letter.
     249
     250    {{#capitalize title}}
     251
     252### Capitalize_Words
     253
     254To capitalize the first letter of each word in a string.
     255
     256    {{#capitalize_words title}}
     257
     258### Count
     259
     260Count the number of items in an array.
     261
     262    {{#count myarray}}
     263
     264### Currency
     265
     266Turn a number into USD currecy format, e.g. 2.4 -> $2.40.
     267
     268    {{#currency number}}
     269
     270### Date
     271
     272Format a date using PHP's [$format](http://php.net/manual/en/function.date.php) guidelines.
     273
     274    {{#date date 'Y-m-d H:i:s'}}
     275
     276### Default
     277
     278To use a default value if the string is empty: `{{#default title $defaultValue}}`.
     279
     280    {{#default title 'No title'}}
     281
     282### Format_Date
     283
     284Alias of #date.
     285
     286### Inflect
     287
     288To singularize or plurialize words based on count `{{#inflect count $singular $plurial}}`
     289
     290    {{#inflect count '%d book' '%d books'}}
     291
     292### Join
     293
     294Join the values of an array with a defined delimiter.
     295
     296    {{#join myarray ', '}}
    237297
    238298### Lower
     
    242302    {{#lower title}}
    243303
    244 ### Capitalize
    245 
    246 To capitalize the first letter.
    247 
    248     {{#capitalize title}}
    249 
    250 ### Capitalize_Words
    251 
    252 To capitalize each words in a string.
    253 
    254     {{#capitalize_words title}}
    255 
    256 ### Reverse
    257 
    258 To reverse the order of string.
    259 
    260     {{#reverse title}}
    261 
    262 ### Format_Date
    263 
    264 Format a date using PHP's [$format](http://php.net/manual/en/function.date.php) guidelines.
    265 
    266     {{#format_date date 'Y-m-d H:i:s'}}
    267 
    268 ### Inflect
    269 
    270 To singularize or plurialize words based on count `{{#inflect count $singular $plurial}}`
    271 
    272     {{#inflect count '%d book' '%d books'}}
    273 
    274 ### Truncate
    275 
    276 To truncate a string: `{{#truncate title $length $ellipsis}}`
    277 
    278     {{#truncate title 21 '...'}}
    279 
    280 ### Default
    281 
    282 To use a default value if the string is empty: `{{#default title $defaultValue}}`.
    283 
    284     {{#default title 'No title'}}
     304### Max
     305
     306Return the maximum value from an array.
     307
     308    {{#max myarray}}
     309
     310### Min
     311
     312Return the minimum value from an array.
     313
     314    {{#min myarray}}
     315
     316### Nl2Br
     317
     318Converts \n \r newlines into HTML linebreaks.
     319
     320    {{#nl2br myparagraph}}
     321
     322### Now
     323
     324Return the current blog time, optionally formatted using PHP's [$format](http://php.net/manual/en/function.date.php) guidelines.
     325
     326    {{#now 'Y-m-d'}}
    285327
    286328### Raw
     
    289331
    290332    {{#raw}}
    291         {{#each cars}}
    292             {{model}}
    293         {{/each}}
     333        {{Curly brackets will print!}}
    294334    {{/raw}}
    295 
    296     <!--
    297     {{#each cars}}
    298         {{model}}
    299     {{/each}}
    300     -->
    301335
    302336### Repeat
     
    314348    {{/repeat}}
    315349
     350### Reverse
     351
     352To reverse the order of string.
     353
     354    {{#reverse title}}
     355
     356### Sum
     357
     358Return the sum of numbers from an array.
     359
     360    {{#sum myarray}}
     361
     362### Truncate
     363
     364To truncate a string: `{{#truncate title $length $ellipsis}}`
     365
     366    {{#truncate title 21 '...'}}
     367
     368### Upper
     369
     370To format string to uppercase.
     371
     372    {{#upper title}}
     373
     374### WP_BlogInfo
     375
     376Return any WordPress [`bloginfo()`](https://developer.wordpress.org/reference/functions/get_bloginfo/) value by key.
     377
     378    {{#wp_bloginfo 'admin_email'}}
     379
     380### WP_Site_URL
     381
     382Works just like WordPress' [`site_url()`](https://developer.wordpress.org/reference/functions/site_url/) function. `$path` and `$scheme` parameters are optional.
     383
     384    {{#wp_site_url $path $scheme}}
    316385
    317386---
  • well-handled/trunk/index.php

    r1387777 r1463492  
    22/*
    33Plugin Name: Well-Handled Email Templates
    4 Plugin URI: https://wordpress.org/plugins/well-handled/
     4Plugin URI: https://well-handled.io
    55Description: Easy and powerful handlebar/mustache email template management for developers.
    6 Version: 1.0.2
     6Version: 1.5
    77Author: well-handled.io
    88Author URI: https://well-handled.io
     
    3434
    3535//our program version
    36 define('WH_VERSION',    1.0);
     36define('WH_VERSION',    1.5);
    3737define('WH_DB_VERSION', 0.4);
    3838define('WH_DB_PRODUCT', 'well-handled');
     
    7777  template_data text NOT NULL,
    7878  template_options text NOT NULL,
    79   PRIMARY KEY (id),
     79  PRIMARY KEY  (id),
    8080  UNIQUE KEY mask (mask),
    8181  KEY date_created (date_created),
     
    9898  url text NOT NULL,
    9999  clicks smallint(5) NOT NULL DEFAULT '0',
    100   PRIMARY KEY (mask),
     100  PRIMARY KEY  (mask),
    101101  KEY message_id (message_id),
    102102  KEY clicks (clicks)
     
    114114  template text NOT NULL,
    115115  error text NOT NULL,
    116   PRIMARY KEY (id),
     116  PRIMARY KEY  (id),
    117117  KEY date_created (date_created),
    118118  KEY date_created_gmt (date_created_gmt)
     
    861861
    862862//-------------------------------------------------
     863// Get Raw Template
     864//
     865// @param template_slug(s)
     866// @return content or false
     867function wh_get_raw_template($template_slug){
     868    global $wpdb;
     869
     870    //is the template valid?
     871    $templates = array_intersect(wh_get_template_slugs(), (array) $template_slug);
     872    if(!count($templates))
     873        return false;
     874
     875    //A/B testing is as easy as picking a random entry!
     876    $template_slug = $templates[array_rand($templates)];
     877
     878    //get the raw template text
     879    $raw = $wpdb->get_var("SELECT `post_content` FROM `{$wpdb->prefix}posts` WHERE `post_type`='wh-template' AND `post_status`='publish' AND `post_name`='" . esc_sql($template_slug) . "'");
     880    if(is_null($raw) || !strlen($raw))
     881        return false;
     882
     883    return $raw;
     884}
     885
     886//-------------------------------------------------
    863887// Get Template
    864888//
     
    870894    global $wpdb;
    871895
    872     //is the template valid?
    873     $templates = array_intersect(wh_get_template_slugs(), (array) $template_slug);
    874     if(!count($templates))
     896    //make sure we have a valid template
     897    if(false === ($raw = wh_get_raw_template($template_slug)))
    875898        return false;
    876899
    877     //A/B testing is as easy as picking a random entry!
    878     $template_slug = $templates[array_rand($templates)];
    879 
    880     //get the raw template text
    881     $raw = $wpdb->get_var("SELECT `post_content` FROM `{$wpdb->prefix}posts` WHERE `post_type`='wh-template' AND `post_status`='publish' AND `post_name`='" . esc_sql($template_slug) . "'");
    882     if(is_null($raw) || !strlen($raw))
    883         return false;
     900    //run shortcodes
     901    $raw = do_shortcode($raw);
    884902
    885903    wh_debug_log("working template: $template_slug");
     
    921939        try {
    922940            Handlebars\Autoloader::register();
     941            @require_once(dirname(__FILE__) . '/functions-handlebars.php');
     942            $extraHelpers = new Handlebars\Helpers(new Handlebars\WHHelpers);
    923943            $handlebars = new Handlebars\Handlebars();
    924 
    925             //we need an if-equals helper
    926             $handlebars->addHelper('ifEqual', function($template, $context, $args, $source) {
    927                 preg_match("/(.*?)\s+(?:(?:\"|\')(.*?)(?:\"|\'))/", $args, $parsed_args);
    928                 if (empty($parsed_args) || count($parsed_args) < 3) {
    929                     return '';
    930                 }
    931 
    932                 $condition = ($context->get($parsed_args[1]) == $parsed_args[2]);
    933 
    934                 if ($condition) {
    935                     $template->setStopToken('else');
    936                     $buffer = $template->render($context);
    937                     $template->setStopToken(false);
    938                 } else {
    939                     $template->setStopToken('else');
    940                     $template->discard();
    941                     $template->setStopToken(false);
    942                     $buffer = $template->render($context);
    943                 }
    944 
    945                 return $buffer;
    946             });
     944            $handlebars->getHelpers()->addHelpers($extraHelpers);
     945
    947946            $content = $handlebars->render($content, $data);
    948947
     
    13161315
    13171316//-------------------------------------------------
     1317// Filter: Escape Helpered Template HTML
     1318//
     1319// for some reason Handlebars doesn't go back over
     1320// output from helpers to do the usual escaping.
     1321//
     1322// @param str
     1323// @return str
     1324function _wh_filter_handlebar_helper($str){
     1325    return esc_html($str);
     1326}
     1327add_filter('wh_filter_handlebar_helper', '_wh_filter_handlebar_helper');
     1328
     1329//-------------------------------------------------
    13181330// debug details
    13191331//
     
    13591371}
    13601372
     1373//-------------------------------------------------
     1374// embed a fragment
     1375//
     1376// this shortcode can be used to embed content
     1377// from another template
     1378//
     1379// @param template slug
     1380// @return html or ''
     1381function wh_shortcode_embed_fragment($atts, $content=''){
     1382    //this is a pro-feature
     1383    if(!wh_is_pro())
     1384        return '';
     1385
     1386    global $wpdb;
     1387
     1388    $template_slug = isset($atts['template']) ? $atts['template'] : false;
     1389
     1390    //make sure we have a valid template
     1391    if(false === ($raw = wh_get_raw_template($template_slug)))
     1392        return false;
     1393
     1394    return do_shortcode($raw);
     1395}
     1396add_shortcode('wh-fragment', 'wh_shortcode_embed_fragment');
     1397
    13611398//--------------------------------------------------------------------- end processing
    13621399
  • well-handled/trunk/readme.txt

    r1393481 r1463492  
    44Tags: template, handlebar, mustache, css, email, transactional, analytics
    55Requires at least: 4.4
    6 Tested up to: 4.5
     6Tested up to: 4.5.3
    77Stable tag: trunk
    88License: GPLv2 or later
     
    3131
    3232== Requirements ==
    33 
    34 Well-Handled needs a little bit more than WordPress itself:
    3533
    3634 * WordPress 4.4+
     
    6967== Changelog ==
    7068
     69= 1.5 =
     70* [new] Fragment support (e.g. common template parts);
     71* [new] Added array helpers: avg, count, join, min, max, sum;
     72* [new] Added comparison helpers: ifGreater, ifLesser;
     73* [new] Added misc helpers: currency, nl2br, now, wp_bloginfo, wp_site_url;
     74* [improved] Full overhaul of Handlebar parsing;
     75* [improved] Cleaned up documentation;
     76
    7177= 1.0.2 =
    7278* Inaugural WordPress.org release!
Note: See TracChangeset for help on using the changeset viewer.