code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  'This is required by encrypt and decrypt methods.' => 'É necessário aos métodos encrypt e decrypt.',
  '$_SERVER does not have {vars}.' => '$_SERVER não possui {vars}.',
  '$_SERVER variable' => 'variável $_SERVER',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] precisa ser o mesmo que o arquivo de script de entrada.',
  'APC extension' => 'extensão APC',
  'All DB-related classes' => 'Todas as classes relacionadas ao banco de dados',
  'DOM extension' => 'extensão DOM',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"] ou $_SERVER["QUERY_STRING"] é obrigatório.',
  'GD extension' => 'extensão GD',
  'Mcrypt extension' => 'extensão Mcrypt',
  'Memcache extension' => 'extensão Memcache',
  'PCRE extension' => 'extensão PCRE',
  'PDO MySQL extension' => 'extensão PDO_MySQL',
  'PDO PostgreSQL extension' => 'extensão PDO_PostgreSQL',
  'PDO SQLite extension' => 'extensão PDO_SQLite',
  'PDO extension' => 'extensão PDO',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0 ou mais recente é necessário.',
  'PHP version' => 'versão PHP',
  'Reflection extension' => 'extensão Reflection',
  'SOAP extension' => 'extensão SOAP',
  'SPL extension' => 'extensão SPL',
  'This is required if you are using MySQL database.' => 'Este item é obrigatório se você estiver utilizando MySQL.',
  'This is required if you are using PostgreSQL database.' => 'Este item é obrigatório se você estiver utilizando PostgreSQL.',
  'This is required if you are using SQLite database.' => 'Este item é obrigatório se você estiver utilizando SQLite.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Não foi possível determinar o caminho da URL. Verifique se $_SERVER["PATH_INFO"] (ou $_SERVER["PHP_SELF"] e $_SERVER["SCRIPT_NAME"]) contem os valores corretos.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  'Ctype extension' => 'extensão Ctype',
  'GD extension with
FreeType support' => 'extensão GD com
suporte a FreeType',
  'GD installed
FreeType support not installed' => 'GD instalada
suporte a FreeType não instalado',
  'GD not installed' => 'GD não instalada',
  'To use memcached set CMemCache::useMemcached to true.' => 'Para usar memcached configure CMemCache::useMemcached como true.',
  'GD extension' => '@@extensão GD@@',
  '$_SERVER does not have {vars}.' => '$_SERVER não possui {vars}.',
  '$_SERVER variable' => 'variável $_SERVER',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] precisa ser o mesmo que o arquivo de script de entrada.',
  'APC extension' => 'extensão APC',
  'All DB-related classes' => 'Todas as classes relacionadas ao banco de dados',
  'DOM extension' => 'extensão DOM',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"] ou $_SERVER["QUERY_STRING"] é obrigatório.',
  'Mcrypt extension' => 'extensão Mcrypt',
  'Memcache extension' => 'extensão Memcache',
  'PCRE extension' => 'extensão PCRE',
  'PDO MySQL extension' => 'extensão PDO_MySQL',
  'PDO PostgreSQL extension' => 'extensão PDO_PostgreSQL',
  'PDO SQLite extension' => 'extensão PDO_SQLite',
  'PDO extension' => 'extensão PDO',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0 ou mais recente é necessário.',
  'PHP version' => 'versão PHP',
  'Reflection extension' => 'extensão Reflection',
  'SOAP extension' => 'extensão SOAP',
  'SPL extension' => 'extensão SPL',
  'This is required by encrypt and decrypt methods.' => 'Este item é necessário aos métodos encrypt e decrypt.',
  'This is required if you are using MySQL database.' => 'Este item é obrigatório se você estiver utilizando MySQL.',
  'This is required if you are using PostgreSQL database.' => 'Este item é obrigatório se você estiver utilizando PostgreSQL.',
  'This is required if you are using SQLite database.' => 'Este item é obrigatório se você estiver utilizando SQLite.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Não foi possível determinar o caminho da URL. Verifique se $_SERVER["PATH_INFO"] (ou $_SERVER["PHP_SELF"] e $_SERVER["SCRIPT_NAME"]) contem os valores corretos.',
);

repo_name: DaSourcerer/yii

license: mit


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => '$_SERVER nu are {vars}.',
  '$_SERVER variable' => 'Variabila $_SERVER',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] trebuie sa fie aceeasi cu calea fisierului scriptului de intrare.',
  'APC extension' => 'Extensia APC',
  'All DB-related classes' => 'Toate clasele de legatura cu bazele de date',
  'DOM extension' => 'Extensia DOM',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => 'Trebuie sa existe fie $_SERVER["REQUEST_URI"] fie $_SERVER["QUERY_STRING"].',
  'GD extension' => 'Extensia GD',
  'Mcrypt extension' => 'Extensia Mcrypt',
  'Memcache extension' => 'Extensia  Memcache',
  'PCRE extension' => 'Extensia PCRE',
  'PDO MySQL extension' => 'Extensia PDO MySQL',
  'PDO PostgreSQL extension' => 'Extensia PDO PostgreSQL',
  'PDO SQLite extension' => 'Extensia PDO SQLite',
  'PDO extension' => 'Extensia PDO',
  'PHP 5.1.0 or higher is required.' => 'Este obligatoriu PHP 5.1.0 sau mai nou.',
  'PHP version' => 'Versiunea PHP',
  'Reflection extension' => 'Extensia Reflection',
  'SOAP extension' => 'Extensia SOAP',
  'SPL extension' => 'Extensia SPL',
  'This is required by encrypt and decrypt methods.' => 'Obligatoriu pentru metodele encrypt si decrypt.',
  'This is required if you are using MySQL database.' => 'Obligatoriu daca folositi baza de date MySQL.',
  'This is required if you are using PostgreSQL database.' => 'Obligatoriu daca folositi baza de date PostgreSQL.',
  'This is required if you are using SQLite database.' => 'Obligatoriu daca folositi baza de date SQLite.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Nu se pot determina informatiile despre calea URL. Asigurati-va ca $_SERVER["PATH_INFO"] (sau $_SERVER["PHP_SELF"] si $_SERVER["SCRIPT_NAME"]) contine valoarea potrivita.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => 'Переменная $_SERVER не содержит {vars}.',
  '$_SERVER variable' => 'Переменная $_SERVER.',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => 'Переменная $_SERVER["SCRIPT_FILENAME"] должна соответствовать пути к файлу входного скрипта.',
  'APC extension' => 'Расширение APC',
  'All DB-related classes' => 'Все DB-классы',
  'DOM extension' => 'Расширение DOM',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => 'Должна существовать хотя бы одна из серверных переменных: $_SERVER["REQUEST_URI"] или $_SERVER["QUERY_STRING"].',
  'GD extension' => 'Расширение GD',
  'Mcrypt extension' => 'Расширение Mcrypt',
  'Memcache extension' => 'Расширение Memcache',
  'PCRE extension' => 'Расширение PCRE',
  'PDO MySQL extension' => 'Расширение PDO MySQL',
  'PDO PostgreSQL extension' => 'Расширение PDO PostgreSQL',
  'PDO SQLite extension' => 'Расширение PDO SQLite',
  'PDO extension' => 'Расширение PDO',
  'PHP 5.1.0 or higher is required.' => 'Необходима версия РНР 5.1.0 и выше.',
  'PHP version' => 'Версия РНР',
  'Reflection extension' => 'Расширение',
  'SOAP extension' => 'Расширение SOAP',
  'SPL extension' => 'Расширение SPL',
  'This is required by encrypt and decrypt methods.' => 'Требуется для работы методов шифрования и дешифрации.',
  'This is required if you are using MySQL database.' => 'Требуется для работы с БД MySQL.',
  'This is required if you are using PostgreSQL database.' => 'Требуется для работы с БД PostgreSQL.',
  'This is required if you are using SQLite database.' => 'Требуется для работы с БД SQLite.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Не удалось получить информацию о пути. Пожалуйста, проверьте, содержится ли корректное значение в переменной $_SERVER["PATH_INFO"] (или $_SERVER["PHP_SELF"] и $_SERVER["SCRIPT_NAME"]).',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  'This is required by encrypt and decrypt methods.' => 'Nevyhnutné pre kryptovacie a dekryptovacie metódy.',
  '$_SERVER does not have {vars}.' => '$_SERVER nenašiel {vars}.',
  '$_SERVER variable' => '$_SERVER premenná',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] musí ukazovať na štartovací skript.',
  'APC extension' => 'APC rozšírenie',
  'All DB-related classes' => 'Všetky objekty vzťahujúce sa k databáze',
  'DOM extension' => 'DOM rozšírenie',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"] alebo $_SERVER["QUERY_STRING"] musia existovať.',
  'GD extension' => 'GD rozšírenie',
  'Mcrypt extension' => 'Mcrypt rozšírenie',
  'Memcache extension' => 'Memcache rozšírenie',
  'PCRE extension' => 'PCRE rozšírenie',
  'PDO MySQL extension' => 'PDO MySQL rozšírenie',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL rozšírenie',
  'PDO SQLite extension' => 'PDO SQLite rozšírenie',
  'PDO extension' => 'PDO rozšírenie',
  'PHP 5.1.0 or higher is required.' => 'Je potrebná verzia PHP 5.1.0 alebo vyššia.',
  'PHP version' => 'PHP verzia',
  'Reflection extension' => 'Reflection rozšírenie',
  'SOAP extension' => 'SOAP rozšírenie',
  'SPL extension' => 'SPL rozšírenie',
  'This is required if you are using MySQL database.' => 'Potrebné v prípade využitia databázy mySQL.',
  'This is required if you are using PostgreSQL database.' => 'Potrebné v prípade využitia databázy PostgreSQL.',
  'This is required if you are using SQLite database.' => 'Potrebné v prípade využitia databázy SQLite.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Nepodarilo sa zistiť informácie o URL linke. Ubezúpečte sa, že $_SERVER["PATH_INFO"] (alebo $_SERVER["PHP_SELF"] a $_SERVER["SCRIPT_NAME"]) obsahuje správne hodnoty.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * Message string can be used with plural forms format. Check i18n section
 * of the guide for details.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  'Ctype extension' => 'Ctype-tillägg',
  '$_SERVER does not have {vars}.' => '$_SERVER innehåller inte {vars}.',
  '$_SERVER variable' => '$_SERVER-variabel',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] måste vara samma som startskriptets namn och sökväg.',
  'APC extension' => 'APC-tillägg',
  'All DB-related classes' => 'Alla DB-relaterade klasser',
  'DOM extension' => 'DOM-tillägg',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => 'Antingen $_SERVER["REQUEST_URI"] eller $_SERVER["QUERY_STRING"] måste finnas.',
  'GD extension with
FreeType support' => 'GD-tillägg med
FreeType-stöd',
  'GD installed
