This topic is locked, you cannot edit posts or make further replies.  [ 1075 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 72  Next
The All-New Improved 24hr Thread 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Tue May 05, 2009 3:29 pm
Posts: 7173
Paul1965 wrote:
Image


Keep the farmyard animals away from the thread pls. :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll: :roll:

_________________
timark_uk wrote:
That's your problem. You need Linux. That'll fix all your problems.
Mark


Wed Aug 19, 2009 9:37 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/* SVN FILE: $Id$ */

/**
* Case Folding Properties.
*
* Provides case mapping of Unicode characters for code points U+1F00 through U+1FFF
*
* @see http://www.unicode.org/Public/UNIDATA/UCD.html
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
* @see http://www.unicode.org/reports/tr21/tr21-5.html
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* The upper field is the decimal value of the upper case character
*
* The lower filed is an array of the decimal values that form the lower case version of a character.
*
* The status field is:
* C: common case folding, common mappings shared by both simple and full mappings.
* F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces.
* S: simple case folding, mappings to single characters where different from F.
* T: special case for uppercase I and dotted uppercase I
* - For non-Turkic languages, this mapping is normally not used.
* - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters.
* Note that the Turkic mappings do not maintain canonical equivalence without additional processing.
* See the discussions of case mapping in the Unicode Standard for more information.
*/
$config['1f00_1fff'][] = array('upper' => 7944, 'status' => 'C', 'lower' => array(7936, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 7945, 'status' => 'C', 'lower' => array(7937)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 7946, 'status' => 'C', 'lower' => array(7938)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7947, 'status' => 'C', 'lower' => array(7939)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7948, 'status' => 'C', 'lower' => array(7940)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7949, 'status' => 'C', 'lower' => array(7941)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7950, 'status' => 'C', 'lower' => array(7942)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 7951, 'status' => 'C', 'lower' => array(7943)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 7960, 'status' => 'C', 'lower' => array(7952)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 7961, 'status' => 'C', 'lower' => array(7953)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 7962, 'status' => 'C', 'lower' => array(7954)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7963, 'status' => 'C', 'lower' => array(7955)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7964, 'status' => 'C', 'lower' => array(7956)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7965, 'status' => 'C', 'lower' => array(7957)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7976, 'status' => 'C', 'lower' => array(7968)); /* GREEK CAPITAL LETTER ETA WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 7977, 'status' => 'C', 'lower' => array(7969)); /* GREEK CAPITAL LETTER ETA WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 7978, 'status' => 'C', 'lower' => array(7970)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7979, 'status' => 'C', 'lower' => array(7971)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7980, 'status' => 'C', 'lower' => array(7972)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7981, 'status' => 'C', 'lower' => array(7973)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7982, 'status' => 'C', 'lower' => array(7974)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 7983, 'status' => 'C', 'lower' => array(7975)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 7992, 'status' => 'C', 'lower' => array(7984)); /* GREEK CAPITAL LETTER IOTA WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 7993, 'status' => 'C', 'lower' => array(7985)); /* GREEK CAPITAL LETTER IOTA WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 7994, 'status' => 'C', 'lower' => array(7986)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7995, 'status' => 'C', 'lower' => array(7987)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 7996, 'status' => 'C', 'lower' => array(7988)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7997, 'status' => 'C', 'lower' => array(7989)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 7998, 'status' => 'C', 'lower' => array(7990)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 7999, 'status' => 'C', 'lower' => array(7991)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8008, 'status' => 'C', 'lower' => array(8000)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 8009, 'status' => 'C', 'lower' => array(8001)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 8010, 'status' => 'C', 'lower' => array(8002)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8011, 'status' => 'C', 'lower' => array(8003)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8012, 'status' => 'C', 'lower' => array(8004)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8013, 'status' => 'C', 'lower' => array(8005)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8016, 'status' => 'F', 'lower' => array(965, 787)); /* GREEK SMALL LETTER UPSILON WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 8018, 'status' => 'F', 'lower' => array(965, 787, 768)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8020, 'status' => 'F', 'lower' => array(965, 787, 769)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8022, 'status' => 'F', 'lower' => array(965, 787, 834)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8025, 'status' => 'C', 'lower' => array(8017)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 8027, 'status' => 'C', 'lower' => array(8019)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8029, 'status' => 'C', 'lower' => array(8021)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8031, 'status' => 'C', 'lower' => array(8023)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8040, 'status' => 'C', 'lower' => array(8032)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 8041, 'status' => 'C', 'lower' => array(8033)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 8042, 'status' => 'C', 'lower' => array(8034)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8043, 'status' => 'C', 'lower' => array(8035)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8044, 'status' => 'C', 'lower' => array(8036)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8045, 'status' => 'C', 'lower' => array(8037)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8046, 'status' => 'C', 'lower' => array(8038)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8047, 'status' => 'C', 'lower' => array(8039)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8064, 'status' => 'F', 'lower' => array(7936, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8065, 'status' => 'F', 'lower' => array(7937, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8066, 'status' => 'F', 'lower' => array(7938, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8067, 'status' => 'F', 'lower' => array(7939, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8068, 'status' => 'F', 'lower' => array(7940, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8069, 'status' => 'F', 'lower' => array(7941, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8070, 'status' => 'F', 'lower' => array(7942, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8071, 'status' => 'F', 'lower' => array(7943, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8072, 'status' => 'F', 'lower' => array(7936, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8072, 'status' => 'S', 'lower' => array(8064)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8073, 'status' => 'F', 'lower' => array(7937, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8073, 'status' => 'S', 'lower' => array(8065)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8074, 'status' => 'F', 'lower' => array(7938, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8074, 'status' => 'S', 'lower' => array(8066)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8075, 'status' => 'F', 'lower' => array(7939, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8075, 'status' => 'S', 'lower' => array(8067)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8076, 'status' => 'F', 'lower' => array(7940, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8076, 'status' => 'S', 'lower' => array(8068)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8077, 'status' => 'F', 'lower' => array(7941, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8077, 'status' => 'S', 'lower' => array(8069)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8078, 'status' => 'F', 'lower' => array(7942, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8078, 'status' => 'S', 'lower' => array(8070)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8079, 'status' => 'F', 'lower' => array(7943, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8079, 'status' => 'S', 'lower' => array(8071)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8080, 'status' => 'F', 'lower' => array(7968, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8081, 'status' => 'F', 'lower' => array(7969, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8082, 'status' => 'F', 'lower' => array(7970, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8083, 'status' => 'F', 'lower' => array(7971, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8084, 'status' => 'F', 'lower' => array(7972, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8085, 'status' => 'F', 'lower' => array(7973, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8086, 'status' => 'F', 'lower' => array(7974, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8087, 'status' => 'F', 'lower' => array(7975, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8088, 'status' => 'F', 'lower' => array(7968, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8088, 'status' => 'S', 'lower' => array(8080)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8089, 'status' => 'F', 'lower' => array(7969, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8089, 'status' => 'S', 'lower' => array(8081)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8090, 'status' => 'F', 'lower' => array(7970, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8090, 'status' => 'S', 'lower' => array(8082)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8091, 'status' => 'F', 'lower' => array(7971, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8091, 'status' => 'S', 'lower' => array(8083)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8092, 'status' => 'F', 'lower' => array(7972, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8092, 'status' => 'S', 'lower' => array(8084)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8093, 'status' => 'F', 'lower' => array(7973, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8093, 'status' => 'S', 'lower' => array(8085)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8094, 'status' => 'F', 'lower' => array(7974, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8094, 'status' => 'S', 'lower' => array(8086)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8095, 'status' => 'F', 'lower' => array(7975, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8095, 'status' => 'S', 'lower' => array(8087)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8096, 'status' => 'F', 'lower' => array(8032, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8097, 'status' => 'F', 'lower' => array(8033, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8098, 'status' => 'F', 'lower' => array(8034, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8099, 'status' => 'F', 'lower' => array(8035, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8100, 'status' => 'F', 'lower' => array(8036, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8101, 'status' => 'F', 'lower' => array(8037, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8102, 'status' => 'F', 'lower' => array(8038, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8103, 'status' => 'F', 'lower' => array(8039, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8104, 'status' => 'F', 'lower' => array(8032, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8104, 'status' => 'S', 'lower' => array(8096)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8105, 'status' => 'F', 'lower' => array(8033, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8105, 'status' => 'S', 'lower' => array(8097)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8106, 'status' => 'F', 'lower' => array(8034, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8106, 'status' => 'S', 'lower' => array(8098)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8107, 'status' => 'F', 'lower' => array(8035, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8107, 'status' => 'S', 'lower' => array(8099)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8108, 'status' => 'F', 'lower' => array(8036, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8108, 'status' => 'S', 'lower' => array(8100)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8109, 'status' => 'F', 'lower' => array(8037, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8109, 'status' => 'S', 'lower' => array(8101)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8110, 'status' => 'F', 'lower' => array(8038, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8110, 'status' => 'S', 'lower' => array(8102)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8111, 'status' => 'F', 'lower' => array(8039, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8111, 'status' => 'S', 'lower' => array(8103)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8114, 'status' => 'F', 'lower' => array(8048, 953)); /* GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8115, 'status' => 'F', 'lower' => array(945, 953)); /* GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8116, 'status' => 'F', 'lower' => array(940, 953)); /* GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8118, 'status' => 'F', 'lower' => array(945, 834)); /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8119, 'status' => 'F', 'lower' => array(945, 834, 953)); /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8120, 'status' => 'C', 'lower' => array(8112)); /* GREEK CAPITAL LETTER ALPHA WITH VRACHY */
$config['1f00_1fff'][] = array('upper' => 8121, 'status' => 'C', 'lower' => array(8113)); /* GREEK CAPITAL LETTER ALPHA WITH MACRON */
$config['1f00_1fff'][] = array('upper' => 8122, 'status' => 'C', 'lower' => array(8048)); /* GREEK CAPITAL LETTER ALPHA WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8123, 'status' => 'C', 'lower' => array(8049)); /* GREEK CAPITAL LETTER ALPHA WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8124, 'status' => 'F', 'lower' => array(945, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8124, 'status' => 'S', 'lower' => array(8115)); /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8126, 'status' => 'C', 'lower' => array(953)); /* GREEK PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8130, 'status' => 'F', 'lower' => array(8052, 953)); /* GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8131, 'status' => 'F', 'lower' => array(951, 953)); /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8132, 'status' => 'F', 'lower' => array(942, 953)); /* GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8134, 'status' => 'F', 'lower' => array(951, 834)); /* GREEK SMALL LETTER ETA WITH PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8135, 'status' => 'F', 'lower' => array(951, 834, 953)); /* GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8136, 'status' => 'C', 'lower' => array(8050)); /* GREEK CAPITAL LETTER EPSILON WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8137, 'status' => 'C', 'lower' => array(8051)); /* GREEK CAPITAL LETTER EPSILON WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8138, 'status' => 'C', 'lower' => array(8052)); /* GREEK CAPITAL LETTER ETA WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8139, 'status' => 'C', 'lower' => array(8053)); /* GREEK CAPITAL LETTER ETA WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8140, 'status' => 'F', 'lower' => array(951, 953)); /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8140, 'status' => 'S', 'lower' => array(8131)); /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8146, 'status' => 'F', 'lower' => array(953, 776, 768)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8147, 'status' => 'F', 'lower' => array(953, 776, 769)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8150, 'status' => 'F', 'lower' => array(953, 834)); /* GREEK SMALL LETTER IOTA WITH PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8151, 'status' => 'F', 'lower' => array(953, 776, 834)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8152, 'status' => 'C', 'lower' => array(8144)); /* GREEK CAPITAL LETTER IOTA WITH VRACHY */
$config['1f00_1fff'][] = array('upper' => 8153, 'status' => 'C', 'lower' => array(8145)); /* GREEK CAPITAL LETTER IOTA WITH MACRON */
$config['1f00_1fff'][] = array('upper' => 8154, 'status' => 'C', 'lower' => array(8054)); /* GREEK CAPITAL LETTER IOTA WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8155, 'status' => 'C', 'lower' => array(8055)); /* GREEK CAPITAL LETTER IOTA WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8162, 'status' => 'F', 'lower' => array(965, 776, 768)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA */
$config['1f00_1fff'][] = array('upper' => 8163, 'status' => 'F', 'lower' => array(965, 776, 769)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA */
$config['1f00_1fff'][] = array('upper' => 8164, 'status' => 'F', 'lower' => array(961, 787)); /* GREEK SMALL LETTER RHO WITH PSILI */
$config['1f00_1fff'][] = array('upper' => 8166, 'status' => 'F', 'lower' => array(965, 834)); /* GREEK SMALL LETTER UPSILON WITH PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8167, 'status' => 'F', 'lower' => array(965, 776, 834)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8168, 'status' => 'C', 'lower' => array(8160)); /* GREEK CAPITAL LETTER UPSILON WITH VRACHY */
$config['1f00_1fff'][] = array('upper' => 8169, 'status' => 'C', 'lower' => array(8161)); /* GREEK CAPITAL LETTER UPSILON WITH MACRON */
$config['1f00_1fff'][] = array('upper' => 8170, 'status' => 'C', 'lower' => array(8058)); /* GREEK CAPITAL LETTER UPSILON WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8171, 'status' => 'C', 'lower' => array(8059)); /* GREEK CAPITAL LETTER UPSILON WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8172, 'status' => 'C', 'lower' => array(8165)); /* GREEK CAPITAL LETTER RHO WITH DASIA */
$config['1f00_1fff'][] = array('upper' => 8178, 'status' => 'F', 'lower' => array(8060, 953)); /* GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8179, 'status' => 'F', 'lower' => array(969, 953)); /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8180, 'status' => 'F', 'lower' => array(974, 953)); /* GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8182, 'status' => 'F', 'lower' => array(969, 834)); /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI */
$config['1f00_1fff'][] = array('upper' => 8183, 'status' => 'F', 'lower' => array(969, 834, 953)); /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8184, 'status' => 'C', 'lower' => array(8056)); /* GREEK CAPITAL LETTER OMICRON WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8185, 'status' => 'C', 'lower' => array(8057)); /* GREEK CAPITAL LETTER OMICRON WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8186, 'status' => 'C', 'lower' => array(8060)); /* GREEK CAPITAL LETTER OMEGA WITH VARIA */
$config['1f00_1fff'][] = array('upper' => 8187, 'status' => 'C', 'lower' => array(8061)); /* GREEK CAPITAL LETTER OMEGA WITH OXIA */
$config['1f00_1fff'][] = array('upper' => 8188, 'status' => 'F', 'lower' => array(969, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */
$config['1f00_1fff'][] = array('upper' => 8188, 'status' => 'S', 'lower' => array(8179)); /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */
?>


Wed Aug 19, 2009 9:37 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/* SVN FILE: $Id$ */

/**
* Case Folding Properties.
*
* Provides case mapping of Unicode characters for code points U+2C00 through U+2C5F
*
* @see http://www.unicode.org/Public/UNIDATA/UCD.html
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
* @see http://www.unicode.org/reports/tr21/tr21-5.html
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.config.unicode.casefolding
* @since CakePHP(tm) v 1.2.0.5691
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* The upper field is the decimal value of the upper case character
*
* The lower filed is an array of the decimal values that form the lower case version of a character.
*
* The status field is:
* C: common case folding, common mappings shared by both simple and full mappings.
* F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces.
* S: simple case folding, mappings to single characters where different from F.
* T: special case for uppercase I and dotted uppercase I
* - For non-Turkic languages, this mapping is normally not used.
* - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters.
* Note that the Turkic mappings do not maintain canonical equivalence without additional processing.
* See the discussions of case mapping in the Unicode Standard for more information.
*/
$config['2c00_2c5f'][] = array('upper' => 11264, 'status' => 'C', 'lower' => array(11312)); /* GLAGOLITIC CAPITAL LETTER AZU */
$config['2c00_2c5f'][] = array('upper' => 11265, 'status' => 'C', 'lower' => array(11313)); /* GLAGOLITIC CAPITAL LETTER BUKY */
$config['2c00_2c5f'][] = array('upper' => 11266, 'status' => 'C', 'lower' => array(11314)); /* GLAGOLITIC CAPITAL LETTER VEDE */
$config['2c00_2c5f'][] = array('upper' => 11267, 'status' => 'C', 'lower' => array(11315)); /* GLAGOLITIC CAPITAL LETTER GLAGOLI */
$config['2c00_2c5f'][] = array('upper' => 11268, 'status' => 'C', 'lower' => array(11316)); /* GLAGOLITIC CAPITAL LETTER DOBRO */
$config['2c00_2c5f'][] = array('upper' => 11269, 'status' => 'C', 'lower' => array(11317)); /* GLAGOLITIC CAPITAL LETTER YESTU */
$config['2c00_2c5f'][] = array('upper' => 11270, 'status' => 'C', 'lower' => array(11318)); /* GLAGOLITIC CAPITAL LETTER ZHIVETE */
$config['2c00_2c5f'][] = array('upper' => 11271, 'status' => 'C', 'lower' => array(11319)); /* GLAGOLITIC CAPITAL LETTER DZELO */
$config['2c00_2c5f'][] = array('upper' => 11272, 'status' => 'C', 'lower' => array(11320)); /* GLAGOLITIC CAPITAL LETTER ZEMLJA */
$config['2c00_2c5f'][] = array('upper' => 11273, 'status' => 'C', 'lower' => array(11321)); /* GLAGOLITIC CAPITAL LETTER IZHE */
$config['2c00_2c5f'][] = array('upper' => 11274, 'status' => 'C', 'lower' => array(11322)); /* GLAGOLITIC CAPITAL LETTER INITIAL IZHE */
$config['2c00_2c5f'][] = array('upper' => 11275, 'status' => 'C', 'lower' => array(11323)); /* GLAGOLITIC CAPITAL LETTER I */
$config['2c00_2c5f'][] = array('upper' => 11276, 'status' => 'C', 'lower' => array(11324)); /* GLAGOLITIC CAPITAL LETTER DJERVI */
$config['2c00_2c5f'][] = array('upper' => 11277, 'status' => 'C', 'lower' => array(11325)); /* GLAGOLITIC CAPITAL LETTER KAKO */
$config['2c00_2c5f'][] = array('upper' => 11278, 'status' => 'C', 'lower' => array(11326)); /* GLAGOLITIC CAPITAL LETTER LJUDIJE */
$config['2c00_2c5f'][] = array('upper' => 11279, 'status' => 'C', 'lower' => array(11327)); /* GLAGOLITIC CAPITAL LETTER MYSLITE */
$config['2c00_2c5f'][] = array('upper' => 11280, 'status' => 'C', 'lower' => array(11328)); /* GLAGOLITIC CAPITAL LETTER NASHI */
$config['2c00_2c5f'][] = array('upper' => 11281, 'status' => 'C', 'lower' => array(11329)); /* GLAGOLITIC CAPITAL LETTER ONU */
$config['2c00_2c5f'][] = array('upper' => 11282, 'status' => 'C', 'lower' => array(11330)); /* GLAGOLITIC CAPITAL LETTER POKOJI */
$config['2c00_2c5f'][] = array('upper' => 11283, 'status' => 'C', 'lower' => array(11331)); /* GLAGOLITIC CAPITAL LETTER RITSI */
$config['2c00_2c5f'][] = array('upper' => 11284, 'status' => 'C', 'lower' => array(11332)); /* GLAGOLITIC CAPITAL LETTER SLOVO */
$config['2c00_2c5f'][] = array('upper' => 11285, 'status' => 'C', 'lower' => array(11333)); /* GLAGOLITIC CAPITAL LETTER TVRIDO */
$config['2c00_2c5f'][] = array('upper' => 11286, 'status' => 'C', 'lower' => array(11334)); /* GLAGOLITIC CAPITAL LETTER UKU */
$config['2c00_2c5f'][] = array('upper' => 11287, 'status' => 'C', 'lower' => array(11335)); /* GLAGOLITIC CAPITAL LETTER FRITU */
$config['2c00_2c5f'][] = array('upper' => 11288, 'status' => 'C', 'lower' => array(11336)); /* GLAGOLITIC CAPITAL LETTER HERU */
$config['2c00_2c5f'][] = array('upper' => 11289, 'status' => 'C', 'lower' => array(11337)); /* GLAGOLITIC CAPITAL LETTER OTU */
$config['2c00_2c5f'][] = array('upper' => 11290, 'status' => 'C', 'lower' => array(11338)); /* GLAGOLITIC CAPITAL LETTER PE */
$config['2c00_2c5f'][] = array('upper' => 11291, 'status' => 'C', 'lower' => array(11339)); /* GLAGOLITIC CAPITAL LETTER SHTA */
$config['2c00_2c5f'][] = array('upper' => 11292, 'status' => 'C', 'lower' => array(11340)); /* GLAGOLITIC CAPITAL LETTER TSI */
$config['2c00_2c5f'][] = array('upper' => 11293, 'status' => 'C', 'lower' => array(11341)); /* GLAGOLITIC CAPITAL LETTER CHRIVI */
$config['2c00_2c5f'][] = array('upper' => 11294, 'status' => 'C', 'lower' => array(11342)); /* GLAGOLITIC CAPITAL LETTER SHA */
$config['2c00_2c5f'][] = array('upper' => 11295, 'status' => 'C', 'lower' => array(11343)); /* GLAGOLITIC CAPITAL LETTER YERU */
$config['2c00_2c5f'][] = array('upper' => 11296, 'status' => 'C', 'lower' => array(11344)); /* GLAGOLITIC CAPITAL LETTER YERI */
$config['2c00_2c5f'][] = array('upper' => 11297, 'status' => 'C', 'lower' => array(11345)); /* GLAGOLITIC CAPITAL LETTER YATI */
$config['2c00_2c5f'][] = array('upper' => 11298, 'status' => 'C', 'lower' => array(11346)); /* GLAGOLITIC CAPITAL LETTER SPIDERY HA */
$config['2c00_2c5f'][] = array('upper' => 11299, 'status' => 'C', 'lower' => array(11347)); /* GLAGOLITIC CAPITAL LETTER YU */
$config['2c00_2c5f'][] = array('upper' => 11300, 'status' => 'C', 'lower' => array(11348)); /* GLAGOLITIC CAPITAL LETTER SMALL YUS */
$config['2c00_2c5f'][] = array('upper' => 11301, 'status' => 'C', 'lower' => array(11349)); /* GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL */
$config['2c00_2c5f'][] = array('upper' => 11302, 'status' => 'C', 'lower' => array(11350)); /* GLAGOLITIC CAPITAL LETTER YO */
$config['2c00_2c5f'][] = array('upper' => 11303, 'status' => 'C', 'lower' => array(11351)); /* GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS */
$config['2c00_2c5f'][] = array('upper' => 11304, 'status' => 'C', 'lower' => array(11352)); /* GLAGOLITIC CAPITAL LETTER BIG YUS */
$config['2c00_2c5f'][] = array('upper' => 11305, 'status' => 'C', 'lower' => array(11353)); /* GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS */
$config['2c00_2c5f'][] = array('upper' => 11306, 'status' => 'C', 'lower' => array(11354)); /* GLAGOLITIC CAPITAL LETTER FITA */
$config['2c00_2c5f'][] = array('upper' => 11307, 'status' => 'C', 'lower' => array(11355)); /* GLAGOLITIC CAPITAL LETTER IZHITSA */
$config['2c00_2c5f'][] = array('upper' => 11308, 'status' => 'C', 'lower' => array(11356)); /* GLAGOLITIC CAPITAL LETTER SHTAPIC */
$config['2c00_2c5f'][] = array('upper' => 11309, 'status' => 'C', 'lower' => array(11357)); /* GLAGOLITIC CAPITAL LETTER TROKUTASTI A */
$config['2c00_2c5f'][] = array('upper' => 11310, 'status' => 'C', 'lower' => array(11358)); /* GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE */
?>


Wed Aug 19, 2009 9:38 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/**
* Core Configurations.
*
* Holds configurations used by CakePHP
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 1.1.11.4062
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
return $config['Cake.version'] = 'OVER 9000!!';
?>


Wed Aug 19, 2009 9:38 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Tue May 05, 2009 3:29 pm
Posts: 7173
ImageImageImageImageImageImageImageImageImageImageImageImage

_________________
timark_uk wrote:
That's your problem. You need Linux. That'll fix all your problems.
Mark


Wed Aug 19, 2009 9:38 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/* SVN FILE: $Id$ */

/**
* Short description for file.
*
* In this file you set paths to different directories used by Cake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* If the index.php file is used instead of an .htaccess file
* or if the user can not set the web root to use the public
* directory we will define ROOT there, otherwise we set it
* here.
*/
if (!defined('ROOT')) {
define('ROOT', '../');
}
if (!defined('WEBROOT_DIR')) {
define('WEBROOT_DIR', 'webroot');
}

/**
* Path to the cake directory.
*/
define('CAKE', CORE_PATH.'cake'.DS);

/**
* Path to the application's directory.
*/
if (!defined('APP')) {
define('APP', ROOT.DS.APP_DIR.DS);
}

/**
* Path to the application's models directory.
*/
define('MODELS', APP.'models'.DS);

/**
* Path to model behaviors directory.
*/
define('BEHAVIORS', MODELS.'behaviors'.DS);

/**
* Path to the application's controllers directory.
*/
define('CONTROLLERS', APP.'controllers'.DS);

/**
* Path to the application's components directory.
*/
define('COMPONENTS', CONTROLLERS.'components'.DS);

/**
* Path to the application's views directory.
*/
define('VIEWS', APP.'views'.DS);

/**
* Path to the application's helpers directory.
*/
define('HELPERS', VIEWS.'helpers'.DS);

/**
* Path to the application's view's layouts directory.
*/
define('LAYOUTS', VIEWS.'layouts'.DS);

/**
* Path to the application's view's elements directory.
* It's supposed to hold pieces of PHP/HTML that are used on multiple pages
* and are not linked to a particular layout (like polls, footers and so on).
*/
define('ELEMENTS', VIEWS.'elements'.DS);

/**
* Path to the configuration files directory.
*/
if (!defined('CONFIGS')) {
define('CONFIGS', APP.'config'.DS);
}

/**
* Path to the libs directory.
*/
define('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS);

/**
* Path to the libs directory.
*/
define('LIBS', CAKE.'libs'.DS);

/**
* Path to the public CSS directory.
*/
define('CSS', WWW_ROOT.'css'.DS);

/**
* Path to the public JavaScript directory.
*/
define('JS', WWW_ROOT.'js'.DS);

/**
* Path to the public images directory.
*/
define('IMAGES', WWW_ROOT.'img'.DS);

/**
* Path to the console libs direcotry.
*/
define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);

/**
* Path to the tests directory.
*/
if (!defined('TESTS')) {
define('TESTS', APP.'tests'.DS);
}

/**
* Path to the core tests directory.
*/
if (!defined('CAKE_TESTS')) {
define('CAKE_TESTS', CAKE.'tests'.DS);
}

/**
* Path to the test suite.
*/
define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);

/**
* Path to the controller test directory.
*/
define('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS);

/**
* Path to the components test directory.
*/
define('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS);

/**
* Path to the helpers test directory.
*/
define('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS);

/**
* Path to the models' test directory.
*/
define('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS);

/**
* Path to the lib test directory.
*/
define('LIB_TESTS', CAKE_TESTS.'cases'.DS.'lib'.DS);

/**
* Path to the temporary files directory.
*/
if (!defined('TMP')) {
define('TMP', APP.'tmp'.DS);
}

/**
* Path to the logs directory.
*/
define('LOGS', TMP.'logs'.DS);

/**
* Path to the cache files directory. It can be shared between hosts in a multi-server setup.
*/
define('CACHE', TMP.'cache'.DS);

/**
* Path to the vendors directory.
*/
if (!defined('VENDORS')) {
define('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
}

/**
* Path to the Pear directory
* The purporse is to make it easy porting Pear libs into Cake
* without setting the include_path PHP variable.
*/
define('PEAR', VENDORS.'Pear'.DS);

/**
* Full url prefix
*/
if (!defined('FULL_BASE_URL')) {
$s = null;
if (env('HTTPS')) {
$s ='s';
}

$httpHost = env('HTTP_HOST');

if (isset($httpHost)) {
define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
}
unset($httpHost, $s);
}

/**
* Web path to the public images directory.
*/
if (!defined('IMAGES_URL')) {
define('IMAGES_URL', 'img/');
}

/**
* Web path to the CSS files directory.
*/
if (!defined('CSS_URL')) {
define('CSS_URL', 'css/');
}

/**
* Web path to the js files directory.
*/
if (!defined('JS_URL')) {
define('JS_URL', 'js/');
}
?>


Wed Aug 19, 2009 9:38 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/**
* The ControllerTask handles creating and updating controller files.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @since CakePHP(tm) v 1.2
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* Task class for creating and updating controller files.
*
* @package cake
* @subpackage cake.cake.console.libs.tasks
*/
class ControllerTask extends Shell {

/**
* Name of plugin
*
* @var string
* @access public
*/
var $plugin = null;

/**
* Tasks to be loaded by this Task
*
* @var array
* @access public
*/
var $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project');

/**
* path to CONTROLLERS directory
*
* @var array
* @access public
*/
var $path = CONTROLLERS;

/**
* Override initialize
*
* @access public
*/
function initialize() {
}

/**
* Execution method always used for tasks
*
* @access public
*/
function execute() {
if (empty($this->args)) {
$this->__interactive();
}

if (isset($this->args[0])) {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') {
return $this->all();
}

$controller = Inflector::camelize($this->args[0]);
$actions = 'scaffold';

if (!empty($this->args[1]) && ($this->args[1] == 'public' || $this->args[1] == 'scaffold')) {
$this->out(__('Baking basic crud methods for ', true) . $controller);
$actions = $this->bakeActions($controller);
} elseif (!empty($this->args[1]) && $this->args[1] == 'admin') {
$admin = $this->Project->getAdmin();
if ($admin) {
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
$actions= $this->bakeActions($controller, $admin);
}
}

if (!empty($this->args[2]) && $this->args[2] == 'admin') {
$admin = $this->Project->getAdmin();
if ($admin) {
$this->out('Adding ' . Configure::read('Routing.admin') .' methods');
$actions .= "\n" . $this->bakeActions($controller, $admin);
}
}

if ($this->bake($controller, $actions)) {
if ($this->_checkUnitTest()) {
$this->bakeTest($controller);
}
}
}
}

/**
* Bake All the controllers at once. Will only bake controllers for models that exist.
*
* @access public
* @return void
**/
function all() {
$this->interactive = false;
$this->listAll($this->connection, false);
ClassRegistry::config('Model', array('ds' => $this->connection));
$unitTestExists = $this->_checkUnitTest();
foreach ($this->__tables as $table) {
$model = $this->_modelName($table);
$controller = $this->_controllerName($model);
if (App::import('Model', $model)) {
$actions = $this->bakeActions($controller);
if ($this->bake($controller, $actions) && $unitTestExists) {
$this->bakeTest($controller);
}
}
}
}

/**
* Interactive
*
* @access private
*/
function __interactive() {
$this->interactive = true;
$this->hr();
$this->out(sprintf(__("Bake Controller\nPath: %s", true), $this->path));
$this->hr();

if (empty($this->connection)) {
$this->connection = $this->DbConfig->getConfig();
}

$controllerName = $this->getName();
$this->hr();
$this->out(sprintf(__('Baking %sController', true), $controllerName));
$this->hr();

$helpers = $components = array();
$actions = '';
$wannaUseSession = 'y';
$wannaBakeAdminCrud = 'n';
$useDynamicScaffold = 'n';
$wannaBakeCrud = 'y';

$controllerFile = strtolower(Inflector::underscore($controllerName));

$question[] = __("Would you like to build your controller interactively?", true);
if (file_exists($this->path . $controllerFile .'_controller.php')) {
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName);
}
$doItInteractive = $this->in(join("\n", $question), array('y', 'n'), 'y');

if (strtolower($doItInteractive) == 'y') {
$this->interactive = true;
$useDynamicScaffold = $this->in(
__("Would you like to use dynamic scaffolding?", true), array('y','n'), 'n'
);

if (strtolower($useDynamicScaffold) == 'y') {
$wannaBakeCrud = 'n';
$actions = 'scaffold';
} else {
list($wannaBakeCrud, $wannaBakeAdminCrud) = $this->_askAboutMethods();

$helpers = $this->doHelpers();
$components = $this->doComponents();

$wannaUseSession = $this->in(
__("Would you like to use Session flash messages?", true), array('y','n'), 'y'
);
}
} else {
list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods();
}

if (strtolower($wannaBakeCrud) == 'y') {
$actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y');
}
if (strtolower($wannaBakeAdminCrud) == 'y') {
$admin = $this->Project->getAdmin();
$actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y');
}

if ($this->interactive === true) {
$this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components);
$looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y');

if (strtolower($looksGood) == 'y') {
$baked = $this->bake($controllerName, $actions, $helpers, $components);
if ($baked && $this->_checkUnitTest()) {
$this->bakeTest($controllerName);
}
}
} else {
$baked = $this->bake($controllerName, $actions, $helpers, $components);
if ($baked && $this->_checkUnitTest()) {
$this->bakeTest($controllerName);
}
}
}

/**
* Confirm a to be baked controller with the user
*
* @return void
**/
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
$this->out('');
$this->hr();
$this->out(__('The following controller will be created:', true));
$this->hr();
$this->out(sprintf(__("Controller Name:\n\t%s", true), $controllerName));

if (strtolower($useDynamicScaffold) == 'y') {
$this->out("var \$scaffold;");
}

$properties = array(
'helpers' => __("Helpers:", true),
'components' => __('Components:', true),
);

foreach ($properties as $var => $title) {
if (count($$var)) {
$output = '';
$length = count($$var);
foreach ($$var as $i => $propElement) {
if ($i != $length -1) {
$output .= ucfirst($propElement) . ', ';
} else {
$output .= ucfirst($propElement);
}
}
$this->out($title . "\n\t" . $output);
}
}
$this->hr();
}

/**
* Interact with the user and ask about which methods (admin or regular they want to bake)
*
* @return array Array containing (bakeRegular, bakeAdmin) answers
**/
function _askAboutMethods() {
$wannaBakeCrud = $this->in(
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
array('y','n'), 'n'
);
$wannaBakeAdminCrud = $this->in(
__("Would you like to create the basic class methods for admin routing?", true),
array('y','n'), 'n'
);
return array($wannaBakeCrud, $wannaBakeAdminCrud);
}

/**
* Bake scaffold actions
*
* @param string $controllerName Controller name
* @param string $admin Admin route to use
* @param boolean $wannaUseSession Set to true to use sessions, false otherwise
* @return string Baked actions
* @access private
*/
function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$currentModelName = $modelImport = $this->_modelName($controllerName);
if ($this->plugin) {
$modelImport = $this->plugin . '.' . $modelImport;
}
if (!App::import('Model', $modelImport)) {
$this->err(__('You must have a model for this class to build basic methods. Please try again.', true));
$this->_stop();
}

$modelObj =& ClassRegistry::init($currentModelName);
$controllerPath = $this->_controllerPath($controllerName);
$pluralName = $this->_pluralName($currentModelName);
$singularName = Inflector::variable($currentModelName);
$singularHumanName = Inflector::humanize($currentModelName);
$pluralHumanName = Inflector::humanize($controllerName);

$this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName',
'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName'));
$actions = $this->Template->generate('actions', 'controller_actions');
return $actions;
}

/**
* Assembles and writes a Controller file
*
* @param string $controllerName Controller name
* @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold')
* @param array $helpers Helpers to use in controller
* @param array $components Components to use in controller
* @param array $uses Models to use in controller
* @return string Baked controller
* @access private
*/
function bake($controllerName, $actions = '', $helpers = null, $components = null) {
$isScaffold = ($actions === 'scaffold') ? true : false;

$this->Template->set('plugin', Inflector::camelize($this->plugin));
$this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold'));
$contents = $this->Template->generate('classes', 'controller');

$path = $this->path;
if (isset($this->plugin)) {
$path = $this->_pluginPath($this->plugin) . 'controllers' . DS;
}
$filename = $path . $this->_controllerPath($controllerName) . '_controller.php';
if ($this->createFile($filename, $contents)) {
return $contents;
}
return false;
}

/**
* Assembles and writes a unit test file
*
* @param string $className Controller class name
* @return string Baked test
* @access private
*/
function bakeTest($className) {
$this->Test->plugin = $this->plugin;
$this->Test->connection = $this->connection;
return $this->Test->bake('Controller', $className);
}

/**
* Interact with the user and get a list of additional helpers
*
* @return array Helpers that the user wants to use.
**/
function doHelpers() {
return $this->_doPropertyChoices(
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
__("Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)
);
}

/**
* Interact with the user and get a list of additional components
*
* @return array Components the user wants to use.
**/
function doComponents() {
return $this->_doPropertyChoices(
__("Would you like this controller to use any components?", true),
__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)
);
}

/**
* Common code for property choice handling.
*
* @param string $prompt A yes/no question to precede the list
* @param sting $example A question for a comma separated list, with examples.
* @return array Array of values for property.
**/
function _doPropertyChoices($prompt, $example) {
$proceed = $this->in($prompt, array('y','n'), 'n');
$property = array();
if (strtolower($proceed) == 'y') {
$propertyList = $this->in($example);
$propertyListTrimmed = str_replace(' ', '', $propertyList);
$property = explode(',', $propertyListTrimmed);
}
return array_filter($property);
}

/**
* Outputs and gets the list of possible controllers from database
*
* @param string $useDbConfig Database configuration name
* @param boolean $interactive Whether you are using listAll interactively and want options output.
* @return array Set of controllers
* @access public
*/
function listAll($useDbConfig = null) {
if (is_null($useDbConfig)) {
$useDbConfig = $this->connection;
}
$this->__tables = $this->Model->getAllTables($useDbConfig);

if ($this->interactive == true) {
$this->out(__('Possible Controllers based on your current database:', true));
$this->_controllerNames = array();
$count = count($this->__tables);
for ($i = 0; $i < $count; $i++) {
$this->_controllerNames[] = $this->_controllerName($this->_modelName($this->__tables[$i]));
$this->out($i + 1 . ". " . $this->_controllerNames[$i]);
}
return $this->_controllerNames;
}
return $this->__tables;
}

/**
* Forces the user to specify the controller he wants to bake, and returns the selected controller name.
*
* @param string $useDbConfig Connection name to get a controller name for.
* @return string Controller name
* @access public
*/
function getName($useDbConfig = null) {
$controllers = $this->listAll($useDbConfig);
$enteredController = '';

while ($enteredController == '') {
$enteredController = $this->in(__("Enter a number from the list above,\ntype in the name of another controller, or 'q' to exit", true), null, 'q');

if ($enteredController === 'q') {
$this->out(__("Exit", true));
$this->_stop();
}

if ($enteredController == '' || intval($enteredController) > count($controllers)) {
$this->err(__("The Controller name you supplied was empty,\nor the number you selected was not an option. Please try again.", true));
$enteredController = '';
}
}

if (intval($enteredController) > 0 && intval($enteredController) <= count($controllers) ) {
$controllerName = $controllers[intval($enteredController) - 1];
} else {
$controllerName = Inflector::camelize($enteredController);
}
return $controllerName;
}

/**
* Displays help contents
*
* @access public
*/
function help() {
$this->hr();
$this->out("Usage: cake bake controller <arg1> <arg2>...");
$this->hr();
$this->out('Commands:');
$this->out('');
$this->out("controller <name>");
$this->out("\tbakes controller with var \$scaffold");
$this->out('');
$this->out("controller <name> public");
$this->out("\tbakes controller with basic crud actions");
$this->out("\t(index, view, add, edit, delete)");
$this->out('');
$this->out("controller <name> admin");
$this->out("\tbakes a controller with basic crud actions for");
$this->out("\tConfigure::read('Routing.admin') methods.");
$this->out('');
$this->out("controller <name> public admin");
$this->out("\tbakes a controller with basic crud actions for");
$this->out("\tConfigure::read('Routing.admin') and non admin methods.");
$this->out("\t(index, view, add, edit, delete,");
$this->out("\tadmin_index, admin_view, admin_edit, admin_add, admin_delete)");
$this->out('');
$this->out("controller all");
$this->out("\tbakes all controllers with CRUD methods.");
$this->out("");
$this->_stop();
}
}
?>


Wed Aug 19, 2009 9:39 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 8:29 pm
Posts: 5975
Image

_________________
"I hadn't known there were so many idiots in the world until I started using the Internet." - Stanislaw Lem


Wed Aug 19, 2009 9:39 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/**
* The DbConfig Task handles creating and updating the database.php
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @since CakePHP(tm) v 1.2
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* Task class for creating and updating the database configuration file.
*
* @package cake
* @subpackage cake.cake.console.libs.tasks
*/
class DbConfigTask extends Shell {

/**
* path to CONFIG directory
*
* @var string
* @access public
*/
var $path = null;

/**
* Default configuration settings to use
*
* @var array
* @access private
*/
var $__defaultConfig = array(
'name' => 'default', 'driver'=> 'mysql', 'persistent'=> 'false', 'host'=> 'localhost',
'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name',
'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null
);

/**
* String name of the database config class name.
* Used for testing.
*
* @var string
**/
var $databaseClassName = 'DATABASE_CONFIG';

/**
* initialization callback
*
* @var string
* @access public
*/
function initialize() {
$this->path = $this->params['working'] . DS . 'config' . DS;
}

/**
* Execution method always used for tasks
*
* @access public
*/
function execute() {
if (empty($this->args)) {
$this->__interactive();
$this->_stop();
}
}

/**
* Interactive interface
*
* @access private
*/
function __interactive() {
$this->hr();
$this->out('Database Configuration:');
$this->hr();
$done = false;
$dbConfigs = array();

while ($done == false) {
$name = '';

while ($name == '') {
$name = $this->in("Name:", null, 'default');
if (preg_match('/[^a-z0-9_]/i', $name)) {
$name = '';
$this->out('The name may only contain unaccented latin characters, numbers or underscores');
} else if (preg_match('/^[^a-z_]/i', $name)) {
$name = '';
$this->out('The name must start with an unaccented latin character or an underscore');
}
}

$driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql');

$persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
if (low($persistent) == 'n') {
$persistent = 'false';
} else {
$persistent = 'true';
}

$host = '';
while ($host == '') {
$host = $this->in('Database Host:', null, 'localhost');
}

$port = '';
while ($port == '') {
$port = $this->in('Port?', null, 'n');
}

if (low($port) == 'n') {
$port = null;
}

$login = '';
while ($login == '') {
$login = $this->in('User:', null, 'root');
}
$password = '';
$blankPassword = false;

while ($password == '' && $blankPassword == false) {
$password = $this->in('Password:');

if ($password == '') {
$blank = $this->in('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n');
if ($blank == 'y') {
$blankPassword = true;
}
}
}

$database = '';
while ($database == '') {
$database = $this->in('Database Name:', null, 'cake');
}

$prefix = '';
while ($prefix == '') {
$prefix = $this->in('Table Prefix?', null, 'n');
}
if (low($prefix) == 'n') {
$prefix = null;
}

$encoding = '';
while ($encoding == '') {
$encoding = $this->in('Table encoding?', null, 'n');
}
if (low($encoding) == 'n') {
$encoding = null;
}

$schema = '';
if ($driver == 'postgres') {
while ($schema == '') {
$schema = $this->in('Table schema?', null, 'n');
}
}
if (low($schema) == 'n') {
$schema = null;
}

$config = compact('name', 'driver', 'persistent', 'host', 'login', 'password', 'database', 'prefix', 'encoding', 'port', 'schema');

while ($this->__verify($config) == false) {
$this->__interactive();
}
$dbConfigs[] = $config;
$doneYet = $this->in('Do you wish to add another database configuration?', null, 'n');

if (low($doneYet == 'n')) {
$done = true;
}
}

$this->bake($dbConfigs);
config('database');
return true;
}

/**
* Output verification message and bake if it looks good
*
* @return boolean True if user says it looks good, false otherwise
* @access private
*/
function __verify($config) {
$config = array_merge($this->__defaultConfig, $config);
extract($config);
$this->out('');
$this->hr();
$this->out('The following database configuration will be created:');
$this->hr();
$this->out("Name: $name");
$this->out("Driver: $driver");
$this->out("Persistent: $persistent");
$this->out("Host: $host");

if ($port) {
$this->out("Port: $port");
}

$this->out("User: $login");
$this->out("Pass: " . str_repeat('*', strlen($password)));
$this->out("Database: $database");

if ($prefix) {
$this->out("Table prefix: $prefix");
}

if ($schema) {
$this->out("Schema: $schema");
}

if ($encoding) {
$this->out("Encoding: $encoding");
}

$this->hr();
$looksGood = $this->in('Look okay?', array('y', 'n'), 'y');

if (strtolower($looksGood) == 'y') {
return $config;
}
return false;
}

/**
* Assembles and writes database.php
*
* @param array $configs Configuration settings to use
* @return boolean Success
* @access public
*/
function bake($configs) {
if (!is_dir($this->path)) {
$this->err($this->path . ' not found');
return false;
}

$filename = $this->path . 'database.php';
$oldConfigs = array();

if (file_exists($filename)) {
$db = new $this->databaseClassName;
$temp = get_class_vars(get_class($db));

foreach ($temp as $configName => $info) {
$info = array_merge($this->__defaultConfig, $info);

if (!isset($info['schema'])) {
$info['schema'] = null;
}
if (!isset($info['encoding'])) {
$info['encoding'] = null;
}
if (!isset($info['port'])) {
$info['port'] = null;
}

if ($info['persistent'] === false) {
$info['persistent'] = 'false';
} else {
$info['persistent'] = ($info['persistent'] == true) ? 'true' : 'false';
}

$oldConfigs[] = array(
'name' => $configName,
'driver' => $info['driver'],
'persistent' => $info['persistent'],
'host' => $info['host'],
'port' => $info['port'],
'login' => $info['login'],
'password' => $info['password'],
'database' => $info['database'],
'prefix' => $info['prefix'],
'schema' => $info['schema'],
'encoding' => $info['encoding']
);
}
}

foreach ($oldConfigs as $key => $oldConfig) {
foreach ($configs as $key1 => $config) {
if ($oldConfig['name'] == $config['name']) {
unset($oldConfigs[$key]);
}
}
}

$configs = array_merge($oldConfigs, $configs);
$out = "<?php\n";
$out .= "class DATABASE_CONFIG {\n\n";

foreach ($configs as $config) {
$config = array_merge($this->__defaultConfig, $config);
extract($config);

$out .= "\tvar \${$name} = array(\n";
$out .= "\t\t'driver' => '{$driver}',\n";
$out .= "\t\t'persistent' => {$persistent},\n";
$out .= "\t\t'host' => '{$host}',\n";

if ($port) {
$out .= "\t\t'port' => {$port},\n";
}

$out .= "\t\t'login' => '{$login}',\n";
$out .= "\t\t'password' => '{$password}',\n";
$out .= "\t\t'database' => '{$database}',\n";

if ($schema) {
$out .= "\t\t'schema' => '{$schema}',\n";
}

if ($prefix) {
$out .= "\t\t'prefix' => '{$prefix}',\n";
}

if ($encoding) {
$out .= "\t\t'encoding' => '{$encoding}'\n";
}

$out .= "\t);\n";
}

$out .= "}\n";
$out .= "?>";
$filename = $this->path . 'database.php';
return $this->createFile($filename, $out);
}

/**
* Get a user specified Connection name
*
* @return void
**/
function getConfig() {
$useDbConfig = 'default';
$configs = get_class_vars($this->databaseClassName);

if (!is_array($configs)) {
return $this->execute();
}

$connections = array_keys($configs);
if (count($connections) > 1) {
$useDbConfig = $this->in(__('Use Database Config', true) .':', $connections, 'default');
}
return $useDbConfig;
}
}
?>


Wed Aug 19, 2009 9:39 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
Paul1965 wrote:
Image


LESS!!


Wed Aug 19, 2009 9:39 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 8:29 pm
Posts: 5975
Image

_________________
"I hadn't known there were so many idiots in the world until I started using the Internet." - Stanislaw Lem


Wed Aug 19, 2009 9:40 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs
* @since CakePHP(tm) v 1.2.0.5012
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* Only used when -debug option
*/
ob_start();

$singularReturn = __('Singular string return __()', true);
$singularEcho = __('Singular string echo __()');

$pluralReturn = __n('% apple in the bowl (plural string return __n())', '% apples in the blowl (plural string 2 return __n())', 3, true);
$pluralEcho = __n('% apple in the bowl (plural string 2 echo __n())', '% apples in the blowl (plural string 2 echo __n()', 3);

$singularDomainReturn = __d('controllers', 'Singular string domain lookup return __d()', true);
$singularDomainEcho = __d('controllers', 'Singular string domain lookup echo __d()');

$pluralDomainReturn = __dn('controllers', '% pears in the bowl (plural string domain lookup return __dn())', '% pears in the blowl (plural string domain lookup return __dn())', 3, true);
$pluralDomainEcho = __dn('controllers', '% pears in the bowl (plural string domain lookup echo __dn())', '% pears in the blowl (plural string domain lookup echo __dn())', 3);

$singularDomainCategoryReturn = __dc('controllers', 'Singular string domain and category lookup return __dc()', 5, true);
$singularDomainCategoryEcho = __dc('controllers', 'Singular string domain and category lookup echo __dc()', 5);

$pluralDomainCategoryReturn = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup return __dcn())', '% apples in the blowl (plural string 2 domain and category lookup return __dcn())', 3, 5, true);
$pluralDomainCategoryEcho = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup echo __dcn())', '% apples in the blowl (plural string 2 domain and category lookup echo __dcn())', 3, 5);

