Source for file File.php
Documentation is available at File.php
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Naoki Shima <naoki@avantexchange.com> |
// +----------------------------------------------------------------------+
require_once 'Common.php';
* Get message, and charset from php file, and return corresponding message
* Full path to the file may look like this:
* /usr/local/apache/htdocs/lang/ja/general.php
* In this case, you can use I18N_Messages_File as follows:
* $dir = '/usr/local/apache/htdocs/lang/';
* require_once 'I18N/Messages/File.php';
* $i18n =& I18N_Messages_File($lang,$domain,$dir);
* /usr/local/apache/htdocs/lang/ja/general.php:
* $this->setCharset('euc-jp'); // Set charset of this file
* $messages = array('hello' => 'Kon nichiwa'); // you can put more than one message in this.
* $this->set($messages); // or $this->set('Hello', 'Kon nichiwa');
* Holds directory information
* @type : string Directory name
* Save Lanuguage and the directory name where language file resides.
* @param : string Lanuguage Code
* @param : string Directory Name
function __construct($lang = 'en', $domain = '',$dir = './')
$this->bindLanguage ($lang);
$this->bindDomain ($domain);
// {{ I18N_Messages_File()
* For pre-Zend2 compatibility. Call actual constructor
* @param : string Lanuguage Code
* @param : string Directory Name
* Load the lanuguage file
* @param : string Language code
include_once $this->getDir(). $this->bindLanguage (). '/'. $this->bindDomain (). '.php';
* @return: string Directory name
* @return: string Directory name
// make sure it's loaded. for just after bindDomain() or bindLanuguage() method is called.
return ($messageID !== "" && is_array($this->_message) && in_array($messageID, array_keys($this->_message))) ? $this->_message[$messageID] : $messageID;
Documentation generated on Mon, 11 Mar 2019 15:36:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|