FreeType support not installed' => 'GD installerad
FreeType-stöd ej installerat',
  'GD not installed' => 'GD ej installerat',
  'Mcrypt extension' => 'Mcrypt-tillägg',
  'Memcache extension' => 'Memcache-tillägg',
  'PCRE extension' => 'PCRE-tillägg',
  'PDO MySQL extension' => 'PDO MySQL-tillägg',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL-tillägg',
  'PDO SQLite extension' => 'PDO SQLite-tillägg',
  'PDO extension' => 'PDO-tillägg',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0 eller senare krävs',
  'PHP version' => 'PHP-version',
  'Reflection extension' => 'Reflection-tillägg',
  'SOAP extension' => 'SOAP-tillägg',
  'SPL extension' => 'SPL-tillägg',
  'This is required by encrypt and decrypt methods.' => 'Detta krävs av krypterings- och dekrypteringsmetoderna',
  'This is required if you are using MySQL database.' => 'Detta krävs om MySQL-databas används.',
  'This is required if you are using PostgreSQL database.' => 'Detta krävs om PostgresSQL-databas används.',
  'This is required if you are using SQLite database.' => 'Detta krävs om SQLite-databas används.',
  'To use memcached set CMemCache::useMemcached to true.' => 'För att använda memcached, sätt CMemCache::useMemcached till true.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Kan inte avgöra URL:ens sökvägsinfo. Kontrollera att $_SERVER["PATH_INFO"] (eller $_SERVER["PHP_SELF"] och $_SERVER["SCRIPT_NAME"]) innehåller korrekta värden.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @author Srinivasan A Paul Joseph <sapauljoseph@gmail.com>
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => '$_SERVER {vars} ஐக் கொண்டிருக்கவில்லை.',
  '$_SERVER variable' => '$_SERVER மாறிலி',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] வழித்தடம் முதன்மை வழித்தடத்திலிருக்க வேண்டும்.',
  'APC extension' => 'APC நீட்சி',
  'All DB-related classes' => 'தகவல்தளம் சம்பந்தப்பட்ட உருக்கள் அனைத்தும்',
  'DOM extension' => 'DOM நீட்சி',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"] அல்லது $_SERVER["QUERY_STRING"] கண்டிப்பாக இருக்க வேண்டும்.',
  'GD extension with
FreeType support' => 'GD நீட்சி
FreeType பயன்பாட்டுடன்',
  'GD installed
FreeType support not installed' => 'GD நிறுவப்பட்டுள்ளது
FreeType பயன்பாடு நிறுவப்பட்டிருக்கவில்லை',
  'GD not installed' => 'GD நிறுவப்பட்டிருக்கவில்லை',
  'Mcrypt extension' => 'Mcrypt நீட்சி',
  'Memcache extension' => 'Memcache நீட்சி',
  'PCRE extension' => 'PCRE நீட்சி',
  'PDO MySQL extension' => 'PDO MySQL நீட்சி',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL நீட்சி',
  'PDO SQLite extension' => 'PDO SQLite நீட்சி',
  'PDO extension' => 'PDO நீட்சி',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0 அல்லது மேன்மையானது இருத்தல் வேண்டும்.',
  'PHP version' => 'PHP பதிப்பு',
  'Reflection extension' => 'Reflection நீட்சி',
  'SOAP extension' => 'SOAP நீட்சி',
  'SPL extension' => 'SPL நீட்சி',
  'This is required by encrypt and decrypt methods.' => 'இது encrypt மற்றும் decrypt பயன்பாடுகளுக்குத் தேவையானது.',
  'This is required if you are using MySQL database.' => 'நீங்கள் MySQL தகவல்தளத்தை உபயோகப்படுத்தினால் இது தேவையானது.',
  'This is required if you are using PostgreSQL database.' => 'நீங்கள் PostgreSQL தகவல்தளத்தை உபயோகப்படுத்தினால் இது தேவையானது.',
  'This is required if you are using SQLite database.' => 'நீங்கள் SQLite தகவல்தளத்தை உபயோகப்படுத்தினால் இது தேவையானது.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'முகவரியின் தகவல்களைப் பெற இயலவில்லை. தயவுசெய்து $_SERVER["PATH_INFO"] (அல்லது $_SERVER["PHP_SELF"] மற்றும் $_SERVER["SCRIPT_NAME"]) தகவல்களை சரிபார்க்கவும்.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => '$_SERVER không chứa {vars}',
  '$_SERVER variable' => 'Biến $_SERVER',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] phải giống đường dẫn của file khởi động',
  'APC extension' => 'APC extension',
  'All DB-related classes' => 'Tất cả các lớp liên quan đến CSDL',
  'DOM extension' => 'DOM extension',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => 'Biến $_SERVER["REQUEST_URI"] hoặc $_SERVER["QUERY_STRING"] phải tồn tại.',
  'GD extension' => 'GD extension',
  'Mcrypt extension' => 'Mcrypt extension',
  'Memcache extension' => 'Memcache extension',
  'PCRE extension' => 'PCRE extension',
  'PDO MySQL extension' => 'PDO MySQl extension',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL extension',
  'PDO SQLite extension' => 'PDO SQLite extension',
  'PDO extension' => 'PDO extension',
  'PHP 5.1.0 or higher is required.' => 'Phải có PHP 5.1.0 hoặc mới hơn',
  'PHP version' => 'Phiên bản PHP',
  'Reflection extension' => 'Reflection extension',
  'SOAP extension' => 'SOAP extension',
  'SPL extension' => 'SPL extension',
  'This is required if you are using MySQL database.' => 'Cần phải có nếu bạn dùng MySQL',
  'This is required if you are using PostgreSQL database.' => 'Cần phải có nếu bạn dùng PostgreSQL',
  'This is required if you are using SQLite database.' => 'Cần phải có nếu bạn dùng SQLite',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => 'Không xác định được thông tin đường dẫn URL. Hãy kiểm tra đảm bảo $_SERVER["PATH_INFO"] (hoặc $_SERVER["PHP_SELF"] và $_SERVER["SCRIPT_NAME"]) có giá trị đúng.',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id$
 */
return array (
  'PHP version' => 'PHP版本',
  'PHP 5.1.0 or higher is required.' => 'PHP 5.1.0或更高版本是必须的。',
  '$_SERVER variable' => '$_SERVER变量',
  'Reflection extension' => 'Reflection扩展模块',
  'PCRE extension' => 'PCRE扩展模块',
  'SPL extension' => 'SPL扩展模块',
  'DOM extension' => 'DOM扩展模块',
  'PDO extension' => 'PDO扩展模块',
  'All DB-related classes' => '所有和数据库相关的类',
  'Memcache extension' => 'Memcache扩展模块',
  'APC extension' => 'APC扩展模块',
  'Mcrypt extension' => 'Mcrypt扩展模块',
  'SOAP extension' => 'SOAP扩展模块',
  'GD extension' => 'GD扩展模块',
  '$_SERVER does not have {vars}.' => '$_SERVER缺少{vars}。',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"]必须与入口文件路径一致。',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"]或$_SERVER["QUERY_STRING"]必须存在。',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => '无法确定URL path info。请检查$_SERVER["PATH_INFO"]（或$_SERVER["PHP_SELF"]和$_SERVER["SCRIPT_NAME"]）的值是否正确。',
  'PDO SQLite extension' => 'PDO SQLite扩展模块',
  'This is required if you are using SQLite database.' => '如果使用SQLite数据库，这是必须的。',
  'PDO MySQL extension' => 'PDO MySQL扩展模块',
  'This is required if you are using MySQL database.' => '如果使用MySQL数据库，这是必须的。',
  'PDO PostgreSQL extension' => 'PDO PostgreSQL扩展模块',
  'This is required if you are using PostgreSQL database.' => '如果使用PostgreSQL数据库，这是必须的。',
);


code:
<?php
/**
 * Message translations.
 *
 * This file is automatically generated by 'yiic message' command.
 * It contains the localizable messages extracted from source code.
 * You may modify this file by translating the extracted messages.
 *
 * Each array element represents the translation (value) of a message (key).
 * If the value is empty, the message is considered as not translated.
 * Messages that no longer need translation will have their translations
 * enclosed between a pair of '@@' marks.
 *
 * NOTE, this file must be saved in UTF-8 encoding.
 *
 * @version $Id: $
 */
return array (
  '$_SERVER does not have {vars}.' => '$_SERVER 中沒有 {vars}.',
  '$_SERVER variable' => '$_SERVER 變數',
  '$_SERVER["SCRIPT_FILENAME"] must be the same as the entry script file path.' => '$_SERVER["SCRIPT_FILENAME"] 必須與入口腳本檔案路徑一致.',
  'APC extension' => '',
  'All DB-related classes' => '所有 資料庫相關的類別',
  'DOM extension' => '',
  'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.' => '$_SERVER["REQUEST_URI"] 或 $_SERVER["QUERY_STRING"] 必須存在.',
  'GD extension' => '',
  'Mcrypt extension' => '',
  'Memcache extension' => '',
  'PCRE extension' => '',
  'PDO MySQL extension' => '',
  'PDO PostgreSQL extension' => '',
  'PDO SQLite extension' => '',
  'PDO extension' => '',
  'PHP 5.1.0 or higher is required.' => '需要 PHP 5.1.0 或之後的版本.',
  'PHP version' => 'PHP 版本',
  'Reflection extension' => '',
  'SOAP extension' => '',
  'SPL extension' => '',
  'This is required if you are using MySQL database.' => '當使用 MySQL 資料庫時, 此項為必要.',
  'This is required if you are using PostgreSQL database.' => '當使用 PostgreSQL 資料庫時, 此項為必要.',
  'This is required if you are using SQLite database.' => '當使用 SQLite 資料庫時, 此項為必要.',
  'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.' => '無法確認 URL 路徑資訊. 請確定 $_SERVER["PATH_INFO"] (或 $_SERVER["PHP_SELF"] 與 $_SERVER["SCRIPT_NAME"]) 包含適當的值.',
);


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="ar"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>مدقق متطلبات Yii</title>

مدقق متطلبات Yii

الوصف

يتحقق هذا السكربت ماإذا كانت إعدادات الخادم لديك تفي بمتطلبات تشغيل تطبيقات الويب لاطار العمل Yii.
يتحقق ايضا ما إذا كان الخادم يعمل على الإصدارة  الصحيحة من PHP،
تحميل اللاحقات المناسبة، وأيضا ما إذا كانت إعدادات ملف php.ini صحيحة.

النتيجة

<?php if($result>0): ?>
تهانينا! إعدادات الخادم لديك مستوفية جميع متطلبات تشغيل Yii.
<?php elseif($result<0): ?>
إعدادات الخادم الخاص بك مستوفية للحد الادنى لمتطلبات تشغيل Yii. الرجاء ملاحظة قائمة التنبيهات أدناه وما إذا كان التطبيق الخاص بك يستخدم أحد هذه المزايا.
<?php else: ?>
لسوء الحظ إعدادات الخادم الخاص بك لا تلبي متطلبات تشغيل Yii.
<?php endif; ?>

التفاصيل