$categoryReturn = __c('Category string lookup line return __c()', 5, true);
$categoryEcho = __c('Category string lookup line echo __c()', 5);

ob_end_clean();

/**
* Language string extractor
*
* @package cake
* @subpackage cake.cake.console.libs
*/
class ExtractTask extends Shell{

/**
* Path to use when looking for strings
*
* @var string
* @access public
*/
var $path = null;

/**
* Files from where to extract
*
* @var array
* @access public
*/
var $files = array();

/**
* Filename where to deposit translations
*
* @var string
* @access private
*/
var $__filename = 'default';

/**
* True if all strings should be merged into one file
*
* @var boolean
* @access private
*/
var $__oneFile = true;

/**
* Current file being processed
*
* @var string
* @access private
*/
var $__file = null;

/**
* Extracted tokens
*
* @var array
* @access private
*/
var $__tokens = array();

/**
* Extracted strings
*
* @var array
* @access private
*/
var $__strings = array();

/**
* History of file versions
*
* @var array
* @access private
*/
var $__fileVersions = array();

/**
* Destination path
*
* @var string
* @access private
*/
var $__output = null;

/**
* Execution method always used for tasks
*
* @access public
*/
function execute() {
if (isset($this->params['files']) && !is_array($this->params['files'])) {
$this->files = explode(',', $this->params['files']);
}
if (isset($this->params['path'])) {
$this->path = $this->params['path'];
} else {
$response = '';
while ($response == '') {
$response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, $this->params['working']);
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->_stop();
}
}

if (is_dir($response)) {
$this->path = $response;
} else {
$this->err('The directory path you supplied was not found. Please try again.');
$this->execute();
}
}

