本文整理汇总了PHP中Countries::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP Countries::singleton方法的具体用法?PHP Countries::singleton怎么用?PHP Countries::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Countries
的用法示例。
在下文中一共展示了Countries::singleton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
* See the enclosed file COPYING for license information (GPL). If you did not
* receive this file, see http://www.fsf.org/copyleft/gpl.html.
*
* @author Marko Djukic <marko@oblo.com>
* @version $Revision$
* @since Horde 3.0
*
* @todo Would be good to expand this to fetch also ISO-3166-2 lists from
* somewhere for lists of countries' regions/states.
*/
define('HORDE_BASE', dirname(__FILE__) . '/..');
require_once HORDE_BASE . '/lib/core.php';
/* Location on ISO website where to fetch the updates from. */
$url = 'http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt';
define('HORDE_BASE', dirname(__FILE__) . '/..');
$countries =& Countries::singleton($url);
/* Update Horde's file. */
$updated = $countries->update();
if ($updated == false) {
/* Nothing found to update. */
$countries->cli->writeln(_("Nothing to update. Exiting."));
exit;
}
/* Save the new file. */
$countries->save();
exit;
class Countries
{
var $old_data = array();
var $new_data = array();
var $cli;