الاسم	النتيجة	مطلوب من قبل	ملاحظات

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'نجح' : ($requirement[1] ? 'فشل' : 'تنبيه'); ?>">
	<?php echo $requirement[2] ? 'نجح' : ($requirement[1] ? 'فشل' : 'تنبيه'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	نجح
 	فشل
 	تنبيه

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii Requirement Checker</title>

Проверка на изискванията на Yii

Описание

This script checks if your server configuration meets the requirements
for running Yii Web applications.
It checks if the server is running the right version of PHP,
if appropriate PHP extensions have been loaded, and if php.ini file settings are correct.

Този скрипт проверява дали конфигурацията на вавият сървър, отговаря на изискванията за
работа на Yii уеб приложенията.
Проверява дали на сървъра работи подходящата версия на PHP,
дали подходящите PHP добавки са заредени и дали настройките в php.ini са вярни

Заключение

<?php if($result>0): ?>
Congratulations! Your server configuration satisfies all requirements by Yii.
Поздравление! Вашият сървър отговаря на всики изисквания за работа на Yii.
<?php elseif($result<0): ?>
Вашият сървър удоблетворява минималните изисквания на Yii. Моля, обърнете внимание на списъка с грешки отдоло, ако вашето приложение ще използва тези функции.
<?php else: ?>
За жалост, вашият сървър, не отговаря на изискванията за работа на Yii.
<?php endif; ?>

Детайли

Име	Резултат	Поискано от	Бележка

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Passed' : ($requirement[1] ? 'Failed' : 'Warning'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	преминат
 	провален
 	предупреждение

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii Anforderungs-Tester</title>

Yii Anforderungs-Tester

Beschreibung

Dieses Script ermittelt, ob Ihre Serverkonfiguration die Anforderungen zum
Ausführen von Yii Webanwendungen
erfüllt.
Es prüft auf die korrekte PHP Version, ob die benötigten Erweiterungen
geladen wurden und ob die Einstellungen in der php.ini korrekt sind

Zusammenfassung

<?php if($result>0): ?>
Gratulation! Ihr Server erfüllt alle Anforderungen von Yii.
<?php elseif($result<0): ?>
Ihr Server erfüllt die minimalen Anforderungen von Yii. Bitte beachten Sie die untenstehenden Warnungen, wenn Ihre Anwendungen einige dieser Features verwenden sollen.
 <?php else: ?>
Unglücklicherweise erfüllt Ihr Server die Anforderungen von Yii nicht.
<?php endif; ?>

Details

Name	Resultat	Benötigt von	Memo

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Bestanden' : ($requirement[1] ? 'Verfehlt' : 'Warnung'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	Bestanden
 	Verfehlt
 	Warnung

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Ελεγκτής Απαιτήσεων Yii</title>

Ελεγκτής Απαιτήσεων Yii

Περιγραφή

Αυτή η σελίδα ελέγχει αν η παραμετροποίηση του διακομιστή σας είναι σωστή
για την εκτέλεση των εφαρμογών ιστού του Yii.
Ελέγχει αν ο διακομιστής εκτελεί τη σωστή έκδοση PHP, αν έχουν φορτωθεί
οι κατάλληλες επεκτάσεις PHP και αν οι ρυθμίσεις του αρχείου php.ini είναι σωστές.

Συμπέρασμα

<?php if($result>0): ?>
Συγχαρητήρια! Η παραμετροποίηση του διακομιστή σας ικανοποιεί όλες τις απαιτήσεις του Yii.
<?php elseif($result<0): ?>
Η παραμετροποίηση του διακομιστή σας ικανοποιεί τις ελάχιστες απαιτήσεις του Yii. Παρακαλούμε δείτε με προσοχή τις παρακάτω προειδοποιήσεις εφόσον η εφαρμογή σας θα χρησιμοποιεί τα αντίστοιχα χαρακτηριστικά.
<?php else: ?>
Δυστυχώς, η παραμετροποίηση του διακομιστή σας δεν ικανοποιεί τις απαιτήσεις του Yii.
<?php endif; ?>

Λεπτομέρειες

Όνομα	Αποτέλεσμα	Απαιτούμενο από	Σημειώσεις

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'πέρασε' : ($requirement[1] ? 'απέτυχε' : 'προειδοποίηση'); ?>">
	<?php echo $requirement[2] ? 'Πέρασε' : ($requirement[1] ? 'Απέτυχε' : 'Προειδοποίηση'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	πέρασε
 	απέτυχε
 	προειδοποίηση

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="es"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Verificación de requerimientos de Yii</title>

Verificación de requerimientos de Yii

Descripción

Este script verifica que la configuración de su servidor cumpla con los requerimientos
para poder ejecutar aplicaciones Web Yii.
El mismo verifica que el servidor este corriendo una versión adecuada de PHP,
que las extensiones PHP necesarias hayan sido cargadas y que las configuraciones del archivo php.ini sean correctas.

Conclusión

<?php if($result>0): ?>
Felicitaciones! Su servidor satisface todos los requerimientos de Yii.
<?php elseif($result<0): ?>
La configuración de su servidor satisface los requerimientos mínimos de Yii. Por favor preste atención a las advertencias listadas en el cuadro más abajo si su aplicación utiliza alguna de esas características.
<?php else: ?>
Desafortunadamente la configuración de su servidor no satisface los requerimientos de Yii.
<?php endif; ?>

Detalles

Nombre	Resultado	Requerido por	Memo

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Paso' : 'Fallo'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	paso
 	fallo
 	advertencia

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Vérification de la configuration nécessaire pour Yii</title>

Vérification de la configuration nécessaire pour Yii

Description

Ce script vérifie si la configuration de votre serveur satisfait toutes les dépendances nécessaires
pour exécuter les applications Yii.
Il vérifie si le serveur exécute la version correcte de PHP,
si toutes les extensions PHP nécessaires ont été chargées, et si les paramètres du fichier php.ini sont corrects

Conclusion

<?php if($result>0): ?>
Félicitations ! Votre configuration vérifie toutes les exigences de Yii.
<?php elseif($result<0): ?>
Votre configuration satisfait les exigences minimales de Yii. Notez les avertissements listés ci-dessous si votre application utilise les fonctionnalités correspondantes.
<?php else: ?>
Malheureusement, votre configuration ne satisfait pas les exigences de Yii.
<?php endif; ?>

Details

Nom	Resultat	Requis Par	Info

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Ok' : 'Echec'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	Ok
 	Echec
 	Avertissement

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>בדיקת דרישות מינימום להרצת Yii</title>

בדיקת דרישות מינימום להרצת Yii

תיאור

הסקריפט הבא בודק אם סביבת השרת שלך תוכל לעמוד בדרישות המינימום כדי להריץ את
 Yii לפיתוח מערכות ווב מתקדמות.
הסקריפט בודק אם השרת מריץ גרסאת PHP עדכנית,
אם הרחבות מסויימת קיימות ב PHP ונטענו בהצלחה, ואם הגדרות ה php.ini מוגדרות כמו שצריך.

סיכום

<?php if($result>0): ?>
ברכותיינו! סביבת השרת שלך תומכת בכל הגדרישות של Yii.
<?php elseif($result<0): ?>
הגדרות סביבת השרת שלך מתאימות לדרישות המינימום של Yii.
 אנא שים לב לאזהרות והערות הכתובות מטה במידה והאפליקציה שתכתוב תשתמש באחת מהאפשרויות הללו.
<?php else: ?>
לצערנו סביבת השרת שלך אינה תומכת בדרישות המינימום של Yii.
<?php endif; ?>

פרטים

כותרת	תוצאה	נדרש על ידי	תזכורת

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'עבר' : 'נכשל'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	עבר
 	נכשל
 	אזהרה

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii Requirement Checker</title>

Yii Requirement Checker

Description

This script checks if your server configuration meets the requirements
for running Yii Web applications.
It checks if the server is running the right version of PHP,
if appropriate PHP extensions have been loaded, and if php.ini file settings are correct.

Conclusion

<?php if($result>0): ?>
Congratulations! Your server configuration satisfies all requirements by Yii.
<?php elseif($result<0): ?>
Your server configuration satisfies the minimum requirements by Yii. Please pay attention to the warnings listed below if your application will use the corresponding features.
<?php else: ?>
Unfortunately your server configuration does not satisfy the requirements by Yii.
<?php endif; ?>

Details

Name	Result	Required By	Memo

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Passed' : ($requirement[1] ? 'Failed' : 'Warning'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	passed
 	failed
 	warning

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Verifica soddisfazione requisiti di Yii</title>

Verifica soddisfazione requisiti di Yii

Descrizione

Questo script verifica se la configurazione del tuo server soddisfa i requisiti
di esecuzione delle web application sviluppate con Yii.
Verifica se nel server è in esecuzione la corretta versione di PHP, se le
estensioni PHP necessarie sono state caricate e se le impostazioni di php.ini sono corrette.

Conclusioni

<?php if($result>0): ?>
Congratulazioni! La configurazione del tuo server soddisfa tutti i requisiti di Yii.
<?php elseif($result<0): ?>
La configurazione del tuo server soddisfa i requisiti minimi di Yii. Si prega di prestare attenzione agli avvisi qui sotto qualora l'applicazione utilizzi le corrispondenti funzionalità.
<?php else: ?>
Sfortunatamente La configurazione del tuo server non soddisfa i requisiti di Yii.
<?php endif; ?>

Dettagli

Nome	Resultato	Richiesto da	Memo

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Superato' : 'Fallito'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	superato
 	fallito
 	avviso

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii Requirement Checker</title>

Yii要求チェッカ

説明

このスクリプトは、あなたのサーバ構成が、Yiiアプリケーション
を実行するための要求を満たしているかどうかを確認します。
このスクリプトはサーバにおいて正しいバージョンのPHPを実行しているか、適切なPHP拡張をロードしているか、php.iniファイル設定が正しいか
を確認します。

結果

<?php if($result>0): ?>
おめでとうございます。あなたのサーバ構成はYiiの全ての要求を満しています。
<?php elseif($result<0): ?>
あなたのサーバ構成はYiiの最低限の要求を満しています。もしあなたのアプリケーションが対応する機能を
使用している場合には以下の警告に注意してください。
<?php else: ?>
申し訳ありませんが、あなたのサーバ構成はYiiの要求を満していません。
<?php endif; ?>

詳細

名称	結果	必要元	備考

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? '合格' : ($requirement[1] ? '不合格' : '注意'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	合格
 	不合格
 	注意

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii - Sjekk systemkrav</title>

Yii - Sjekk systemkrav

Beskrivelse

Dette skriptet sjekker om serverkonfigurasjonen oppfyller kravene for å kjøre
Yii-applikasjoner.
Det sjekker om serveren kjører riktig versjon av PHP, om nødvendige extensions
er lastet og om PHP-innstillingene i php.ini er korrekt.

Konklusjon

<?php if($result>0): ?>
Gratulerer! Konfigurasjonen på serveren tilfredstiller alle krav for å kjøre Yii.
<?php elseif($result<0): ?>
Konfigurasjonen på serveren tilfredstiller minimumskravene til Yii. Vær oppmerksom
på advarslene listet nedenfor dersom applikasjonen din trenger noe av denne
funksjonaliteten.
<?php else: ?>
Desverre tilfredstiller ikke konfigurasjonen av serveren minimumskravene til Yii.
<?php endif; ?>

Detaljer

Navn	Resultat	Kreves av	Notat

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'ok' : ($requirement[1] ? 'feil' : 'advarsel'); ?>">
	<?php echo $requirement[2] ? 'Ok' : 'Feil'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	ok
 	feil
 	advarsel

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Sprawdzanie wymagań przez Yii</title>

Sprawdzanie wymagań stawianych przez Yii

Opis

Skrypt ten sprawdza czy konfiguracja Twojego serwera spełnia wymagania
pozwalające uruchomić aplikację napisaną przy użyciu Yii.
Sprawdza on, czy serwer używa poprawnej wersji PHP,
czy zostały załadowane odpowiednie rozszerzenia PHP oraz czy ustawienia w pliku php.ini są prawidłowe.

Rozstrzygnięcie

<?php if($result>0): ?>
Gratulacje! Konfiguracja Twojego serwera spełnia wszystkie wymagania stawiane przez Yii.
<?php elseif($result<0): ?>
Konfiguracja Twojego serwera spełnia minimalne wymagania stawiane przez Yii.
Zwróć uwagę na ostrzeżenia wyświetlone poniżej jeśli Twoja aplikacja będzie używała odpowiadających im funkcjonalności.
<?php else: ?>
Niestety konfiguracja Twojego serwera nie spełnia wymagań stawianych przez Yii.
<?php endif; ?>

Szczegóły

Nazwa	Rezultat	Wymagana przez	Notka

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Passed' : 'Failed'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	powiódł się
 	nie powiódł się
 	ostrzeżenie

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Verificador de requisitos do Yii</title>

Verificador de requisitos do Yii

Descrição

Este script verifica se as configurações do servidor satisfazem os requisitos
para executar aplicações Web que utilizem o  Yii .
É verificado se o servidor está executando a versão correta do PHP,
se as extensões apropriadas do PHP foram carregadas,
e se as definições do arquivo php.ini estão corretas.

Resultados

<?php if($result>0): ?>
Parabéns! As configurações do seu servidor satisfazem todos os requisitos do Yii.
<?php elseif($result<0): ?>
As configurações do seu servidor satisfazem os requisitos mínimos do Yii. Por favor, preste atenção às advertências listados abaixo caso sua aplicação irá utilizar os recursos correspondentes.
<?php else: ?>
Infelizmente o as configurações do seu servidor não satisfazem os requisitos do Yii.
<?php endif; ?>

Detalhes

Nome	Resultado	Exigido por	Detalhe

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Passed' : 'Failed'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	OK
 	Falhou
 	Advertência

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Verificador de requisitos do Yii</title>

Verificador de requisitos do Yii

Descrição

Este script verifica se as configurações do servidor satisfazem os requisitos
para executar aplicações Web que utilizem o  Yii .
É verificado se o servidor está executando a versão correta do PHP,
se as extensões apropriadas do PHP foram carregadas,
e se as definições do arquivo php.ini estão corretas.

Resultados

<?php if($result>0): ?>
Parabéns! As configurações do seu servidor satisfazem todos os requisitos do Yii.
<?php elseif($result<0): ?>
As configurações do seu servidor satisfazem os requisitos mínimos do Yii. Por favor, preste atenção às advertências listados abaixo caso sua aplicação irá utilizar os recursos correspondentes.
<?php else: ?>
Infelizmente o as configurações do seu servidor não satisfazem os requisitos do Yii.
<?php endif; ?>

Detalhes

Nome	Resultado	Exigido por	Detalhe

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'OK' : ($requirement[1] ? 'Falhou' : 'Advertência'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	OK
 	Falhou
 	Advertência

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Verificare cerinte Yii</title>

Verificarea cerintelor Yii

Descriere

Acest script verifica daca configuratia serverului dvs indeplineste cerintele
pentru rularea aplicatiilor Web Yii.
Se fac urmatoarele verificari: daca serverul ruleaza versiunea corecta de PHP,
daca extensiile PHP corespunzatoare au fost incarcate si daca
setarile din fisierul php.ini sunt corecte.

Concluzie

<?php if($result>0): ?>
Felicitari! Configuratia serverului dvs indeplineste toate cerintele Yii.
<?php elseif($result<0): ?>
Configuratia serverului dvs indeplineste cerintele minime pentru Yii.
Va rugam sa cititi avertismentele afisate mai jos, in cazul in care aplicatia pe care o veti crea
va folosi respectivele feature-uri.
<?php else: ?>
Din pacate, configuratia serverului dvs nu indeplineste cerintele Yii.
<?php endif; ?>

Detalii

Nume	Rezultat	Cerut de	Precizari

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Passed' : 'Failed'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	passed
 	failed
 	warning

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Проверка на соответствие требованиям Yii</title>

Проверка на соответствие требованиям Yii

Описание

Данный скрипт проверяет соответствие конфигурации Вашего веб-сервера требованиям,
предъявляемым веб-приложениями Yii.
В частности, проверяются версия РНР и загруженные расширения РНР, а также
корректность настроек файла php.ini.

Заключение

<?php if($result>0): ?>
Поздравляем! Конфигурация Вашего веб-сервера полностью удовлетворяет требованиям Yii.
<?php elseif($result<0): ?>
Конфигурация Вашего веб-сервера удовлетворяет минимально необходимым требованиям Yii. Обратите внимание на предупреждения в таблице ниже, если предполагается использование соответствующего функционала.
<?php else: ?>
К сожалению, конфигурация Вашего веб-сервера не удовлетворяет требованиям Yii.
<?php endif; ?>

Результаты проверки

Название	Итог	Требуется для	Пояснение

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
        <?php echo $requirement[2] ? 'Да' : ($requirement[1] ? 'Нет' : 'Предупреждение'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	Да
 	Нет
 	Предупреждение

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii - Test prostredia</title>

Yii - Test prostredia

Popis

Tento skript preverí, či je konfigurácia vášho servera postačujúca
pre korektné fungovanie aplikácii vytvorených pre Yii framework.
Test preveruje správnu verziu PHP, prítomnosť potrebných PHP rozšírení a správne nastavenie
konfigurácie v php.ini.

Záver

<?php if($result>0): ?>
Gratulujem! Váš server spĺňa všetky požiadavky potrebné pre korektné fungovanie Yii.
<?php elseif($result<0): ?>
Váš server spĺňa minimálne požiadavky potrebné pre fungovanie Yii.
Venujte prosím pozornosť upozorneniam uvedeným nižšie v prípade, že vaša aplikácia bude využívať potrebné funkcie.
<?php else: ?>
Bohužiaľ, váš server nespĺňa požiadavky potrebné pre fungovanie Yii.
<?php endif; ?>

Detaily

Názov	Výsledok	Požadované od	Pozn.

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'OK' : ($requirement[1] ? 'Chyba' : 'Upozornenie'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	OK
 	chyba
 	upozornenie

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii - Kontroll systemkrav</title>

Yii - Kontroll systemkrav

Beskrivning

Det här skriptet kontrollerar om serverkonfigurationen uppfyller kraven för att köra Yii webbapplikationer.
Det kollar att servern kör rätt version av PHP,
att erforderliga  PHP-tillägg är laddade, och att inställningar i filen php.ini är korrekta.

Slutsats

<?php if($result>0): ?>
Grattis! Serverkonfigurationen uppfyller alla krav som Yii ställer.
<?php elseif($result<0): ?>
Serverkonfigurationen uppfyller minimikraven som Yii ställer. Lägg märke till nedanstående varningar om applikationer behöver använda nämnda finesser.
<?php else: ?>
Tyvärr uppfyller inte serverkonfigurationen minimikraven Yii ställer.
<?php endif; ?>

Detaljer

Namn	Resultat	Krävs för	Memo

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? 'Stöds' : ($requirement[1] ? 'Stöd saknas' : 'Warning'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	passed
 	failed
 	warning

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii配置需求检查</title>

Yii配置需求检查

检查内容

本网页用于确认您的服务器配置是否能满足运行Yii Web应用的要求。它将检查服务器所运行的PHP版本，查看是否安装了合适的PHP扩展模块，以及确认php.ini文件是否正确设置。

检查结果

<?php if($result>0): ?>
恭喜！您的服务器配置完全符合Yii的要求。
<?php elseif($result<0): ?>
您的服务器配置符合Yii的最低要求。如果您需要使用特定的功能，请关注如下警告。
<?php else: ?>
您的服务器配置未能满足Yii的要求。
<?php endif; ?>

具体结果

项目名称	结果	使用者	备注

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? '通过' : ($requirement[1] ? '未通过' : 'Warning'); ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	通过
 	未通过
 	警告

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii配置需求检查</title>

Yii配置需求检查

检查内容

本网页用于确认您的服务器配置是否能满足运行Yii Web应用的要求。它将检查服务器所运行的PHP版本，查看是否安装了合适的PHP扩展模块，以及确认php.ini文件是否正确设置。

检查结果

<?php if($result>0): ?>
恭喜！您的服务器配置完全符合Yii的要求。
<?php elseif($result<0): ?>
您的服务器配置符合Yii的最低要求。如果您需要使用特定的功能，请关注如下警告。
<?php else: ?>
您的服务器配置未能满足Yii的要求。
<?php endif; ?>

具体结果

项目名称	结果	使用者	备注

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? '通过' : '未通过'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	通过
 	未通过
 	警告

<?php echo $serverInfo; ?>


code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>Yii系統需求檢查</title>

Yii系統需求檢查

檢查內容說明

本網頁用於確認您的伺服器組態設定是否能滿足執行Yii Web應用程式的要求. 它將檢查伺服器是否使用正確的PHP版本, 是否安裝了合適的PHP extension, 以及確認php.ini檔案是否正確設定.

檢查結果

<?php if($result>0): ?>
恭喜! 您的伺服器組態設定完全符合Yii的要求.
<?php elseif($result<0): ?>
您的伺服器組態設定符合Yii的最低要求. 請注意下列警告(如果您的應用程式會需要使用到相關功能).
<?php else: ?>
您的伺服器組態設定未能滿足Yii的要求.
<?php endif; ?>

詳細結果

項目名稱	結果	使用者	備註

<?php foreach($requirements as $requirement): ?>

	<?php echo $requirement[0]; ?>

	<td class="<?php echo $requirement[2] ? 'passed' : ($requirement[1] ? 'failed' : 'warning'); ?>">
	<?php echo $requirement[2] ? '通過' : '未通過'; ?>

	<?php echo $requirement[3]; ?>

	<?php echo $requirement[4]; ?>

<?php endforeach; ?>

 	通過
 	未通過
 	警告

<?php echo $serverInfo; ?>


code:
<?php

class TestApplication extends CWebApplication
{
	public function __construct($config=null)
	{
		Yii::setApplication(null);
		clearstatcache();
		parent::__construct($config);
	}

	public function reset()
	{
		$this->removeDirectory($this->getRuntimePath());
		$this->removeDirectory($this->getAssetPath());
	}

	protected function removeDirectory($path)
	{
		if(is_dir($path) && ($folder=@opendir($path))!==false)
		{
			while($entry=@readdir($folder))
			{
				if($entry[0]==='.')
					continue;
				$p=$path.DIRECTORY_SEPARATOR.$entry;
				if(is_dir($p))
					$this->removeDirectory($p);
				@unlink($p);
			}
			@closedir($folder);
		}
	}

	public function getAssetPath()
	{
		return dirname(__FILE__).DIRECTORY_SEPARATOR.'assets';
	}

	public function getRuntimePath()
	{
		return dirname(__FILE__).DIRECTORY_SEPARATOR.'runtime';
	}

	public function getBasePath()
	{
		return dirname(__FILE__);
	}

	public function setBasePath($value)
	{
	}

	public function loadGlobalState()
	{
		parent::loadGlobalState();
	}

	public function saveGlobalState()
	{
		parent::saveGlobalState();
	}
}


code:
<?php

define('YII_ENABLE_EXCEPTION_HANDLER',false);
define('YII_ENABLE_ERROR_HANDLER',false);
define('YII_DEBUG',true);
$_SERVER['SCRIPT_NAME']='/'.basename(__FILE__);
$_SERVER['SCRIPT_FILENAME']=__FILE__;

require_once(dirname(__FILE__).'/../framework/yii.php');
require_once(dirname(__FILE__).'/TestApplication.php');
require_once('PHPUnit/Framework/TestCase.php');

class CTestCase extends PHPUnit_Framework_TestCase
{
}

class CActiveRecordTestCase extends CTestCase
{
}

new TestApplication();


code:
<?php

class CApplicationComponentTest extends CTestCase {
	public function testInitialization() {
		$c = $this->getMockForAbstractClass('CApplicationComponent',array('init','getIsInitialized'),'',NULL);
		$c->expects($this->any())
			->method('getIsInitialized')
			->will($this->returnValue(FALSE));
		$this->assertFalse($c->getIsInitialized());
		$c->init();
		$this->assertTrue($c->getIsInitialized());
	}
}


code:
<?php
require_once dirname(__FILE__) . '/NewComponent.php';
require_once dirname(__FILE__) . '/NewBehavior.php';

require_once dirname(__FILE__) . '/NewBeforeValidateBehavior.php';
require_once dirname(__FILE__) . '/NewFormModel.php';

class CBehaviorTest extends CTestCase {

	public function testAttachBehavior() {
		$component=new NewComponent;
		$component->attachBehavior('a',new NewBehavior);
		$this->assertFalse($component->behaviorCalled);
		$this->assertFalse(method_exists($component,'test'));
		$this->assertEquals(2,$component->test());
		$this->assertTrue($component->behaviorCalled);
		$this->setExpectedException('CException');
		$component->test2();
	}

    public function testDisableBehaviors(){
        $component=new NewComponent;
        $component->attachBehavior('a',new NewBehavior);
        $component->disableBehaviors();
        $this->setExpectedException('CException');
        // test should not be called since behavior is disabled
        echo $component->test();
    }

    /**
     * Since disableBehaviors() was called, validate() should not call beforeValidate() from behavior.
     * @return void
     */
    public function testDisableBehaviorsAndModels(){
        $model = new NewFormModel();
        $model->disableBehaviors();
        $model->validate();
    }

    /**
     * enableBehaviors() should work after disableBehaviors().
     * @return void
     */
    public function testDisableAndEnableBehaviorsAndModels(){
        $this->setExpectedException('NewBeforeValidateBehaviorException');
        $model = new NewFormModel();
        $model->disableBehaviors();
        $model->enableBehaviors();
        $model->validate();
    }
}


code:
<?php
require_once dirname(__FILE__) . '/NewComponent.php';
require_once dirname(__FILE__) . '/NewBehavior.php';

function globalEventHandler($event)
{
	$event->sender->eventHandled=true;
}

function globalEventHandler2($event)
{
	$event->sender->eventHandled=true;
	$event->handled=true;
}

class CComponentTest extends CTestCase
{
	protected $component;

	public function setUp()
	{
		$this->component = new NewComponent();
	}

	public function tearDown()
	{
		$this->component = null;
	}

	public function testHasProperty()
	{
		$this->assertTrue($this->component->hasProperty('Text'), "Component hasn't property Text");
		$this->assertTrue($this->component->hasProperty('text'), "Component hasn't property text");
		$this->assertFalse($this->component->hasProperty('Caption'), "Component as property Caption");
	}

	public function testCanGetProperty()
	{
		$this->assertTrue($this->component->canGetProperty('Text'));
		$this->assertTrue($this->component->canGetProperty('text'));
		$this->assertFalse($this->component->canGetProperty('Caption'));
	}

	public function testCanSetProperty()
	{
		$this->assertTrue($this->component->canSetProperty('Text'));
		$this->assertTrue($this->component->canSetProperty('text'));
		$this->assertFalse($this->component->canSetProperty('Caption'));
	}

	public function testGetProperty()
	{
		$this->assertTrue('default'===$this->component->Text);
		$this->setExpectedException('CException');
		$value2=$this->component->Caption;
	}

	public function testSetProperty()
	{
		$value='new value';
		$this->component->Text=$value;
		$text=$this->component->Text;
		$this->assertTrue($value===$this->component->Text);
		$this->setExpectedException('CException');
		$this->component->NewMember=$value;
	}

	public function testIsset()
	{
		$this->assertTrue(isset($this->component->Text));
		$this->assertTrue(!empty($this->component->Text));

		unset($this->component->Text);
		$this->assertFalse(isset($this->component->Text));
		$this->assertFalse(!empty($this->component->Text));

		$this->component->Text='';
		$this->assertTrue(isset($this->component->Text));
		$this->assertTrue(empty($this->component->Text));
	}

	public function testHasEvent()
	{
		$this->assertTrue($this->component->hasEvent('OnMyEvent'));
		$this->assertTrue($this->component->hasEvent('onmyevent'));
		$this->assertFalse($this->component->hasEvent('onYourEvent'));
	}

	public function testHasEventHandler()
	{
		$this->assertFalse($this->component->hasEventHandler('OnMyEvent'));
		$this->component->attachEventHandler('OnMyEvent','foo');
		$this->assertTrue($this->component->hasEventHandler('OnMyEvent'));
	}

	public function testGetEventHandlers()
	{
		$list=$this->component->getEventHandlers('OnMyEvent');
		$this->assertEquals($list->getCount(),0);
		$this->component->attachEventHandler('OnMyEvent','foo');
		$this->assertEquals($list->getCount(),1);
		$this->setExpectedException('CException');
		$list=$this->component->getEventHandlers('YourEvent');
	}

	public function testAttachEventHandler()
	{
		$this->component->attachEventHandler('OnMyEvent','foo');
		$this->assertTrue($this->component->getEventHandlers('OnMyEvent')->getCount()===1);
		$this->setExpectedException('CException');
		$this->component->attachEventHandler('YourEvent','foo');
	}

	public function testDettachEventHandler()
	{
		$this->component->attachEventHandler('OnMyEvent','foo');
		$this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler'));
		$this->assertEquals($this->component->getEventHandlers('OnMyEvent')->getCount(),2);

		$this->assertTrue($this->component->detachEventHandler('OnMyEvent','foo'));
		$this->assertEquals($this->component->getEventHandlers('OnMyEvent')->getCount(),1);

		$this->assertFalse($this->component->detachEventHandler('OnMyEvent','foo'));
		$this->assertEquals($this->component->getEventHandlers('OnMyEvent')->getCount(),1);

		$this->assertTrue($this->component->detachEventHandler('OnMyEvent',array($this->component,'myEventHandler')));
		$this->assertEquals($this->component->getEventHandlers('OnMyEvent')->getCount(),0);

		$this->assertFalse($this->component->detachEventHandler('OnMyEvent','foo'));
	}

	public function testRaiseEvent()
	{
		$this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler'));
		$this->assertFalse($this->component->eventHandled);
		$this->component->raiseEvent('OnMyEvent',new CEvent($this));
		$this->assertTrue($this->component->eventHandled);

		//$this->setExpectedException('CException');
		//$this->component->raiseEvent('OnUnknown',new CEvent($this));
	}

	public function testEventAccessor()
	{
		$component=new NewComponent;
		$this->assertEquals($component->onMyEvent->getCount(),0);
		$component->onMyEvent='globalEventHandler';
		$component->onMyEvent=array($this->component,'myEventHandler');
		$this->assertEquals($component->onMyEvent->getCount(),2);
		$this->assertFalse($component->eventHandled);
		$this->assertFalse($this->component->eventHandled);
		$component->onMyEvent();
		$this->assertTrue($component->eventHandled);
		$this->assertTrue($this->component->eventHandled);
	}

	public function testStopEvent()
	{
		$component=new NewComponent;
		$component->onMyEvent='globalEventHandler2';
		$component->onMyEvent=array($this->component,'myEventHandler');
		$component->onMyEvent();
		$this->assertTrue($component->eventHandled);
		$this->assertFalse($this->component->eventHandled);
	}

	public function testInvalidHandler1()
	{
		$this->component->onMyEvent=array(1,2,3);
		$this->setExpectedException('CException');
		$this->component->onMyEvent();
	}

	public function testInvalidHandler2()
	{
		$this->component->onMyEvent=array($this->component,'nullHandler');
		$this->setExpectedException('CException');
		$this->component->onMyEvent();
	}
	public function testDetachBehavior() {
		$component=new NewComponent;
		$behavior = new NewBehavior;
		$component->attachBehavior('a',$behavior);
		$this->assertSame($behavior,$component->detachBehavior('a'));
	}
	public function testDetachingBehaviors() {
		$component=new NewComponent;
		$behavior = new NewBehavior;
		$component->attachBehavior('a',$behavior);
		$component->detachBehaviors();
		$this->setExpectedException('CException');
		$component->test();
	}
	public function testEnablingBehavior() {
		$component=new NewComponent;
		$behavior = new NewBehavior;
		$component->attachBehavior('a',$behavior);
		$component->disableBehavior('a');
		$this->assertFalse($behavior->getEnabled());
		$component->enableBehavior('a');
		$this->assertTrue($behavior->getEnabled());
	}
	public function testEnablingBehaviors() {
		$component=new NewComponent;
		$behavior = new NewBehavior;
		$component->attachBehavior('a',$behavior);
		$component->disableBehaviors();
		$this->assertFalse($behavior->getEnabled());
		$component->enableBehaviors();
		$this->assertTrue($behavior->getEnabled());
	}
	public function testAsa() {
		$component=new NewComponent;
		$behavior = new NewBehavior;
		$component->attachBehavior('a',$behavior);
		$this->assertSame($behavior,$component->asa('a'));
	}
	public function testEvaluateExpression() {
		$component = new NewComponent;
		$this->assertEquals('Hello world',$component->evaluateExpression('"Hello $who"',array('who' => 'world')));
		$this->assertEquals('Hello world',$component->evaluateExpression(array($component,'exprEvaluator'),array('who' => 'world')));
	}
}


code:
<?php

class MyRoute extends CLogRoute
{
	public $logCollected=false;
	public $property=1;

	protected function processLogs($logs)
	{
		$this->logCollected=true;
		$this->property+=count($logs);
	}
}

class CLogRouterTest extends CTestCase
{
	public function testRoutes()
	{
		$app=new TestApplication;
		$router=new CLogRouter;

		$this->assertEquals(count($router->routes),0);
		$router->routes=array(
			array(
				'class'=>'MyRoute',
				'property'=>2,
			),
			array(
				'class'=>'MyRoute',
				'property'=>3,
			),
		);
		$router->init($app);
		$this->assertEquals(count($router->routes),2);

		$route1=$router->routes[0];
		$this->assertFalse($route1->logCollected);
		$this->assertEquals($route1->property,2);
		$route2=$router->routes[1];
		$this->assertFalse($route2->logCollected);
		$this->assertEquals($route2->property,3);

		$logger=Yii::getLogger();
		$logger->log('message1','level1','category1');
		$logger->log('message2','level2','category2');
		$logger->log('message3','level3','category3');

		$app->onEndRequest(new CEvent($this));
		$this->assertTrue($route1->logCollected);
		$this->assertTrue($route1->property>2);
		$this->assertTrue($route2->logCollected);
		$this->assertTrue($route2->property>3);
	}
}


code:
<?php

class CLoggerTest extends CTestCase
{
	public function testLog()
	{
		$logger=new CLogger;
		$logger->log('something','debug','application.test');
	}

	public function testGetLogs()
	{
		$logger=new CLogger();
		$logs=array(
			array('message1','debug','application.pages'),
			array('message2','info','application.config'),
			array('message3','info','application.pages'),
		);
		foreach($logs as $log)
			$logger->log($log[0],$log[1],$log[2]);

		$l=$logger->getLogs('debug');
		$this->assertTrue($logs[0]===array_slice($l[0],0,3));

		$l=$logger->getLogs('debug , Info');
		$this->assertTrue($logs[0]===array_slice($l[0],0,3));
		$this->assertTrue($logs[1]===array_slice($l[1],0,3));
		$this->assertTrue($logs[2]===array_slice($l[2],0,3));

		$l=$logger->getLogs('','application.config');
		$this->assertTrue($logs[1]===array_slice($l[0],0,3));

		$l=$logger->getLogs('','application.*');
		$this->assertTrue($logs[0]===array_slice($l[0],0,3));
		$this->assertTrue($logs[1]===array_slice($l[1],0,3));
		$this->assertTrue($logs[2]===array_slice($l[2],0,3));

		$l=$logger->getLogs('','application.config , Application.pages');
		$this->assertTrue($logs[0]===array_slice($l[0],0,3));
		$this->assertTrue($logs[1]===array_slice($l[1],0,3));
		$this->assertTrue($logs[2]===array_slice($l[2],0,3));

		$l=$logger->getLogs('info','application.config');
		$this->assertTrue($logs[1]===array_slice($l[0],0,3));

		$l=$logger->getLogs('info,debug','application.config');
		$this->assertTrue($logs[1]===array_slice($l[0],0,3));
	}
}


code:
<?php
require_once dirname(__FILE__).'/NewModel.php';

class CModelTest extends CTestCase
{
	public function testValidate()
	{
		$model=new NewModel;
		$this->assertFalse($model->validate());
		$model->attr1=4;
		$this->assertTrue($model->validate());
		$model->attr1=6;
		$this->assertFalse($model->validate());
		$model->attr2=6;
		$this->assertFalse($model->validate());
		$model->attr1=4;
		$this->assertFalse($model->validate());
		$model->attr2=4;
		$this->assertTrue($model->validate());
	}

	function testBeforeValidate(){
		$model=new NewModel;
		$model->attr1=4;
		$this->assertTrue($model->validate());

		$model->onBeforeValidate = array($this, 'beforeValidate');
		$this->assertFalse($model->validate());
	}

	function beforeValidate($event){
		$event->isValid = false;
	}

	function testIsAttributeRequired(){
		$model=new NewModel;
		$this->assertTrue($model->isAttributeRequired('attr1'));
		$this->assertFalse($model->isAttributeRequired('attr2'));
	}

	function testIsAttributeSafe(){
		$model=new NewModel;
		$this->assertTrue($model->isAttributeSafe('attr1'));
		$this->assertFalse($model->isAttributeSafe('attr3'));
		$this->assertFalse($model->isAttributeSafe('attr4'));
	}

	function testGetSafeAttributeNames(){
		$model=new NewModel;
		$safeAttributes = $model->getSafeAttributeNames();
		$this->assertContains('attr2', $safeAttributes);
		$this->assertContains('attr1', $safeAttributes);
	}

	public function testModifyValidators()
	{
		$model=new NewModel;
		$model->attr1=2;
		$model->attr2=2;
		$this->assertTrue($model->validate());
		$model->validatorList->insertAt(0,CValidator::createValidator('numerical',$model,'attr1,attr2',array('min'=>3)));
		$this->assertFalse($model->validate());
		$model->attr1=6;
		$model->attr2=6;
		$this->assertFalse($model->validate());
		$model->attr1=4;
		$model->attr2=4;
		$this->assertTrue($model->validate());
		$model=new NewModel;
		$model->attr1=3;
		$model->validatorList->add(CValidator::createValidator('required',$model,'attr2',array()));
		$this->assertFalse($model->validate());
		$model->attr2=3;
		$this->assertTrue($model->validate());
	}

	function testErrors(){
		$model=new NewModel;
		$model->attr1=3;
		$model->validatorList->add(CValidator::createValidator('required',$model,'attr2',array()));
		$model->validatorList->add(CValidator::createValidator('required',$model,'attr4',array()));
		$model->validate();

		$this->assertTrue($model->hasErrors());
		$this->assertTrue($model->hasErrors('attr2'));
		$this->assertFalse($model->hasErrors('attr1'));

		$model->clearErrors('attr2');
		$this->assertFalse($model->hasErrors('attr2'));

		$model->clearErrors();
		$this->assertFalse($model->hasErrors());
	}

	function testGetAttributes(){
		$model = new NewModel();
		$model->attr1 = 1;
		$model->attr2 = 2;

		$attributes = $model->getAttributes();
		$this->assertEquals(1, $attributes['attr1']);
		$this->assertEquals(2, $attributes['attr2']);

		$attributes = $model->getAttributes(array('attr1', 'non_existing'));
		$this->assertEquals(1, $attributes['attr1']);
		$this->assertEquals(null, $attributes['non_existing']);
	}

	function testUnsetAttributes(){
		$model = new NewModel();
		$model->attr1 = 1;
		$model->attr2 = 2;

		$model->unsetAttributes(array('attr1'));
		$this->assertEquals(null, $model->attr1);
		$this->assertEquals(2, $model->attr2);

		$model->unsetAttributes();
		$this->assertEquals(null, $model->attr1);
		$this->assertEquals(null, $model->attr2);
	}
}


code:
<?php
require_once dirname(__FILE__) . '/NewModule.php';
require_once dirname(__FILE__) . '/NewApplicationComponent.php';

class CModuleTest extends CTestCase {
	protected $parent;
	protected $mod;
	protected $d;

	public function setUp() {
		$this->parent = new NewModule('root',NULL);
		$this->mod = new NewModule('foo',$this->parent);
		$this->d = dirname(__FILE__);
	}
	public function tearDown() {
		unset($this->parent);
		unset($this->mod);
	}
	public function testGetId() {
		$this->assertEquals('foo',$this->mod->getId());
	}
	public function testSetId() {
		$this->mod->setId('bar');
		$this->assertEquals('bar',$this->mod->getId());
	}
	public function testSetBasePath() {
		$d = dirname($this->d.'/..');
		$this->mod->setBasePath($d);
		$this->assertEquals($d,$this->mod->getBasePath());
	}
	public function testGetBasePath() {
		$this->assertEquals($this->d,$this->mod->getBasePath());
	}
	public function testGetParams() {
		$expected = new CAttributeCollection;
		$expected->caseSensitive = TRUE;
		$this->assertEquals($expected,$this->mod->getParams());
	}
	public function testSetParams() {
		$expected = array('foo' => 'bar');
		$this->mod->setParams($expected);
		$this->assertEquals($expected,$this->mod->getParams()->toArray());
	}
	public function testGetModulePath() {
		$expected = $this->d.DIRECTORY_SEPARATOR.'modules';
		$this->assertEquals($expected,$this->mod->getModulePath());
	}
	public function testSetModulePath() {
		$this->mod->setModulePath($this->d);
		$this->assertEquals($this->d,$this->mod->getModulePath());
	}
	public function testGetParentModule() {
		$this->assertSame($this->parent,$this->mod->getParentModule());
	}
	/**
	 * @depends testGetId
	 */
	public function testGetModule() {
		$p = $this->parent;
		$p->setModulePath($this->d);
		$p->setModules(array('foo' => array('class' => 'NewModule')));
		$this->assertEquals('root/foo',$p->getModule('foo')->getId());
	}
	public function testGetModules() {
		$p = $this->parent;
		$p->setModulePath($this->d);
		$expected = array('foo' => array('class' => 'NewModule'),'bar');
		$p->setModules($expected);
		$expected['bar'] = array('class' => 'bar.BarModule');
		unset($expected[0]);
		$this->assertEquals($expected,$p->getModules());
	}
	public function testGetComponents() {
		$c = new NewApplicationComponent;
		$this->mod->setComponent('foo',$c);
		$this->assertSame(array('foo' => $c),$this->mod->getComponents());
	}
	public function testSetComponents() {
		$expected = array('foo' => new NewApplicationComponent);
		$this->mod->setComponents($expected);
		$this->assertSame($expected,$this->mod->getComponents());
	}
	public function testSetComponentsViaConfig() {
		$this->mod = new NewModule('foo',$this->parent,array(
			'components' => array(
				'bar' => array('class' => 'NewApplicationComponent')
			)
		));
		$this->assertEquals('hello world',$this->mod->bar->getText('hello world'));
	}
	public function testSetAliases() {
		$this->mod->setAliases(array('modules' => $this->d));
		$this->assertEquals($this->d,Yii::getPathOfAlias('modules'));
	}
}


code:
<?php

class TextAlign extends CEnumerable
{
	const Left='Left';
	const Right='Right';
}

class CPropertyValueTest extends CTestCase
{
	public function testEnsureBoolean()
	{
		$entries=array
		(
			array(true,true),
			array(false,false),
			array(null,false),
			array(0,false),
			array(1,true),
			array(-1,true),
			array(2.1,true),
			array('',false),
			array('abc',false),
			array('0',false),
			array('1',true),
			array('123',true),
			array('false',false),
			array('true',true),
			array('tRue',true),
			array(array(),false),
			array(array(0),true),
			array(array(1),true),
		);
		foreach($entries as $index=>$entry)
			$this->assertTrue(CPropertyValue::ensureBoolean($entry[0])===$entry[1],
				"Comparison $index: {$entry[0]}=={$entry[1]}");
	}

	public function testEnsureString()
	{
		$entries=array
		(
			array('',''),
			array('abc','abc'),
			array(null,''),
			array(0,'0'),
			array(1,'1'),
			array(-1.1,'-1.1'),
			array(true,'true'),
			array(false,'false'),
			array(array(),'Array'),
			array(array(0),'Array'),
		);
		foreach($entries as $index=>$entry)
			$this->assertTrue(CPropertyValue::ensureString($entry[0])===$entry[1],
				"Comparison $index: {$entry[0]}=={$entry[1]}");
	}

	public function testEnsureInteger()
	{
		$entries=array
		(
			array(123,123),
			array(1.23,1),
			array(null,0),
			array('',0),
			array('abc',0),
			array('123',123),
			array('1.23',1),
			array(' 1.23',1),
			array(' 1.23abc',1),
			array('abc1.23abc',0),
			array(true,1),
			array(false,0),
			array(array(),0),
			array(array(0),1),
		);
		foreach($entries as $index=>$entry)
			$this->assertTrue(CPropertyValue::ensureInteger($entry[0])===$entry[1],
				"Comparison $index: {$entry[0]}=={$entry[1]}");
	}

	public function testEnsureFloat()
	{
		$entries=array
		(
			array(123,123.0),
			array(1.23,1.23),
			array(null,0.0),
			array('',0.0),
			array('abc',0.0),
			array('123',123.0),
			array('1.23',1.23),
			array(' 1.23',1.23),
			array(' 1.23abc',1.23),
			array('abc1.23abc',0.0),
			array(true,1.0),
			array(false,0.0),
			array(array(),0.0),
			array(array(0),1.0),
		);
		foreach($entries as $index=>$entry)
			$this->assertTrue(CPropertyValue::ensureFloat($entry[0])===$entry[1],
				"Comparison $index: {$entry[0]}=={$entry[1]}");
	}

	public function testEnsureArray()
	{
		$entries=array
		(
			array(123,array(123)),
			array(null,array()),
			array('',array()),
			array('abc',array('abc')),
			array('(1,2)',array(1,2)),
			array('("key"=>"value",2=>3)',array("key"=>"value",2=>3)),
			array(true,array(true)),
			array(array(),array()),
			array(array(0),array(0)),
		);
		foreach($entries as $index=>$entry)
			$this->assertTrue(CPropertyValue::ensureArray($entry[0])===$entry[1],
				"Comparison $index: {$entry[0]}=={$entry[1]}");
	}

	public function testEnsureObject()
	{
		$obj=new stdClass;
		$this->assertTrue(CPropertyValue::ensureObject($obj)===$obj);
	}

	public function testEnsureEnum()
	{
		$this->assertTrue(CPropertyValue::ensureEnum('Left','TextAlign')==='Left');
		$this->setExpectedException('CException');
		$this->assertTrue(CPropertyValue::ensureEnum('left','TextAlign')==='Left');
	}
}


code:
<?php

class CSecurityManagerTest extends CTestCase
{
	public function setUp()
	{
		// clean up runtime directory
		$app=new TestApplication;
		$app->reset();
	}

	public function testValidationKey()
	{
		$sm=new CSecurityManager;
		$key='123456';
		$sm->validationKey=$key;
		$this->assertEquals($key,$sm->validationKey);

		$app=new TestApplication;
		$key=$app->securityManager->validationKey;
		$app->saveGlobalState();
		$app2=new TestApplication;
		$this->assertEquals($app2->securityManager->validationKey,$key);
	}

	public function testEncryptionKey()
	{
		$sm=new CSecurityManager;
		$key='123456';
		$sm->encryptionKey=$key;
		$this->assertEquals($key,$sm->encryptionKey);

		$app=new TestApplication;
		$key=$app->securityManager->encryptionKey;
		$app->saveGlobalState();
		$app2=new TestApplication;
		$this->assertEquals($app2->securityManager->encryptionKey,$key);
	}

	public function testValidation()
	{
		$sm=new CSecurityManager;
		$mode='SHA1';
		$sm->validation=$mode;
		$this->assertEquals($mode,$sm->validation);
	}

	public function testValidateData()
	{
		$sm=new CSecurityManager;
		$sm->validationKey='123456';
		$sm->validation='SHA1';
		$data='this is raw data';
		$hashedData=$sm->hashData($data);
		$this->assertEquals($data,$sm->validateData($hashedData));
		$hashedData[3]='c'; // tamper the data
		$this->assertTrue($sm->validateData($hashedData)===false);

		$sm->validation='MD5';
		$data='this is raw data';
		$hashedData=$sm->hashData($data);
		$this->assertEquals($data,$sm->validateData($hashedData));
		$hashedData[3]='c'; // tamper the data
		$this->assertTrue($sm->validateData($hashedData)===false);
	}

	public function testEncryptData()
	{
		if(!extension_loaded('mcrypt'))
			$this->markTestSkipped('mcrypt extension is required to test encrypt feature.');
		$sm=new CSecurityManager;
		$sm->encryptionKey='123456';
		$data='this is raw data';
		$encryptedData=$sm->encrypt($data);
		$this->assertTrue($data!==$encryptedData);
		$data2=$sm->decrypt($encryptedData);
		$this->assertEquals($data,$data2);
	}
}


code:
<?php

class CStatePersisterTest extends CTestCase
{
	public function setUp()
	{
		// clean up runtime directory
		$app=new TestApplication;
		$app->reset();
	}

	public function testLoadSave()
	{
		$app=new TestApplication;
		$sp=$app->statePersister;
		$data=array('123','456','a'=>443);
		$sp->save($data);
		$this->assertEquals($sp->load(),$data);
		// TODO: test with cache on
	}

	public function testStateFile()
	{
		$sp=new CStatePersister;
		$file=dirname(__FILE__).DIRECTORY_SEPARATOR.'state.bin';
		$sp->stateFile=$file;
		$this->assertEquals($sp->stateFile,$file);

		$sp->stateFile=dirname(__FILE__).'/unknown/state.bin';
		$this->setExpectedException('CException');
		$sp->init();
	}
}


code:
<?php
class NewApplicationComponent extends CApplicationComponent {
	private $_text=NULL;
	public function getText($text=NULL) {
		if(NULL===$text) {
			return $this->_text;
		}
		return $text;
	}
	public function setText($val) {
		$this->_text = $val;
	}
}


code:
<?php
class NewBeforeValidateBehaviorException extends CException {}

class NewBeforeValidateBehavior extends CModelBehavior {
    public function beforeValidate($event) {
        throw new NewBeforeValidateBehaviorException();
    }
}


code:
<?php
class NewBehavior extends CBehavior
{
	public function test()
	{
		$this->owner->behaviorCalled=true;
		return 2;
	}
}


code:
<?php
class NewComponent extends CComponent
{
	private $_object = null;
	private $_text = 'default';
	public $eventHandled = false;
	public $behaviorCalled = false;

	public function getText()
	{
		return $this->_text;
	}

	public function setText($value)
	{
		$this->_text=$value;
	}

	public function getObject()
	{
		if(!$this->_object)
		{
			$this->_object=new NewComponent;
			$this->_object->_text='object text';
		}
		return $this->_object;
	}

	public function onMyEvent()
	{
		$this->raiseEvent('OnMyEvent',new CEvent($this));
	}

	public function myEventHandler($event)
	{
		$this->eventHandled=true;
	}
	public function exprEvaluator($p1,$comp) {
		return "Hello $p1";
	}
}


code:
<?php
class NewFormModel extends CFormModel {
    public function behaviors() {
        return array(
            'newBeforeValidateBehavior' => array(
                'class' => 'NewBeforeValidateBehavior',
            ),
        );
    }
}


code:
<?php

class NewModel extends CModel
{
	public $attr1;
	public $attr2;
	public $attr3;
	public $attr4;

	public function rules()
	{
		return array(
			array('attr2,attr1','numerical','max'=>5),
			array('attr1','required'),
			array('attr3', 'unsafe'),
		);
	}

	public function attributeNames()
	{
		return array('attr1','attr2');
	}
}


code:
<?php

class NewModule extends CModule {
}


code:
<?php

if(!defined('DBCACHE_TEST_DBFILE'))
	define('DBCACHE_TEST_DBFILE',dirname(__FILE__).'/temp/test2.db');

if(!defined('DBCACHE_TEST_DB'))
	define('DBCACHE_TEST_DB','sqlite:'.DBCACHE_TEST_DBFILE);

class CDbCacheTest extends CTestCase
{
	private $_config1=array(
		'id'=>'testApp',
		'components'=>array(
			'cache'=>array(
				'class'=>'CDbCache',
			),
		),
	);
	private $_config2=array(
		'id'=>'testApp',
		'components'=>array(
			'db'=>array(
				'connectionString'=>DBCACHE_TEST_DB,
			),
			'cache'=>array(
				'class'=>'system.caching.CDbCache',
				'connectionID'=>'db',
			),
		),
	);

	public function setUp()
	{
		if(!extension_loaded('pdo') || !extension_loaded('pdo_sqlite'))
			$this->markTestSkipped('PDO and SQLite extensions are required.');
	}

	public function testKeyPrefix()
	{
		$cache=new CDbCache;
		$this->assertEquals($cache->keyPrefix,'');
		$cache->keyPrefix='key';
		$this->assertEquals($cache->keyPrefix,'key');

		$app=new TestApplication($this->_config1);
		$app->reset();
		$this->assertTrue($app->cache instanceof CDbCache);
		$this->assertEquals($app->cache->keyPrefix,$app->id);
	}

	public function testGetAndSet()
	{
		$app=new TestApplication($this->_config1);
		$app->reset();
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data1';

		$this->assertFalse($cache->get($key));
		$cache->set($key,$data);
		$this->assertTrue($cache->get($key)===$data);

		$app2=new TestApplication($this->_config1);
		$this->assertTrue($app2->cache->get($key)===$data);
	}

	public function testArrayAccess()
	{
		$app=new TestApplication($this->_config1);
		$app->reset();
		$cache=$app->cache;
		$data=array('abc'=>1,2=>'def');
		$key='data2';
		$cache[$key]=$data;
		$this->assertTrue($cache->get($key)===$data);
		$this->assertTrue($cache[$key]===$data);
		unset($cache[$key]);
		$this->assertFalse($cache[$key]);
	}

	public function testExpire()
	{
		$app=new TestApplication($this->_config1);
		$app->reset();
		$cache=$app->cache;
		$data=array('abc'=>1,2=>'def');
		$key='data3';
		$cache->set($key,$data,2);
		$this->assertTrue($cache->get($key)===$data);
		sleep(4);
		$app2=new TestApplication($this->_config1);
		$this->assertFalse($app2->cache->get($key));
	}

	public function testUseDbConnection()
	{
		@unlink(DBCACHE_TEST_DBFILE);
		$app=new TestApplication($this->_config2);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data4';
		$this->assertFalse($cache->get($key));
		$cache->set($key,$data);
		$this->assertTrue($cache->get($key)===$data);

		$app2=new TestApplication($this->_config2);
		$this->assertTrue($app2->cache->get($key)===$data);
	}

	public function testDependency()
	{
		@unlink(DBCACHE_TEST_DBFILE);
		$app=new TestApplication($this->_config2);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data5';

		$cache->set($key,$data,0,new CFileCacheDependency(__FILE__));
		$this->assertTrue($cache->get($key)===$data);
		$app=new TestApplication($this->_config2);
		$this->assertTrue($app->cache->get($key)===$data);

		$key2='data6';
		$cache->set($key2,$data,0,new CFileCacheDependency(DBCACHE_TEST_DBFILE));
		sleep(2); // sleep to ensure timestamp is changed for the db file
		$cache->set('data7',$data);
		$app=new TestApplication($this->_config2);
		$this->assertFalse($app->cache->get($key2));
	}

	public function testAdd()
	{
		@unlink(DBCACHE_TEST_DBFILE);
		$app=new TestApplication($this->_config2);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data8';

		$cache->set($key,$data);
		$this->assertTrue($cache->set($key,$data));
		$this->assertFalse($cache->add($key,$data));
		$this->assertTrue($cache->add('data9',$data));
	}

	public function testDelete()
	{
		@unlink(DBCACHE_TEST_DBFILE);
		$app=new TestApplication($this->_config2);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data10';
		$cache->set($key,$data);
		$cache->delete($key);
		$this->assertFalse($cache->get($key));
	}

	public function testFlush()
	{
		@unlink(DBCACHE_TEST_DBFILE);
		$app=new TestApplication($this->_config2);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key1='data11';
		$key2='data12';
		$cache->set($key1,$data);
		$cache->set($key2,$data);
		$cache->flush();
		$this->assertFalse($cache->get($key1));
		$this->assertFalse($cache->get($key2));
	}
}


code:
<?php

Yii::import('system.caching.dependencies.CDirectoryCacheDependency');

class CDirectoryCacheDependencyTest extends CTestCase
{
	public function testDirectoryName()
	{
		$directory=realpath(dirname(__FILE__).'/temp');
		$dependency=new CDirectoryCacheDependency($directory);
		$this->assertEquals($dependency->directory,$directory);

		$this->setExpectedException('CException');
		$dependency=new CDirectoryCacheDependency(dirname(__FILE__).'/temp2');
		$dependency->evaluateDependency();
	}

	public function testRecursiveLevel()
	{
		$directory=realpath(dirname(__FILE__).'/temp');
		$dependency=new CDirectoryCacheDependency(dirname(__FILE__).'/temp');
		$this->assertEquals($dependency->recursiveLevel,-1);
		$dependency->recursiveLevel=5;
		$this->assertEquals($dependency->recursiveLevel,5);
	}

	public function testHasChanged()
	{
		$tempFile=dirname(__FILE__).'/temp/foo.txt';
		@unlink($tempFile);
		$fw=fopen($tempFile,"w");
		fwrite($fw,"test");
		fclose($fw);
		clearstatcache();

		$dependency=new CDirectoryCacheDependency(dirname($tempFile));
		$dependency->evaluateDependency();
		$str=serialize($dependency);

		// test directory not changed
		sleep(2);
		$dependency=unserialize($str);
		$this->assertFalse($dependency->hasChanged);

		// change file
		$fw=fopen($tempFile,"w");
		fwrite($fw,"test again");
		fclose($fw);
		clearstatcache();

		// test file changed
		sleep(2);
		$dependency->evaluateDependency();
		$dependency=unserialize($str);
		$this->assertTrue($dependency->hasChanged);

		@unlink($tempFile);
	}
}

?>


code:
<?php

Yii::import('system.caching.dependencies.CFileCacheDependency');

class CFileCacheDependencyTest extends CTestCase
{
	public function testFileName()
	{
		$dependency=new CFileCacheDependency(__FILE__);
		$this->assertEquals($dependency->fileName,__FILE__);
		$dependency->evaluateDependency();
		$this->assertEquals($dependency->dependentData,filemtime(__FILE__));

		$dependency=new CFileCacheDependency(dirname(__FILE__).'/foo.txt');
		$dependency->evaluateDependency();
		$this->assertFalse($dependency->dependentData);
	}

	public function testHasChanged()
	{
		$tempFile=dirname(__FILE__).'/temp/foo.txt';
		@unlink($tempFile);
		$fw=fopen($tempFile,"w");
		fwrite($fw,"test");
		fclose($fw);
		clearstatcache();

		$dependency=new CFileCacheDependency($tempFile);
		$dependency->evaluateDependency();
		$str=serialize($dependency);

		// test file not changed
		sleep(2);
		$dependency=unserialize($str);
		$this->assertFalse($dependency->hasChanged);

		// change file
		$fw=fopen($tempFile,"w");
		fwrite($fw,"test again");
		fclose($fw);
		clearstatcache();

		// test file changed
		sleep(2);
		$dependency->evaluateDependency();
		$dependency=unserialize($str);
		$this->assertTrue($dependency->hasChanged);

		@unlink($tempFile);
	}
}

?>


code:
<?php

if(!defined('MEMCACHE_TEST_HOST'))
	define('MEMCACHE_TEST_HOST', '127.0.0.1');

if(!defined('MEMCACHE_TEST_PORT'))
	define('MEMCACHE_TEST_PORT', 11211);

class CMemCacheTest extends CTestCase
{
	private $_config=array(
		'id'=>'testApp',
		'components'=>array(
			'cache'=>array(
	            'class'=>'CMemCache',
	            'servers'=>array(
	                array('host'=>MEMCACHE_TEST_HOST, 'port'=>MEMCACHE_TEST_PORT, 'weight'=>100),
	    		),
            ),
        ),

	);

	public function setUp()
	{
		if(!extension_loaded('memcache') && !extension_loaded('memcached'))
			$this->markTestSkipped('Memcache or memcached extensions are required.');
	}

	public function testMget()
	{
		$app=new TestApplication($this->_config);
		$app->reset();
		$cache=$app->cache;

		$data1=array('abc'=>1,2=>'def');
		$key1='data1';
		$data2=array('xyz'=>3,4=>'whn');
		$key2='data2';

		$cache->delete($key1);
		$cache->delete($key2);

		$this->assertFalse($cache->get($key1));
		$this->assertFalse($cache->get($key2));

		$cache->set($key1,$data1);
		$cache->set($key2,$data2);
		$this->assertTrue($cache->get($key1)===$data1);
		$this->assertTrue($cache->get($key2)===$data2);

		$mgetResult = $cache->mget(array($key1, $key2));
		$this->assertTrue(is_array($mgetResult));
		$this->assertEquals($mgetResult[$key1],$data1);
		$this->assertEquals($mgetResult[$key2],$data2);

		$cache->delete($key2);
		$mgetResult = $cache->mget(array($key1, $key2));
		$this->assertTrue(is_array($mgetResult));
		$this->assertEquals($mgetResult[$key1],$data1);
		$this->assertFalse($mgetResult[$key2]); // data2 is removed from cache

		$cache->delete($key1);
		$mgetResult = $cache->mget(array($key1, $key2));
		$this->assertTrue(is_array($mgetResult));
		$this->assertFalse($mgetResult[$key1]); // data1 is removed from cache
		$this->assertFalse($mgetResult[$key2]); // data2 is removed from cache
	}

	public function testKeyPrefix()
	{
		$cache=new CMemCache;
		$this->assertEquals($cache->keyPrefix,'');
		$cache->keyPrefix='key';
		$this->assertEquals($cache->keyPrefix,'key');

		$app=new TestApplication($this->_config);
		$app->reset();
		$this->assertTrue($app->cache instanceof CMemCache);
		$this->assertEquals($app->cache->keyPrefix,$app->id);
	}

	public function testGetAndSet()
	{
		$app=new TestApplication($this->_config);
		$app->reset();
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data1';
		$cache->delete($key);

		$this->assertFalse($cache->get($key));
		$cache->set($key,$data);
		$this->assertTrue($cache->get($key)===$data);

		$app2=new TestApplication($this->_config);
		$this->assertTrue($app2->cache->get($key)===$data);
	}

	public function testArrayAccess()
	{
		$app=new TestApplication($this->_config);
		$app->reset();
		$cache=$app->cache;
		$data=array('abc'=>1,2=>'def');
		$key='data2';
		$cache[$key]=$data;
		$this->assertTrue($cache->get($key)===$data);
		$this->assertTrue($cache[$key]===$data);
		unset($cache[$key]);
		$this->assertFalse($cache[$key]);
	}

	public function testExpire()
	{
		$app=new TestApplication($this->_config);
		$app->reset();
		$cache=$app->cache;
		$data=array('abc'=>1,2=>'def');
		$key='data3';
		$cache->set($key,$data,2);
		$this->assertTrue($cache->get($key)===$data);
		sleep(4);
		$app2=new TestApplication($this->_config);
		$this->assertFalse($app2->cache->get($key));
	}

	public function testDelete()
	{
		$app=new TestApplication($this->_config);
		$cache=$app->cache;

		$data=array('abc'=>1,2=>'def');
		$key='data10';
		$cache->set($key,$data);
		$cache->delete($key);
		$this->assertFalse($cache->get($key));
	}
}


code:
<?php

Yii::import('system.collections.CAttributeCollection');

class CAttributeCollectionTest extends CTestCase
{
	public function testCanGetProperty()
	{
		$collection = new CAttributeCollection();
		$collection->Property = 'value';
		$this->assertEquals('value', $collection->Property);
		$this->assertEquals(true, $collection->canGetProperty('Property'));
	}

	public function testCanNotGetUndefinedProperty()
	{
		$collection = new CAttributeCollection(array(), true);
		$this->assertEquals(false, $collection->canGetProperty('Property'));
		$this->setExpectedException('CException');
		$value=$collection->Property;
	}

	public function testCanSetProperty()
	{
		$collection = new CAttributeCollection();
		$collection->Property = 'value';
		$this->assertEquals('value', $collection->itemAt('Property'));
		$this->assertEquals(true, $collection->canSetProperty('Property'));
	}

	public function testCanNotSetPropertyIfReadOnly()
	{
		$collection = new CAttributeCollection(array(), true);
		$this->setExpectedException('CException');
		$collection->Property = 'value';
	}

	public function testGetCaseSensitive()
	{
		$collection = new CAttributeCollection();
		$collection->caseSensitive=false;
		$this->assertEquals(false, $collection->caseSensitive);
		$collection->caseSensitive=true;
		$this->assertEquals(true, $collection->caseSensitive);
	}

	public function testSetCaseSensitive()
	{
		$collection = new CAttributeCollection();
		$collection->Property = 'value';
		$collection->caseSensitive=false;
		$this->assertEquals('value', $collection->itemAt('property'));
	}

	public function testItemAt()
	{
		$collection = new CAttributeCollection();
		$collection->Property = 'value';
		$this->assertEquals('value', $collection->itemAt('Property'));
	}

	public function testAdd()
	{
		$collection = new CAttributeCollection();
		$collection->add('Property', 'value');
		$this->assertEquals('value', $collection->itemAt('Property'));
	}

	public function testRemove()
	{
		$collection = new CAttributeCollection();
		$collection->add('Property', 'value');
		$collection->remove('Property');
		$this->assertEquals(0, count($collection));
	}

	public function testUnset(){
		$collection = new CAttributeCollection();
		$collection->add('Property', 'value');
		unset($collection->Property);
		$this->assertEquals(0, count($collection));
	}

	public function testIsset(){
		$collection = new CAttributeCollection();
		$this->assertEquals(false, isset($collection->Property));
		$collection->Property = 'value';
		$this->assertEquals(true, isset($collection->Property));
	}

	public function testContains()
	{
		$collection = new CAttributeCollection();
		$this->assertEquals(false, $collection->contains('Property'));
		$collection->Property = 'value';
		$this->assertEquals(true, $collection->contains('Property'));
	}

	public function testHasProperty()
	{
		$collection = new CAttributeCollection();
		$this->assertEquals(false, $collection->hasProperty('Property'));
		$collection->Property = 'value';
		$this->assertEquals(true, $collection->hasProperty('Property'));
	}
}