if (isset($this->params['debug'])) {
$this->path = ROOT;
$this->files = array(__FILE__);
}

if (isset($this->params['output'])) {
$this->__output = $this->params['output'];
} else {
$response = '';
while ($response == '') {
$response = $this->in("What is the full path you would like to output?\nExample: " . $this->path . DS . "locale\n[Q]uit", null, $this->path . DS . "locale");
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->_stop();
}
}

if (is_dir($response)) {
$this->__output = $response . DS;
} else {
$this->err('The directory path you supplied was not found. Please try again.');
$this->execute();
}
}

if (empty($this->files)) {
$this->files = $this->__searchDirectory();
}
$this->__extract();
}

/**
* Extract text
*
* @access private
*/
function __extract() {
$this->out('');
$this->out('');
$this->out(__('Extracting...', true));
$this->hr();
$this->out(__('Path: ', true). $this->path);
$this->out(__('Output Directory: ', true). $this->__output);
$this->hr();

$response = '';
$filename = '';
while ($response == '') {
$response = $this->in(__('Would you like to merge all translations into one file?', true), array('y','n'), 'y');
if (strtolower($response) == 'n') {
$this->__oneFile = false;
} else {
while ($filename == '') {
$filename = $this->in(__('What should we name this file?', true), null, $this->__filename);
if ($filename == '') {
$this->out(__('The filesname you supplied was empty. Please try again.', true));
}
}
$this->__filename = $filename;
}
}
$this->__extractTokens();
}

