Posted: December 19, 2013 in PHP, ZF
Tags: iban, PHP, validator, zf
Often asked to me: “what is the list of countries you test for IBAN”. Most of the time, a simple “I let the framework doing it, don’t know what and how, it works” is enough. This morning, it wasn’t… !
So, if you had the same question, here is the list of supported countries within the Zend Framework 1.12:
- AD, AT,
- BA, BE, BG,
- CH, CS, CY, CZ,
- DE, DK,
- EE, ES,
- FR, FI,
- GB, GI, GR,
- HR, HU,
- IE, IS, IT,
- LI, LU, LT, LV,
- MK, MT,
- NL, NO,
- PL, PT,
- SE, SI, SK,
- TN, TR.
Any country not in this list, will raise the error Zend_Validate_Iban::NOTSUPPORTED. For the others, a regular expression is applied. For instance, here is the one for France:
This “sentence” means: begins with ‘FR’, followed by 2 figures, then 10 figures and lasts with 13 alphanumeric characters (will raise a Zend_Validate_Iban::FALSEFORMAT error in case it doesn’t match).
Finally, the IBAN key is checked (will raise a Zend_Validate_Iban::CHECKFAILED error).
Next post : how to add the list of new implemented countries in ZF2…
Posted: November 4, 2013 in Oracle, SQL
Due to some Oracle developpers’ mind,
last_day() function exists while
first_day() doesn’t, so strange!
To do so, the tip is to use
trunc() function such as:
trunc() has 2 signatures as mentioned on PSOUG.org site
, I use the signature with a date, the second argument must be the awaited format.
Here is a full example I used,
PKG_CTX_CONNEXION.getActualDate() gives the chosen date, so, to get the lines of a planning based on this date, here is the code I used for the associated view:
from T_PLANNING_WEEK plw
-- kind of first_day() synonym!
plw.DATE_FROM >= trunc(PKG_CTX_CONNEXION.getActualDate(), 'MM')
-- real last_day() function use
and plw.DATE_TO <= last_day(PKG_CTX_CONNEXION.getActualDate());
My ultimate goal was to get a “A” grade a the Yahoo! YSlow Firefox plug-in. Here are their rules: Best Practices for Speeding Up Your Web Site. All I can say is… I’ve reach this goal!
I saw the post “Compresser et ranger son CSS avec PHP“, and decided to post the solution I use for the 2 projects I work on.
You can get all the sources described and explained in this article here: minify_js.zip.
But wait, the best is yet to come!
Posted: March 15, 2010 in licence
Tags: bsd, licence, Wilfried Loche
Copyright (c) 2010, Wilfried Loche
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the Wilfried Loche nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.