/**
* Show help options
*
* @access public
*/
function help() {
$this->out(__('CakePHP Language String Extraction:', true));
$this->hr();
$this->out(__('The Extract script generates .pot file(s) with translations', true));
$this->out(__('By default the .pot file(s) will be place in the locale directory of -app', true));
$this->out(__('By default -app is ROOT/app', true));
$this->hr();
$this->out(__('usage: cake i18n extract [command] [path...]', true));
$this->out('');
$this->out(__('commands:', true));
$this->out(__(' -app [path...]: directory where your application is located', true));
$this->out(__(' -root [path...]: path to install', true));
$this->out(__(' -core [path...]: path to cake directory', true));
$this->out(__(' -path [path...]: Full path to directory to extract strings', true));
$this->out(__(' -output [path...]: Full path to output directory', true));
$this->out(__(' -files: [comma separated list of files, full path to file is needed]', true));
$this->out(__(' cake i18n extract help: Shows this help message.', true));
$this->out(__(' -debug: Perform self test.', true));
$this->out('');
}

/**
* Extract tokens out of all files to be processed
*
* @access private
*/
function __extractTokens() {
foreach ($this->files as $file) {
$this->__file = $file;
$this->out(sprintf(__('Processing %s...', true), $file));

$code = file_get_contents($file);

$this->__findVersion($code, $file);
$allTokens = token_get_all($code);
$this->__tokens = array();
$lineNumber = 1;

foreach ($allTokens as $token) {
if ((!is_array($token)) || (($token[0] != T_WHITESPACE) && ($token[0] != T_INLINE_HTML))) {
if (is_array($token)) {
$token[] = $lineNumber;
}
$this->__tokens[] = $token;
}

if (is_array($token)) {
$lineNumber += count(split("\n", $token[1])) - 1;
} else {
$lineNumber += count(split("\n", $token)) - 1;
}
}
unset($allTokens);
$this->basic();
$this->basic('__c');
$this->extended();
$this->extended('__dc', 2);
$this->extended('__n', 0, true);
$this->extended('__dn', 2, true);
$this->extended('__dcn', 4, true);
}
$this->__buildFiles();
$this->__writeFiles();
$this->out('Done.');
}

/**
* Will parse __(), __c() functions
*
* @param string $functionName Function name that indicates translatable string (e.g: '__')
* @access public
*/
function basic($functionName = '__') {
$count = 0;
$tokenCount = count($this->__tokens);

while (($tokenCount - $count) > 3) {
list($countToken, $parenthesis, $middle, $right) = array($this->__tokens[$count], $this->__tokens[$count + 1], $this->__tokens[$count + 2], $this->__tokens[$count + 3]);
if (!is_array($countToken)) {
$count++;
continue;
}

list($type, $string, $line) = $countToken;
if (($type == T_STRING) && ($string == $functionName) && ($parenthesis == '(')) {

if (in_array($right, array(')', ','))
&& (is_array($middle) && ($middle[0] == T_CONSTANT_ENCAPSED_STRING))) {

if ($this->__oneFile === true) {
$this->__strings[$this->__formatString($middle[1])][$this->__file][] = $line;
} else {
$this->__strings[$this->__file][$this->__formatString($middle[1])][] = $line;
}
} else {
$this->__markerError($this->__file, $line, $functionName, $count);
}
}
$count++;
}
}

/**
* Will parse __d(), __dc(), __n(), __dn(), __dcn()
*
* @param string $functionName Function name that indicates translatable string (e.g: '__')
* @param integer $shift Number of parameters to shift to find translateable string
* @param boolean $plural Set to true if function supports plural format, false otherwise
* @access public
*/
function extended($functionName = '__d', $shift = 0, $plural = false) {
$count = 0;
$tokenCount = count($this->__tokens);

while (($tokenCount - $count) > 7) {
list($countToken, $firstParenthesis) = array($this->__tokens[$count], $this->__tokens[$count + 1]);
if (!is_array($countToken)) {
$count++;
continue;
}

list($type, $string, $line) = $countToken;
if (($type == T_STRING) && ($string == $functionName) && ($firstParenthesis == '(')) {
$position = $count;
$depth = 0;

while ($depth == 0) {
if ($this->__tokens[$position] == '(') {
$depth++;
} elseif ($this->__tokens[$position] == ')') {
$depth--;
}
$position++;
}

if ($plural) {
$end = $position + $shift + 7;

if ($this->__tokens[$position + $shift + 5] === ')') {
$end = $position + $shift + 5;
}

if (empty($shift)) {
list($singular, $firstComma, $plural, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$end]);
$condition = ($seoncdComma == ',');
} else {
list($domain, $firstComma, $singular, $seoncdComma, $plural, $comma3, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$position + 4], $this->__tokens[$position + 5], $this->__tokens[$end]);
$condition = ($comma3 == ',');
}
$condition = $condition &&
(is_array($singular) && ($singular[0] == T_CONSTANT_ENCAPSED_STRING)) &&
(is_array($plural) && ($plural[0] == T_CONSTANT_ENCAPSED_STRING));
} else {
if ($this->__tokens[$position + $shift + 5] === ')') {
$comma = $this->__tokens[$position + $shift + 3];
$end = $position + $shift + 5;
} else {
$comma = null;
$end = $position + $shift + 3;
}

list($domain, $firstComma, $text, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $comma, $this->__tokens[$end]);
$condition = ($seoncdComma == ',' || $seoncdComma === null) &&
(is_array($domain) && ($domain[0] == T_CONSTANT_ENCAPSED_STRING)) &&
(is_array($text) && ($text[0] == T_CONSTANT_ENCAPSED_STRING));
}

if (($endParenthesis == ')') && $condition) {
if ($this->__oneFile === true) {
if ($plural) {
$this->__strings[$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][$this->__file][] = $line;
} else {
$this->__strings[$this->__formatString($text[1])][$this->__file][] = $line;
}
} else {
if ($plural) {
$this->__strings[$this->__file][$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][] = $line;
} else {
$this->__strings[$this->__file][$this->__formatString($text[1])][] = $line;
}
}
} else {
$this->__markerError($this->__file, $line, $functionName, $count);
}
}
$count++;
}
}

/**
* Build the translate template file contents out of obtained strings
*
* @access private
*/
function __buildFiles() {
foreach ($this->__strings as $str => $fileInfo) {
$output = '';
$occured = $fileList = array();

if ($this->__oneFile === true) {
foreach ($fileInfo as $file => $lines) {
$occured[] = "$file:" . join(';', $lines);

if (isset($this->__fileVersions[$file])) {
$fileList[] = $this->__fileVersions[$file];
}
}
$occurances = join("\n#: ", $occured);
$occurances = str_replace($this->path, '', $occurances);
$output = "#: $occurances\n";
$filename = $this->__filename;

if (strpos($str, "\0") === false) {
$output .= "msgid \"$str\"\n";
$output .= "msgstr \"\"\n";
} else {
list($singular, $plural) = explode("\0", $str);
$output .= "msgid \"$singular\"\n";
$output .= "msgid_plural \"$plural\"\n";
$output .= "msgstr[0] \"\"\n";
$output .= "msgstr[1] \"\"\n";
}
$output .= "\n";
} else {
foreach ($fileInfo as $file => $lines) {
$filename = $str;
$occured = array("$str:" . join(';', $lines));

if (isset($this->__fileVersions[$str])) {
$fileList[] = $this->__fileVersions[$str];
}
$occurances = join("\n#: ", $occured);
$occurances = str_replace($this->path, '', $occurances);
$output .= "#: $occurances\n";

if (strpos($file, "\0") === false) {
$output .= "msgid \"$file\"\n";
$output .= "msgstr \"\"\n";
} else {
list($singular, $plural) = explode("\0", $file);
$output .= "msgid \"$singular\"\n";
$output .= "msgid_plural \"$plural\"\n";
$output .= "msgstr[0] \"\"\n";
$output .= "msgstr[1] \"\"\n";
}
$output .= "\n";
}
}
$this->__store($filename, $output, $fileList);
}
}

/**
* Prepare a file to be stored
*
* @param string $file Filename
* @param string $input What to store
* @param array $fileList File list
* @param integer $get Set to 1 to get files to store, false to set
* @return mixed If $get == 1, files to store, otherwise void
* @access private
*/
function __store($file = 0, $input = 0, $fileList = array(), $get = 0) {
static $storage = array();

if (!$get) {
if (isset($storage[$file])) {
$storage[$file][1] = array_unique(array_merge($storage[$file][1], $fileList));
$storage[$file][] = $input;
} else {
$storage[$file] = array();
$storage[$file][0] = $this->__writeHeader();
$storage[$file][1] = $fileList;
$storage[$file][2] = $input;
}
} else {
return $storage;
}
}

/**
* Write the files that need to be stored
*
* @access private
*/
function __writeFiles() {
$output = $this->__store(0, 0, array(), 1);
$output = $this->__mergeFiles($output);

foreach ($output as $file => $content) {
$tmp = str_replace(array($this->path, '.php','.ctp','.thtml', '.inc','.tpl' ), '', $file);
$tmp = str_replace(DS, '.', $tmp);
$file = str_replace('.', '-', $tmp) .'.pot';
$fileList = $content[1];

unset($content[1]);

$fileList = str_replace(array($this->path), '', $fileList);

if (count($fileList) > 1) {
$fileList = "Generated from files:\n# " . join("\n# ", $fileList);
} elseif (count($fileList) == 1) {
$fileList = 'Generated from file: ' . join('', $fileList);
} else {
$fileList = 'No version information was available in the source files.';
}

if (is_file($this->__output . $file)) {
$response = '';
while ($response == '') {
$response = $this->in("\n\nError: ".$file . ' already exists in this location. Overwrite?', array('y','n', 'q'), 'n');
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->_stop();
} elseif (strtoupper($response) === 'N') {
$response = '';
while ($response == '') {
$response = $this->in("What would you like to name this file?\nExample: new_" . $file, null, "new_" . $file);
$file = $response;
}
}
}
}
$fp = fopen($this->__output . $file, 'w');
fwrite($fp, str_replace('--VERSIONS--', $fileList, join('', $content)));
fclose($fp);
}
}

/**
* Merge output files
*
* @param array $output Output to merge
* @return array Merged output
* @access private
*/
function __mergeFiles($output) {
foreach ($output as $file => $content) {
if (count($content) <= 1 && $file != $this->__filename) {
@$output[$this->__filename][1] = array_unique(array_merge($output[$this->__filename][1], $content[1]));

if (!isset($output[$this->__filename][0])) {
$output[$this->__filename][0] = $content[0];
}
unset($content[0]);
unset($content[1]);

foreach ($content as $msgid) {
$output[$this->__filename][] = $msgid;
}
unset($output[$file]);
}
}
return $output;
}

/**
* Build the translation template header
*
* @return string Translation template header
* @access private
*/
function __writeHeader() {
$output = "# LANGUAGE translation of CakePHP Application\n";
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
$output .= "# --VERSIONS--\n";
$output .= "#\n";
$output .= "#, fuzzy\n";
$output .= "msgid \"\"\n";
$output .= "msgstr \"\"\n";
$output .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n";
$output .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n";
$output .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n";
$output .= "\"Last-Translator: NAME <EMAIL@ADDRESS>\\n\"\n";
$output .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\n\"\n";
$output .= "\"MIME-Version: 1.0\\n\"\n";
$output .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n";
$output .= "\"Content-Transfer-Encoding: 8bit\\n\"\n";
$output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n";
return $output;
}

/**
* Find the version number of a file looking for SVN commands
*
* @param string $code Source code of file
* @param string $file File
* @access private
*/
function __findVersion($code, $file) {
$header = '$Id' . ':';
if (preg_match('/\\' . $header . ' [\\w.]* ([\\d]*)/', $code, $versionInfo)) {
$version = str_replace(ROOT, '', 'Revision: ' . $versionInfo[1] . ' ' .$file);
$this->__fileVersions[$file] = $version;
}
}

/**
* Format a string to be added as a translateable string
*
* @param string $string String to format
* @return string Formatted string
* @access private
*/
function __formatString($string) {
$quote = substr($string, 0, 1);
$string = substr($string, 1, -1);
if ($quote == '"') {
$string = stripcslashes($string);
} else {
$string = strtr($string, array("\\'" => "'", "\\\\" => "\\"));
}
$string = str_replace("\r\n", "\n", $string);
return addcslashes($string, "\0..\37\\\"");
}

/**
* Indicate an invalid marker on a processed file
*
* @param string $file File where invalid marker resides
* @param integer $line Line number
* @param string $marker Marker found
* @param integer $count Count
* @access private
*/
function __markerError($file, $line, $marker, $count) {
$this->out("Invalid marker content in $file:$line\n* $marker(", true);
$count += 2;
$tokenCount = count($this->__tokens);
$parenthesis = 1;

while ((($tokenCount - $count) > 0) && $parenthesis) {
if (is_array($this->__tokens[$count])) {
$this->out($this->__tokens[$count][1], false);
} else {
$this->out($this->__tokens[$count], false);
if ($this->__tokens[$count] == '(') {
$parenthesis++;
}

if ($this->__tokens[$count] == ')') {
$parenthesis--;
}
}
$count++;
}
$this->out("\n", true);
}

/**
* Search the specified path for files that may contain translateable strings
*
* @param string $path Path (or set to null to use current)
* @return array Files
* @access private
*/
function __searchDirectory($path = null) {
if ($path === null) {
$path = $this->path .DS;
}
$files = glob("$path*.{php,ctp,thtml,inc,tpl}", GLOB_BRACE);
$dirs = glob("$path*", GLOB_ONLYDIR);

$files = $files ? $files : array();
$dirs = $dirs ? $dirs : array();

foreach ($dirs as $dir) {
if (!preg_match("!(^|.+/)(CVS|.svn)$!", $dir)) {
$files = array_merge($files, $this->__searchDirectory("$dir" . DS));
if (($id = array_search($dir . DS . 'extract.php', $files)) !== FALSE) {
unset($files[$id]);
}
}
}
return $files;
}
}
?>


Wed Aug 19, 2009 9:40 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Tue May 05, 2009 3:29 pm
Posts: 7173
Paul1965 wrote:
Image


Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

Image

8-)

_________________
timark_uk wrote:
That's your problem. You need Linux. That'll fix all your problems.
Mark


Wed Aug 19, 2009 9:40 pm
Profile
Doesn't have much of a life

Joined: Thu Apr 23, 2009 6:54 pm
Posts: 572
<?php
/**
* The FixtureTask handles creating and updating fixture files.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc.
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.console.libs.tasks
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/

/**
* Task class for creating and updating fixtures files.
*
* @package cake
* @subpackage cake.cake.console.libs.tasks
*/
class FixtureTask extends Shell {

/**
* Name of plugin
*
* @var string
* @access public
*/
var $plugin = null;

/**
* Tasks to be loaded by this Task
*
* @var array
* @access public
*/
var $tasks = array('DbConfig', 'Model', 'Template');

/**
* path to fixtures directory
*
* @var string
* @access public
*/
var $path = null;

/**
* The db connection being used for baking
*
* @var string
**/
var $connection = null;

/**
* Schema instance
*
* @var object
**/
var $_Schema = null;

/**
* Override initialize
*
* @access public
*/
function __construct(&$dispatch) {
parent::__construct($dispatch);
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
if (!class_exists('CakeSchema')) {
App::import('Model', 'CakeSchema', false);
}
}

/**
* Execution method always used for tasks
* Handles dispatching to interactive, named, or all processess.
*
* @access public
*/
function execute() {
if (empty($this->args)) {
$this->__interactive();
}

if (isset($this->args[0])) {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') {
return $this->all();
}
$model = Inflector::camelize($this->args[0]);
$this->bake($model);
}
}

/**
* Bake All the Fixtures at once. Will only bake fixtures for models that exist.
*
* @access public
* @return void
**/
function all() {
$this->interactive = false;
$tables = $this->Model->listAll($this->connection, false);
foreach ($tables as $table) {
$model = $this->_modelName($table);
$this->bake($model);
}
}

/**
* Interactive baking function
*
* @access private
*/
function __interactive() {
$this->interactive = true;
$this->hr();
$this->out(sprintf("Bake Fixture\nPath: %s", $this->path));
$this->hr();

$useDbConfig = $this->connection;
if (!isset($this->connection)) {
$this->connection = $this->DbConfig->getConfig();
}
$modelName = $this->Model->getName($this->connection);
$useTable = $this->Model->getTable($modelName, $this->connection);
$importOptions = $this->importOptions($modelName);
$this->bake($modelName, $useTable, $importOptions);
}

/**
* Interacts with the User to setup an array of import options. For a fixture.
*
* @param string $modelName Name of model you are dealing with.
* @return array Array of import options.
**/
function importOptions($modelName) {
$options = array();
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
if ($doSchema == 'y') {
$options['schema'] = $modelName;
}
$doRecords = $this->in(__('Would you like to use record importing for this fixture?', true), array('y', 'n'), 'n');
if ($doRecords == 'y') {
$options['records'] = true;
}
if ($doRecords == 'n') {
$prompt = sprintf(__("Would you like to build this fixture with data from %s's table?", true), $modelName);
$fromTable = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($fromTable) == 'y') {
$options['fromTable'] = true;
}
}
return $options;
}

/**
* Assembles and writes a Fixture file
*
* @param string $model Name of model to bake.
* @param string $useTable Name of table to use.
* @param array $importOptions Options for var $import
* @return string Baked fixture
* @access private
*/
function bake($model, $useTable = false, $importOptions = array()) {
$table = $schema = $records = $import = $modelImport = $recordImport = null;
if (!$useTable) {
$useTable = Inflector::tableize($model);
} elseif ($useTable != Inflector::tableize($model)) {
$table = $useTable;
}

if (!empty($importOptions)) {
if (isset($importOptions['schema'])) {
$modelImport = "'model' => '{$importOptions['schema']}'";
}
if (isset($importOptions['records'])) {
$recordImport = "'records' => true";
}
if ($modelImport && $recordImport) {
$modelImport .= ', ';
}
if (!empty($modelImport) || !empty($recordImport)) {
$import = sprintf("array(%s%s)", $modelImport, $recordImport);
}
}

$this->_Schema = new CakeSchema();
$data = $this->_Schema->read(array('models' => false, 'connection' => $this->connection));

if (!isset($data['tables'][$useTable])) {
$this->err('Could not find your selected table ' . $useTable);
return false;
}

$tableInfo = $data['tables'][$useTable];
if (is_null($modelImport)) {
$schema = $this->_generateSchema($tableInfo);
}

if (!isset($importOptions['records']) && !isset($importOptions['fromTable'])) {
$recordCount = 1;
if (isset($this->params['count'])) {
$recordCount = $this->params['count'];
}
$records = $this->_makeRecordString($this->_generateRecords($tableInfo, $recordCount));
}
if (isset($importOptions['fromTable'])) {
$records = $this->_makeRecordString($this->_getRecordsFromTable($model, $useTable));
}
$out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));
return $out;
}

/**
* Generate the fixture file, and write to disk
*
* @param string $model name of the model being generated
* @param string $fixture Contents of the fixture file.
* @access public
* @return void
**/
function generateFixtureFile($model, $otherVars) {
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
$vars = array_merge($defaults, $otherVars);

$path = $this->path;
if (isset($this->plugin)) {
$path = $this->_pluginPath($this->plugin) . 'tests' . DS . 'fixtures' . DS;
}
$filename = Inflector::underscore($model) . '_fixture.php';

$this->Template->set('model', $model);
$this->Template->set($vars);
$content = $this->Template->generate('classes', 'fixture');

$this->out("\nBaking test fixture for $model...");
$this->createFile($path . $filename, $content);
return $content;
}

/**
* Generates a string representation of a schema.
*
* @param array $table Table schema array
* @return string fields definitions
**/
function _generateSchema($tableInfo) {
$cols = array();
$out = "array(\n";
foreach ($tableInfo as $field => $fieldInfo) {
if (is_array($fieldInfo)) {
if ($field != 'indexes') {
$col = "\t\t'{$field}' => array('type'=>'" . $fieldInfo['type'] . "', ";
$col .= join(', ', $this->_Schema->__values($fieldInfo));
} else {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$fieldInfo as $key => $index) {
$props[] = "'{$key}' => array(".join(', ', $this->_Schema->__values($index)).")";
}
$col .= join(', ', $props);
}
$col .= ")";
$cols[] = $col;
}
}
$out .= join(",\n", $cols);
$out .= "\n\t)";
return $out;
}

/**
* Generate String representation of Records
*
* @param array $table Table schema array
* @return array Array of records to use in the fixture.
**/
function _generateRecords($tableInfo, $recordCount = 1) {
$records = array();
for ($i = 0; $i < $recordCount; $i++) {
$record = array();
foreach ($tableInfo as $field => $fieldInfo) {
if (empty($fieldInfo['type'])) {
continue;
}
switch ($fieldInfo['type']) {
case 'integer':
$insert = $i + 1;
break;
case 'string';
$isPrimaryUuid = (
isset($fieldInfo['key']) && strtolower($fieldInfo['key']) == 'primary' &&
isset($fieldInfo['length']) && $fieldInfo['length'] == 36
);
if ($isPrimaryUuid) {
$insert = String::uuid();
} else {
$insert = "Lorem ipsum dolor sit amet";
if (!empty($fieldInfo['length'])) {
$insert = substr($insert, 0, (int)$fieldInfo['length'] - 2);
}
}
$insert = "'$insert'";
break;
case 'timestamp':
$ts = time();
$insert = "'$ts'";
break;
case 'datetime':
$ts = date('Y-m-d H:i:s');
$insert = "'$ts'";
break;
case 'date':
$ts = date('Y-m-d');
$insert = "'$ts'";
break;
case 'time':
$ts = date('H:i:s');
$insert = "'$ts'";
break;
case 'boolean':
$insert = 1;
break;
case 'text':
$insert = "'Lorem ipsum dolor sit amet, aliquet feugiat.";
$insert .= " Convallis morbi fringilla gravida,";
$insert .= " phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin";
$insert .= " venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla";
$insert .= " vestibulum massa neque ut et, id hendrerit sit,";
$insert .= " feugiat in taciti enim proin nibh, tempor dignissim, rhoncus";
$insert .= " duis vestibulum nunc mattis convallis.'";
break;
}
$record[$field] = $insert;
}
$records[] = $record;
}
return $records;
}

/**
* Convert a $records array into a a string.
*
* @param array $records Array of records to be converted to string
* @return string A string value of the $records array.
**/
function _makeRecordString($records) {
$out = "array(\n";
foreach ($records as $record) {
$values = array();
foreach ($record as $field => $value) {
$values[] = "\t\t\t'$field' => $value";
}
$out .= "\t\tarray(\n";
$out .= implode(",\n", $values);
$out .= "\n\t\t),\n";
}
$out .= "\t)";
return $out;
}

/**
* Interact with the user to get a custom SQL condition and use that to extract data
* to build a fixture.
*
* @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use.
* @return array Array of records.
**/
function _getRecordsFromTable($modelName, $useTable = null) {
$condition = null;
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true);
while (!$condition) {
$condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10');
}
App::import('Model', 'Model', false);
$modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection));
$records = $modelObject->find('all', array(
'conditions' => $condition,
'recursive' => -1
));
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
$schema = $modelObject->schema();
$out = array();
foreach ($records as $record) {
$row = array();
foreach ($record[$modelObject->alias] as $field => $value) {
$row[$field] = $db->value($value, $schema[$field]['type']);
}
$out[] = $row;
}
return $out;
}

/**
* Displays help contents
*
* @access public
*/
function help() {
$this->hr();
$this->out("Usage: cake bake fixture <arg1> <params>");
$this->hr();
$this->out('Commands:');
$this->out("\nfixture <name>\n\tbakes fixture with specified name.");
$this->out("\nfixture all\n\tbakes all fixtures.");
$this->out("");
$this->out('Parameters:');
$this->out("\t-count When using generated data, the number of records to include in the fixture(s).");
$this->out("\t-connection Which database configuration to use for baking.");
$this->out("\t-plugin lowercased_underscored name of plugin to bake fixtures for.");
$this->out("");
$this->_stop();
}
}
?>


Wed Aug 19, 2009 9:40 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 8:29 pm
Posts: 5975
Image

_________________
"I hadn't known there were so many idiots in the world until I started using the Internet." - Stanislaw Lem


Wed Aug 19, 2009 9:40 pm
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 1075 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 72  Next

Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.