Version Description
Latest Point Release = Released: 18th December, 2017
- (v.0) ADDED: All-new Shield Welcome and Setup Wizard - more helpful guided wizards to come.
- (v.0) ADDED: [PRO] Shield options import and export
- (v.0) ADDED: [PRO] In conjunction with import/export - Shield Security Network: automated options syncing.
- (v.0) CHANGED: Going forward, new features and options will support only PHP 5.4+. Existing features will remain unaffected.
Download this release
Release Info
Developer | paultgoodchild |
Plugin | Shield Security for WordPress |
Version | 6.0.0 |
Comparing to | |
See all releases |
Code changes from version 5.20.1 to 6.0.0
- icwp-plugin-controller.php +55 -10
- icwp-wpsf.php +3 -2
- plugin-spec.php +1 -1
- readme.txt +10 -10
- resources/css/global-plugin.css +41 -57
- resources/css/jquery.fancybox.min.css +1 -0
- resources/css/jquery.steps.css +383 -0
- resources/css/pages.css +13 -0
- resources/css/plugin.css +31 -14
- resources/css/wizard.css +70 -0
- resources/images/shield/shieldnetworkmini.png +0 -0
- resources/images/wizard/general-module_onoff.png +0 -0
- resources/images/wizard/general-option_help.png +0 -0
- resources/images/wizard/general-shield_actions.png +0 -0
- resources/images/wizard/general-shield_help.png +0 -0
- resources/images/wizard/general-shield_modules.png +0 -0
- resources/images/wizard/general-shield_options.png +0 -0
- resources/images/wizard/general-shield_where.png +0 -0
- resources/js/jquery.fancybox.min.js +12 -0
- resources/js/jquery.steps.min.js +6 -0
- resources/js/wizard.js +0 -0
- src/common/icwp-data.php +529 -480
- src/common/icwp-edd.php +37 -0
- src/common/icwp-factory.php +2 -3
- src/common/icwp-foundation.php +2 -2
- src/common/icwp-googlearecaptcha.php +35 -34
- src/common/icwp-googleauthenticator.php +58 -57
- src/common/icwp-optionsvo.php +21 -18
- src/common/icwp-render.php +289 -287
- src/common/icwp-wpcron.php +111 -110
- src/common/icwp-wpdb.php +193 -200
- src/common/icwp-wpfilesystem.php +414 -417
- src/common/icwp-wpfunctions.php +1 -0
- src/common/lib/composer.json +28 -0
- src/common/lib/composer.lock +299 -0
- src/common/lib/vendor/autoload.php +7 -0
- src/common/lib/vendor/composer/ClassLoader.php +445 -0
- src/common/lib/vendor/composer/LICENSE +21 -0
- src/common/lib/vendor/composer/autoload_classmap.php +9 -0
- src/common/lib/vendor/composer/autoload_files.php +10 -0
- src/common/lib/vendor/composer/autoload_namespaces.php +10 -0
- src/common/lib/vendor/composer/autoload_psr4.php +14 -0
- src/common/lib/vendor/composer/autoload_real.php +70 -0
- src/common/lib/vendor/composer/autoload_static.php +75 -0
- src/common/lib/vendor/composer/installed.json +291 -0
- src/common/lib/vendor/fernleafsystems/utilities/src/Data/Adapter/StdClassAdapter.php +151 -0
- src/common/lib/vendor/fernleafsystems/utilities/src/Response.php +158 -0
- src/common/lib/vendor/nesbot/carbon/.php_cs.dist +57 -0
- src/common/lib/vendor/nesbot/carbon/LICENSE +19 -0
- src/common/lib/vendor/nesbot/carbon/readme.md +92 -0
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Carbon.php +3355 -3355
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/CarbonInterval.php +557 -557
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Exceptions/InvalidDateException.php +67 -67
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/af.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ar.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/az.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/bg.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/bn.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ca.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/cs.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/da.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/de.php +40 -40
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/el.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/en.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/eo.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/es.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/et.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/eu.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fa.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fi.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fo.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fr.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/gl.php +24 -24
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/he.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hr.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hu.php +52 -52
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hy.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/id.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/it.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ja.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ka.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/km.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ko.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/lt.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/lv.php +47 -47
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/mk.php +24 -24
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ms.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/nl.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/no.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pl.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pt.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pt_BR.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ro.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ru.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sk.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sl.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sq.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_Cyrl_ME.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_Latn_ME.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_ME.php +38 -38
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sv.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/th.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/tr.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/uk.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ur.php +24 -24
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/uz.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/vi.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/zh.php +31 -31
- src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/zh_TW.php +31 -31
- src/common/lib/vendor/symfony/polyfill-mbstring/LICENSE +19 -0
- src/common/lib/vendor/symfony/polyfill-mbstring/Mbstring.php +664 -0
- src/common/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1101 -0
- src/common/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1109 -0
- src/common/lib/vendor/symfony/polyfill-mbstring/bootstrap.php +56 -0
- src/common/lib/vendor/symfony/translation/CHANGELOG.md +94 -0
- src/common/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php +158 -0
- src/common/lib/vendor/symfony/translation/Catalogue/MergeOperation.php +55 -0
- src/common/lib/vendor/symfony/translation/Catalogue/OperationInterface.php +77 -0
- src/common/lib/vendor/symfony/translation/Catalogue/TargetOperation.php +69 -0
- src/common/lib/vendor/symfony/translation/Command/XliffLintCommand.php +245 -0
- src/common/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +167 -0
- src/common/lib/vendor/symfony/translation/DataCollectorTranslator.php +165 -0
- src/common/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +44 -0
- src/common/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +49 -0
- src/common/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +95 -0
- src/common/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php +63 -0
- src/common/lib/vendor/symfony/translation/Dumper/DumperInterface.php +31 -0
- src/common/lib/vendor/symfony/translation/Dumper/FileDumper.php +126 -0
- src/common/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php +106 -0
- src/common/lib/vendor/symfony/translation/Dumper/IniFileDumper.php +45 -0
- src/common/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php +44 -0
- src/common/lib/vendor/symfony/translation/Dumper/MoFileDumper.php +82 -0
- src/common/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php +38 -0
- src/common/lib/vendor/symfony/translation/Dumper/PoFileDumper.php +61 -0
- src/common/lib/vendor/symfony/translation/Dumper/QtFileDumper.php +50 -0
- src/common/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php +200 -0
- src/common/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php +62 -0
- src/common/lib/vendor/symfony/translation/Exception/ExceptionInterface.php +21 -0
- src/common/lib/vendor/symfony/translation/Exception/InvalidArgumentException.php +21 -0
- src/common/lib/vendor/symfony/translation/Exception/InvalidResourceException.php +21 -0
- src/common/lib/vendor/symfony/translation/Exception/LogicException.php +21 -0
- src/common/lib/vendor/symfony/translation/Exception/NotFoundResourceException.php +21 -0
- src/common/lib/vendor/symfony/translation/Exception/RuntimeException.php +21 -0
- src/common/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php +85 -0
- src/common/lib/vendor/symfony/translation/Extractor/ChainExtractor.php +60 -0
- src/common/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php +38 -0
- src/common/lib/vendor/symfony/translation/Extractor/PhpExtractor.php +258 -0
- src/common/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +142 -0
- src/common/lib/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php +30 -0
- src/common/lib/vendor/symfony/translation/Formatter/MessageFormatter.php +48 -0
- src/common/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php +30 -0
- src/common/lib/vendor/symfony/translation/IdentityTranslator.php +63 -0
- src/common/lib/vendor/symfony/translation/Interval.php +109 -0
- src/common/lib/vendor/symfony/translation/LICENSE +19 -0
- src/common/lib/vendor/symfony/translation/Loader/ArrayLoader.php +66 -0
- src/common/lib/vendor/symfony/translation/Loader/CsvFileLoader.php +65 -0
- src/common/lib/vendor/symfony/translation/Loader/FileLoader.php +65 -0
- src/common/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php +62 -0
- src/common/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php +92 -0
- src/common/lib/vendor/symfony/translation/Loader/IniFileLoader.php +28 -0
- src/common/lib/vendor/symfony/translation/Loader/JsonFileLoader.php +64 -0
- src/common/lib/vendor/symfony/translation/Loader/LoaderInterface.php +38 -0
- src/common/lib/vendor/symfony/translation/Loader/MoFileLoader.php +148 -0
- src/common/lib/vendor/symfony/translation/Loader/PhpFileLoader.php +28 -0
- src/common/lib/vendor/symfony/translation/Loader/PoFileLoader.php +148 -0
- src/common/lib/vendor/symfony/translation/Loader/QtFileLoader.php +77 -0
- src/common/lib/vendor/symfony/translation/Loader/XliffFileLoader.php +342 -0
- src/common/lib/vendor/symfony/translation/Loader/YamlFileLoader.php +57 -0
- src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd +2223 -0
- src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd +411 -0
- src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd +309 -0
- src/common/lib/vendor/symfony/translation/LoggingTranslator.php +136 -0
- src/common/lib/vendor/symfony/translation/MessageCatalogue.php +271 -0
- src/common/lib/vendor/symfony/translation/MessageCatalogueInterface.php +136 -0
- src/common/lib/vendor/symfony/translation/MessageSelector.php +94 -0
- src/common/lib/vendor/symfony/translation/MetadataAwareInterface.php +54 -0
- src/common/lib/vendor/symfony/translation/PluralizationRules.php +208 -0
- src/common/lib/vendor/symfony/translation/README.md +13 -0
- src/common/lib/vendor/symfony/translation/Reader/TranslationReader.php +63 -0
- src/common/lib/vendor/symfony/translation/Reader/TranslationReaderInterface.php +30 -0
- src/common/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd +482 -0
icwp-plugin-controller.php
CHANGED
@@ -104,6 +104,11 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
104 |
*/
|
105 |
protected $oFeatureHandlerPlugin;
|
106 |
|
|
|
|
|
|
|
|
|
|
|
107 |
/**
|
108 |
* @param $sRootFile
|
109 |
* @return ICWP_WPSF_Plugin_Controller
|
@@ -263,7 +268,7 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
263 |
protected function doRegisterHooks() {
|
264 |
$this->registerActivationHooks();
|
265 |
|
266 |
-
add_action( 'init', array( $this, 'onWpInit' ) );
|
267 |
add_action( 'admin_init', array( $this, 'onWpAdminInit' ) );
|
268 |
add_action( 'wp_loaded', array( $this, 'onWpLoaded' ) );
|
269 |
|
@@ -357,7 +362,7 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
357 |
* @return boolean
|
358 |
*/
|
359 |
public function getMeetsBasePermissions() {
|
360 |
-
return $this->bMeetsBasePermissions;
|
361 |
}
|
362 |
|
363 |
/**
|
@@ -981,12 +986,19 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
981 |
}
|
982 |
|
983 |
/**
|
984 |
-
* @param bool $bCheckUserPermissions
|
985 |
* @return bool
|
986 |
*/
|
987 |
-
public function
|
988 |
-
|
989 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
990 |
return false;
|
991 |
}
|
992 |
|
@@ -1249,6 +1261,21 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
1249 |
return $this->getPath_Assets( 'images' . DIRECTORY_SEPARATOR . $sAsset );
|
1250 |
}
|
1251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1252 |
/**
|
1253 |
* get the root directory for the plugin with the trailing slash
|
1254 |
* @return string
|
@@ -1527,6 +1554,21 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
1527 |
return $bSuccess;
|
1528 |
}
|
1529 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1530 |
/**
|
1531 |
* @param array $aFeatureProperties
|
1532 |
* @param bool $bRecreate
|
@@ -1538,13 +1580,14 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
1538 |
|
1539 |
$sFeatureSlug = $aFeatureProperties[ 'slug' ];
|
1540 |
|
|
|
|
|
|
|
|
|
|
|
1541 |
$sFeatureName = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $sFeatureSlug ) ) );
|
1542 |
$sOptionsVarName = sprintf( 'oFeatureHandler%s', $sFeatureName ); // e.g. oFeatureHandlerPlugin
|
1543 |
|
1544 |
-
if ( isset( $this->{$sOptionsVarName} ) ) {
|
1545 |
-
return $this->{$sOptionsVarName};
|
1546 |
-
}
|
1547 |
-
|
1548 |
$sSourceFile = $this->getPath_SourceFile(
|
1549 |
sprintf(
|
1550 |
'features/%s.php',
|
@@ -1574,6 +1617,8 @@ class ICWP_WPSF_Plugin_Controller extends ICWP_WPSF_Foundation {
|
|
1574 |
$sMessage .= sprintf( 'Class "%s" %s', $sClassName, $bClassExists ? 'exists' : 'missing' );
|
1575 |
throw new Exception( $sMessage );
|
1576 |
}
|
|
|
|
|
1577 |
return $this->{$sOptionsVarName};
|
1578 |
}
|
1579 |
}
|
104 |
*/
|
105 |
protected $oFeatureHandlerPlugin;
|
106 |
|
107 |
+
/**
|
108 |
+
* @var ICWP_WPSF_FeatureHandler_Base[]
|
109 |
+
*/
|
110 |
+
protected $aModules;
|
111 |
+
|
112 |
/**
|
113 |
* @param $sRootFile
|
114 |
* @return ICWP_WPSF_Plugin_Controller
|
268 |
protected function doRegisterHooks() {
|
269 |
$this->registerActivationHooks();
|
270 |
|
271 |
+
add_action( 'init', array( $this, 'onWpInit' ), 0 );
|
272 |
add_action( 'admin_init', array( $this, 'onWpAdminInit' ) );
|
273 |
add_action( 'wp_loaded', array( $this, 'onWpLoaded' ) );
|
274 |
|
362 |
* @return boolean
|
363 |
*/
|
364 |
public function getMeetsBasePermissions() {
|
365 |
+
return (bool)$this->bMeetsBasePermissions;
|
366 |
}
|
367 |
|
368 |
/**
|
986 |
}
|
987 |
|
988 |
/**
|
|
|
989 |
* @return bool
|
990 |
*/
|
991 |
+
public function getUserCanBasePerms() {
|
992 |
+
return current_user_can( $this->getBasePermissions() );
|
993 |
+
}
|
994 |
+
|
995 |
+
/**
|
996 |
+
* @param bool $bCheckUserPerms - do we check the logged-in user permissions
|
997 |
+
* @return bool
|
998 |
+
*/
|
999 |
+
public function getIsValidAdminArea( $bCheckUserPerms = true ) {
|
1000 |
+
if ( $bCheckUserPerms && $this->loadWpTrack()->getWpActionHasFired( 'init' )
|
1001 |
+
&& !$this->getUserCanBasePerms() ) {
|
1002 |
return false;
|
1003 |
}
|
1004 |
|
1261 |
return $this->getPath_Assets( 'images' . DIRECTORY_SEPARATOR . $sAsset );
|
1262 |
}
|
1263 |
|
1264 |
+
/**
|
1265 |
+
* @return string
|
1266 |
+
*/
|
1267 |
+
public function getPath_Config() {
|
1268 |
+
return $this->getPath_Source().'config/';
|
1269 |
+
}
|
1270 |
+
|
1271 |
+
/**
|
1272 |
+
* @param string $sSlug
|
1273 |
+
* @return string
|
1274 |
+
*/
|
1275 |
+
public function getPath_ConfigFile( $sSlug ) {
|
1276 |
+
return $this->getPath_Config().sprintf( 'feature-%s.php', $sSlug );
|
1277 |
+
}
|
1278 |
+
|
1279 |
/**
|
1280 |
* get the root directory for the plugin with the trailing slash
|
1281 |
* @return string
|
1554 |
return $bSuccess;
|
1555 |
}
|
1556 |
|
1557 |
+
/**
|
1558 |
+
* @param string $sSlug
|
1559 |
+
* @return ICWP_WPSF_FeatureHandler_Base|null
|
1560 |
+
*/
|
1561 |
+
public function getModule( $sSlug ) {
|
1562 |
+
if ( !is_array( $this->aModules ) ) {
|
1563 |
+
$this->aModules = array();
|
1564 |
+
}
|
1565 |
+
$oModule = isset( $this->aModules[ $sSlug ] ) ? $this->aModules[ $sSlug ] : null;
|
1566 |
+
if ( !is_null( $oModule ) && !( $oModule instanceof ICWP_WPSF_FeatureHandler_Base ) ) {
|
1567 |
+
$oModule = null;
|
1568 |
+
}
|
1569 |
+
return $oModule;
|
1570 |
+
}
|
1571 |
+
|
1572 |
/**
|
1573 |
* @param array $aFeatureProperties
|
1574 |
* @param bool $bRecreate
|
1580 |
|
1581 |
$sFeatureSlug = $aFeatureProperties[ 'slug' ];
|
1582 |
|
1583 |
+
$oHandler = $this->getModule( $sFeatureSlug );
|
1584 |
+
if ( !empty( $oHandler ) ) {
|
1585 |
+
return $oHandler;
|
1586 |
+
}
|
1587 |
+
|
1588 |
$sFeatureName = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $sFeatureSlug ) ) );
|
1589 |
$sOptionsVarName = sprintf( 'oFeatureHandler%s', $sFeatureName ); // e.g. oFeatureHandlerPlugin
|
1590 |
|
|
|
|
|
|
|
|
|
1591 |
$sSourceFile = $this->getPath_SourceFile(
|
1592 |
sprintf(
|
1593 |
'features/%s.php',
|
1617 |
$sMessage .= sprintf( 'Class "%s" %s', $sClassName, $bClassExists ? 'exists' : 'missing' );
|
1618 |
throw new Exception( $sMessage );
|
1619 |
}
|
1620 |
+
|
1621 |
+
$this->aModules[ $sFeatureSlug ] = $this->{$sOptionsVarName};
|
1622 |
return $this->{$sOptionsVarName};
|
1623 |
}
|
1624 |
}
|
icwp-wpsf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Shield Security
|
4 |
* Plugin URI: http://icwp.io/2f
|
5 |
* Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
|
6 |
-
* Version:
|
7 |
* Text Domain: wp-simple-firewall
|
8 |
* Domain Path: /languages/
|
9 |
* Author: iControlWP
|
@@ -135,7 +135,8 @@ class ICWP_WPSF_Shield_Security extends ICWP_Wordpress_Simple_Firewall {
|
|
135 |
}
|
136 |
}
|
137 |
|
138 |
-
$oICWP_Wpsf
|
|
|
139 |
try {
|
140 |
$oICWP_Wpsf_Controller = ICWP_WPSF_Plugin_Controller::GetInstance( __FILE__ );
|
141 |
$oICWP_Wpsf = ICWP_WPSF_Shield_Security::GetInstance( $oICWP_Wpsf_Controller );
|
3 |
* Plugin Name: Shield Security
|
4 |
* Plugin URI: http://icwp.io/2f
|
5 |
* Description: Powerful, Easy-To-Use #1 Rated WordPress Security System
|
6 |
+
* Version: 6.0.0
|
7 |
* Text Domain: wp-simple-firewall
|
8 |
* Domain Path: /languages/
|
9 |
* Author: iControlWP
|
135 |
}
|
136 |
}
|
137 |
|
138 |
+
global $oICWP_Wpsf;
|
139 |
+
|
140 |
try {
|
141 |
$oICWP_Wpsf_Controller = ICWP_WPSF_Plugin_Controller::GetInstance( __FILE__ );
|
142 |
$oICWP_Wpsf = ICWP_WPSF_Shield_Security::GetInstance( $oICWP_Wpsf_Controller );
|
plugin-spec.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"properties": {
|
3 |
-
"version": "
|
4 |
"slug_parent": "icwp",
|
5 |
"slug_plugin": "wpsf",
|
6 |
"human_name": "Shield",
|
1 |
{
|
2 |
"properties": {
|
3 |
+
"version": "6.0.0",
|
4 |
"slug_parent": "icwp",
|
5 |
"slug_plugin": "wpsf",
|
6 |
"human_name": "Shield",
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
|
|
6 |
Tags: security, firewall, spam, scan, two-factor authentication, login, 2FA, ithemes, wordfence, better wp security, all-in-one, lockdown, hack
|
7 |
Requires at least: 3.5.0
|
8 |
Tested up to: 4.9
|
9 |
-
Stable tag:
|
10 |
|
11 |
Protect your reputation, your customers' reputation, and your WordPress sites for free with Shield - the most powerful security system for WordPress
|
12 |
|
@@ -338,16 +338,16 @@ Technical support, and some newer options and features will not be available to
|
|
338 |
|
339 |
You can [go Pro for just $1/month](http://icwp.io/aa). Technical support is available to premium clients only.
|
340 |
|
341 |
-
=
|
342 |
-
*Released:
|
343 |
|
344 |
-
* **(v.
|
345 |
-
* **(v.0)**
|
346 |
-
* **(v.0)**
|
347 |
-
* **(v.0)**
|
348 |
-
|
349 |
-
|
350 |
-
*
|
351 |
|
352 |
= 5.20.0 Series =
|
353 |
*Released: 11th December, 2017*
|
6 |
Tags: security, firewall, spam, scan, two-factor authentication, login, 2FA, ithemes, wordfence, better wp security, all-in-one, lockdown, hack
|
7 |
Requires at least: 3.5.0
|
8 |
Tested up to: 4.9
|
9 |
+
Stable tag: 6.0.0
|
10 |
|
11 |
Protect your reputation, your customers' reputation, and your WordPress sites for free with Shield - the most powerful security system for WordPress
|
12 |
|
338 |
|
339 |
You can [go Pro for just $1/month](http://icwp.io/aa). Technical support is available to premium clients only.
|
340 |
|
341 |
+
= 6.0.0 Latest Point Release =
|
342 |
+
*Released: 18th December, 2017*
|
343 |
|
344 |
+
* **(v.0)** ADDED: All-new Shield Welcome and Setup Wizard - more helpful guided wizards to come.
|
345 |
+
* **(v.0)** ADDED: [**PRO**] [Shield options import and export](http://icwp.io/at)
|
346 |
+
* **(v.0)** ADDED: [**PRO**] In conjunction with import/export - Shield Security Network: automated options syncing.
|
347 |
+
* **(v.0)** CHANGED: Going forward, new features and options will [support only PHP 5.4+](http://icwp.io/au). Existing features will remain unaffected.
|
348 |
+
|
349 |
+
= 6.0.0 Series =
|
350 |
+
*Released: 18th December, 2017*
|
351 |
|
352 |
= 5.20.0 Series =
|
353 |
*Released: 11th December, 2017*
|
resources/css/global-plugin.css
CHANGED
@@ -8,14 +8,13 @@
|
|
8 |
border-right-width: 5px;
|
9 |
border-left-width: 5px;
|
10 |
}
|
11 |
-
|
12 |
#wpbody-content .icwp-admin-notice,
|
13 |
#wpbody-content .icwp-admin-notice p {
|
14 |
-
text-shadow: -1px -1px 0 rgba(
|
15 |
}
|
16 |
#wpbody-content .icwp-admin-notice.updated,
|
17 |
#wpbody-content .icwp-admin-notice.updated p {
|
18 |
-
color: rgba(
|
19 |
}
|
20 |
#wpbody-content .icwp-admin-notice form {
|
21 |
margin: 0;
|
@@ -26,18 +25,16 @@
|
|
26 |
#wpbody-content .icwp-admin-notice .button:hover {
|
27 |
text-decoration: none;
|
28 |
}
|
29 |
-
|
30 |
#wpbody-content .icwp-admin-notice .notice-dismiss::before {
|
31 |
color: rgba(0, 0, 0, 0.5);
|
32 |
font-size: 24px;
|
33 |
line-height: 21px;
|
34 |
padding-right: 4px;
|
35 |
}
|
36 |
-
|
37 |
#wpbody-content .info.icwp-admin-notice,
|
38 |
#wpbody-content .promo.icwp-admin-notice {
|
39 |
-
background-color: rgba(
|
40 |
-
border-color: rgba(
|
41 |
}
|
42 |
#wpbody-content .info.icwp-admin-notice,
|
43 |
#wpbody-content .info.icwp-admin-notice p,
|
@@ -45,7 +42,6 @@
|
|
45 |
#wpbody-content .promo.icwp-admin-notice p {
|
46 |
color: rgba(21, 77, 111, 0.99);
|
47 |
}
|
48 |
-
|
49 |
#wpbody-content .error.icwp-admin-notice {
|
50 |
border-color: rgba(240, 51, 4, 0.56);
|
51 |
background-color: rgba(255, 185, 167, 0.25);
|
@@ -53,30 +49,37 @@
|
|
53 |
#wpbody-content .error.icwp-admin-notice h3 {
|
54 |
color: rgba(199, 41, 0, 1);
|
55 |
}
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
ul.nav-tabs li a {
|
58 |
color: rgba(69, 119, 0, 1);
|
59 |
}
|
60 |
ul.nav-tabs li.active a {
|
61 |
color: #000000;
|
62 |
}
|
63 |
-
|
64 |
.bootstrap-wpadmin .form-horizontal .form-actions {
|
65 |
-
background-color: rgba(0,0,0,0.07);
|
66 |
-
border: 1px solid #
|
67 |
border-top: 1px solid transparent;
|
68 |
}
|
69 |
-
|
70 |
.bootstrap-wpadmin .icwpTopLevelRow {
|
71 |
}
|
72 |
.bootstrap-wpadmin .icwpTopLevelRow .icwpTopLevelSpan {
|
73 |
margin-left: 0;
|
74 |
}
|
75 |
-
|
76 |
#icwpOptionsTopPill {
|
77 |
}
|
78 |
#icwpOptionsTopPill > .nav-pills {
|
79 |
-
border-bottom: 1px dashed #
|
80 |
padding-bottom: 10px;
|
81 |
}
|
82 |
#icwpOptionsTopPill > .nav-pills li {
|
@@ -85,7 +88,7 @@ ul.nav-tabs li.active a {
|
|
85 |
#icwpOptionsTopPill > .nav-pills li a {
|
86 |
background-color: rgba(0, 0, 0, 0.2);
|
87 |
text-shadow: 1px 0 0 rgba(255, 255, 255, 0.4);
|
88 |
-
color: #
|
89 |
height: 50px;
|
90 |
}
|
91 |
#icwpOptionsTopPill > .nav-pills li a:hover {
|
@@ -104,7 +107,7 @@ ul.nav-tabs li.active a {
|
|
104 |
#icwpOptionsTopPill > .nav-pills li.active a {
|
105 |
background-color: rgba(69, 119, 0, 1);
|
106 |
color: #ffffff;
|
107 |
-
text-shadow: 1px 0 0 rgba(0,0,0,0.5);
|
108 |
}
|
109 |
#icwpOptionsTopPill > .nav-pills li a .title {
|
110 |
font-weight: bolder;
|
@@ -136,7 +139,7 @@ ul.nav-tabs li.active a {
|
|
136 |
font-size: 14px;
|
137 |
}
|
138 |
#icwpOptionsTopPill .content-help dt {
|
139 |
-
border-bottom: 1px dotted rgba(0,0,0,0.2);
|
140 |
font-size: 16px;
|
141 |
margin-bottom: 7px;
|
142 |
padding-bottom: 3px;
|
@@ -145,7 +148,6 @@ ul.nav-tabs li.active a {
|
|
145 |
margin-bottom: 15px;
|
146 |
margin-left: 12px;
|
147 |
}
|
148 |
-
|
149 |
th.column-icwp_autoupdate, td.icwp_autoupdate, th#icwp_autoupdate {
|
150 |
text-align: center;
|
151 |
vertical-align: middle;
|
@@ -156,27 +158,25 @@ td.icwp_autoupdate span.icwp-pluginautoupdateicon.dashicons-update {
|
|
156 |
td.icwp_autoupdate span.icwp-pluginautoupdateicon.dashicons-hammer {
|
157 |
color: #87492e;
|
158 |
}
|
159 |
-
|
160 |
body.plugins-php .wrap > ul li.vulnerable a {
|
161 |
color: darkred;
|
162 |
}
|
163 |
-
|
164 |
tr.icwp-plugin-vulnerability > td {
|
165 |
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#fff4f4+0,f7e3e3+100 */
|
166 |
background: #fff4f4; /* Old browsers */
|
167 |
background: -moz-linear-gradient(top, #fff4f4 0%, #f7e3e3 100%); /* FF3.6-15 */
|
168 |
-
background: -webkit-linear-gradient(top, #fff4f4 0
|
169 |
-
background: linear-gradient(to bottom, #fff4f4 0
|
170 |
-
filter: progid:DXImageTransform.Microsoft.gradient(
|
171 |
|
172 |
padding: 12px 40px;
|
173 |
-
box-shadow: inset 0 -1px 0 rgba(0,0,0
|
174 |
}
|
175 |
tr.icwp-plugin-vulnerability > td table {
|
176 |
width: 100%;
|
177 |
}
|
178 |
tr.icwp-plugin-vulnerability > td table th {
|
179 |
-
color: #
|
180 |
font-weight: bolder;
|
181 |
}
|
182 |
tr.icwp-plugin-vulnerability a {
|
@@ -189,7 +189,6 @@ tr.icwp-plugin-vulnerability dl {
|
|
189 |
tr.icwp-plugin-vulnerability dd {
|
190 |
margin-bottom: 3px;
|
191 |
}
|
192 |
-
|
193 |
.restricted-option {
|
194 |
background-color: rgba(255, 255, 255, 0.6);
|
195 |
border: 1px solid;
|
@@ -201,7 +200,6 @@ tr.icwp-plugin-vulnerability dd {
|
|
201 |
margin: 2px 0 4px;
|
202 |
padding: 7px 8px 5px 6px;
|
203 |
}
|
204 |
-
|
205 |
.shield-user-options-block {
|
206 |
}
|
207 |
.shield-user-options-block table {
|
@@ -211,16 +209,14 @@ tr.icwp-plugin-vulnerability dd {
|
|
211 |
letter-spacing: 5px;
|
212 |
font-family: monospace;
|
213 |
font-size: 24px;
|
214 |
-
text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
|
215 |
-
border: 1px solid rgba(0,0,0,0.1);
|
216 |
padding: 0 7px;
|
217 |
background-color: whitesmoke;
|
218 |
}
|
219 |
-
|
220 |
.wp-submenu-wrap a .icwp_highlighted {
|
221 |
color: yellow;
|
222 |
}
|
223 |
-
|
224 |
#icwp-wpsf-dashboard_widget {
|
225 |
}
|
226 |
#tableShieldStatisticsWidget {
|
@@ -229,18 +225,16 @@ tr.icwp-plugin-vulnerability dd {
|
|
229 |
padding: 5px 10px;
|
230 |
width: 100%;
|
231 |
}
|
232 |
-
|
233 |
-
|
234 |
.icwp-toggle-switch {
|
235 |
position: relative;
|
236 |
display: inline-block;
|
237 |
width: 60px;
|
238 |
height: 34px;
|
239 |
}
|
240 |
-
|
241 |
/* Hide default HTML checkbox */
|
242 |
-
.icwp-toggle-switch input {
|
243 |
-
|
|
|
244 |
/* The slider */
|
245 |
.icwp-toggle-switch {
|
246 |
cursor: pointer;
|
@@ -255,7 +249,6 @@ tr.icwp-plugin-vulnerability dd {
|
|
255 |
-webkit-transition: .4s;
|
256 |
transition: .4s;
|
257 |
}
|
258 |
-
|
259 |
.icwp-toggle-switch .slider:before {
|
260 |
position: absolute;
|
261 |
content: "";
|
@@ -267,25 +260,20 @@ tr.icwp-plugin-vulnerability dd {
|
|
267 |
-webkit-transition: .4s;
|
268 |
transition: .4s;
|
269 |
}
|
270 |
-
|
271 |
.icwp-toggle-switch input:checked + .slider {
|
272 |
background-color: #65bd84;
|
273 |
}
|
274 |
-
|
275 |
.icwp-toggle-switch.disabled input + .slider {
|
276 |
background-color: #bd7429;
|
277 |
}
|
278 |
-
|
279 |
.icwp-toggle-switch input:focus + .slider {
|
280 |
box-shadow: 0 0 1px #65bd84;
|
281 |
}
|
282 |
-
|
283 |
.icwp-toggle-switch input:checked + .slider:before {
|
284 |
-webkit-transform: translateX(26px);
|
285 |
-ms-transform: translateX(26px);
|
286 |
transform: translateX(26px);
|
287 |
}
|
288 |
-
|
289 |
.icwp-growl-notice {
|
290 |
-webkit-transition: width 1.5s;
|
291 |
transition: width 1.5s;
|
@@ -302,10 +290,10 @@ tr.icwp-plugin-vulnerability dd {
|
|
302 |
position: fixed;
|
303 |
bottom: 0;
|
304 |
line-height: 22px;
|
305 |
-
box-shadow: 1px 2px 6px rgba(0,0,0,0.6);
|
306 |
z-index: 100000;
|
307 |
opacity: 0.94;
|
308 |
-
text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
|
309 |
}
|
310 |
.icwp-growl-notice.shown {
|
311 |
padding: 23px 20px;
|
@@ -327,18 +315,17 @@ tr.icwp-plugin-vulnerability dd {
|
|
327 |
.icwp-growl-notice.success {
|
328 |
background: #008a00; /* Old browsers */
|
329 |
background: -moz-linear-gradient(45deg, #008a00 0%, #005700 91%, #004200 100%); /* FF3.6-15 */
|
330 |
-
background: -webkit-linear-gradient(45deg, #008a00 0
|
331 |
-
background: linear-gradient(45deg, #008a00 0
|
332 |
-
filter: progid:DXImageTransform.Microsoft.gradient(
|
333 |
}
|
334 |
.icwp-growl-notice.failed {
|
335 |
background: #a90329; /* Old browsers */
|
336 |
background: -moz-linear-gradient(45deg, #a90329 0%, #8f0222 44%, #6d0019 100%); /* FF3.6-15 */
|
337 |
-
background: -webkit-linear-gradient(45deg, #a90329 0
|
338 |
-
background: linear-gradient(45deg, #a90329 0
|
339 |
-
filter: progid:DXImageTransform.Microsoft.gradient(
|
340 |
}
|
341 |
-
|
342 |
#icwp-fade-wrapper {
|
343 |
display: none;
|
344 |
position: fixed;
|
@@ -346,10 +333,9 @@ tr.icwp-plugin-vulnerability dd {
|
|
346 |
width: 100vw;
|
347 |
top: 0;
|
348 |
left: 0;
|
349 |
-
background: rgba(0, 0, 0, 0.
|
350 |
z-index: 999999;
|
351 |
}
|
352 |
-
|
353 |
.icwp-waiting {
|
354 |
width: 200px;
|
355 |
height: 200px;
|
@@ -360,8 +346,7 @@ tr.icwp-plugin-vulnerability dd {
|
|
360 |
background: url("https://media.giphy.com/media/sxJ1nCeUoNSfe/giphy.gif") no-repeat 0 0 transparent;
|
361 |
background-size: 40px;
|
362 |
}
|
363 |
-
|
364 |
-
.icwpAjaxTableContainer .tablenav {
|
365 |
padding: 5px 8px 5px 3px;
|
366 |
}
|
367 |
.icwpAjaxTableContainer .row-fluid .tablenav-pages [class*="span"] {
|
@@ -383,7 +368,6 @@ tr.icwp-plugin-vulnerability dd {
|
|
383 |
.icwpAjaxTableContainer .tablenav-pages a:hover {
|
384 |
text-decoration: none;
|
385 |
}
|
386 |
-
|
387 |
.icwpAjaxTableContainer table {
|
388 |
border-left: 1px solid transparent;
|
389 |
border-right: 1px solid transparent;
|
8 |
border-right-width: 5px;
|
9 |
border-left-width: 5px;
|
10 |
}
|
|
|
11 |
#wpbody-content .icwp-admin-notice,
|
12 |
#wpbody-content .icwp-admin-notice p {
|
13 |
+
text-shadow: -1px -1px 0 rgba(255, 255, 255, 0.4);
|
14 |
}
|
15 |
#wpbody-content .icwp-admin-notice.updated,
|
16 |
#wpbody-content .icwp-admin-notice.updated p {
|
17 |
+
color: rgba(26, 111, 0, 1);
|
18 |
}
|
19 |
#wpbody-content .icwp-admin-notice form {
|
20 |
margin: 0;
|
25 |
#wpbody-content .icwp-admin-notice .button:hover {
|
26 |
text-decoration: none;
|
27 |
}
|
|
|
28 |
#wpbody-content .icwp-admin-notice .notice-dismiss::before {
|
29 |
color: rgba(0, 0, 0, 0.5);
|
30 |
font-size: 24px;
|
31 |
line-height: 21px;
|
32 |
padding-right: 4px;
|
33 |
}
|
|
|
34 |
#wpbody-content .info.icwp-admin-notice,
|
35 |
#wpbody-content .promo.icwp-admin-notice {
|
36 |
+
background-color: rgba(199, 226, 239, 0.25);
|
37 |
+
border-color: rgba(108, 138, 150, 0.99);
|
38 |
}
|
39 |
#wpbody-content .info.icwp-admin-notice,
|
40 |
#wpbody-content .info.icwp-admin-notice p,
|
42 |
#wpbody-content .promo.icwp-admin-notice p {
|
43 |
color: rgba(21, 77, 111, 0.99);
|
44 |
}
|
|
|
45 |
#wpbody-content .error.icwp-admin-notice {
|
46 |
border-color: rgba(240, 51, 4, 0.56);
|
47 |
background-color: rgba(255, 185, 167, 0.25);
|
49 |
#wpbody-content .error.icwp-admin-notice h3 {
|
50 |
color: rgba(199, 41, 0, 1);
|
51 |
}
|
52 |
+
#wpbody-content .icwp-admin-notice .dismiss-p {
|
53 |
+
float: right;
|
54 |
+
position: relative;
|
55 |
+
bottom: 24px;
|
56 |
+
margin: 0;
|
57 |
+
}
|
58 |
+
#wpbody-content .icwp-admin-notice .dismiss-p,
|
59 |
+
#wpbody-content .icwp-admin-notice .dismiss-p a {
|
60 |
+
color: rgb(103, 21, 0);
|
61 |
+
text-align: right;
|
62 |
+
}
|
63 |
ul.nav-tabs li a {
|
64 |
color: rgba(69, 119, 0, 1);
|
65 |
}
|
66 |
ul.nav-tabs li.active a {
|
67 |
color: #000000;
|
68 |
}
|
|
|
69 |
.bootstrap-wpadmin .form-horizontal .form-actions {
|
70 |
+
background-color: rgba(0, 0, 0, 0.07);
|
71 |
+
border: 1px solid #dddddd;
|
72 |
border-top: 1px solid transparent;
|
73 |
}
|
|
|
74 |
.bootstrap-wpadmin .icwpTopLevelRow {
|
75 |
}
|
76 |
.bootstrap-wpadmin .icwpTopLevelRow .icwpTopLevelSpan {
|
77 |
margin-left: 0;
|
78 |
}
|
|
|
79 |
#icwpOptionsTopPill {
|
80 |
}
|
81 |
#icwpOptionsTopPill > .nav-pills {
|
82 |
+
border-bottom: 1px dashed #999999;
|
83 |
padding-bottom: 10px;
|
84 |
}
|
85 |
#icwpOptionsTopPill > .nav-pills li {
|
88 |
#icwpOptionsTopPill > .nav-pills li a {
|
89 |
background-color: rgba(0, 0, 0, 0.2);
|
90 |
text-shadow: 1px 0 0 rgba(255, 255, 255, 0.4);
|
91 |
+
color: #666666;
|
92 |
height: 50px;
|
93 |
}
|
94 |
#icwpOptionsTopPill > .nav-pills li a:hover {
|
107 |
#icwpOptionsTopPill > .nav-pills li.active a {
|
108 |
background-color: rgba(69, 119, 0, 1);
|
109 |
color: #ffffff;
|
110 |
+
text-shadow: 1px 0 0 rgba(0, 0, 0, 0.5);
|
111 |
}
|
112 |
#icwpOptionsTopPill > .nav-pills li a .title {
|
113 |
font-weight: bolder;
|
139 |
font-size: 14px;
|
140 |
}
|
141 |
#icwpOptionsTopPill .content-help dt {
|
142 |
+
border-bottom: 1px dotted rgba(0, 0, 0, 0.2);
|
143 |
font-size: 16px;
|
144 |
margin-bottom: 7px;
|
145 |
padding-bottom: 3px;
|
148 |
margin-bottom: 15px;
|
149 |
margin-left: 12px;
|
150 |
}
|
|
|
151 |
th.column-icwp_autoupdate, td.icwp_autoupdate, th#icwp_autoupdate {
|
152 |
text-align: center;
|
153 |
vertical-align: middle;
|
158 |
td.icwp_autoupdate span.icwp-pluginautoupdateicon.dashicons-hammer {
|
159 |
color: #87492e;
|
160 |
}
|
|
|
161 |
body.plugins-php .wrap > ul li.vulnerable a {
|
162 |
color: darkred;
|
163 |
}
|
|
|
164 |
tr.icwp-plugin-vulnerability > td {
|
165 |
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#fff4f4+0,f7e3e3+100 */
|
166 |
background: #fff4f4; /* Old browsers */
|
167 |
background: -moz-linear-gradient(top, #fff4f4 0%, #f7e3e3 100%); /* FF3.6-15 */
|
168 |
+
background: -webkit-linear-gradient(top, #fff4f4 0%, #f7e3e3 100%); /* Chrome10-25,Safari5.1-6 */
|
169 |
+
background: linear-gradient(to bottom, #fff4f4 0%, #f7e3e3 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
170 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff4f4', endColorstr='#f7e3e3', GradientType=0); /* IE6-9 */
|
171 |
|
172 |
padding: 12px 40px;
|
173 |
+
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .1);
|
174 |
}
|
175 |
tr.icwp-plugin-vulnerability > td table {
|
176 |
width: 100%;
|
177 |
}
|
178 |
tr.icwp-plugin-vulnerability > td table th {
|
179 |
+
color: #444444;
|
180 |
font-weight: bolder;
|
181 |
}
|
182 |
tr.icwp-plugin-vulnerability a {
|
189 |
tr.icwp-plugin-vulnerability dd {
|
190 |
margin-bottom: 3px;
|
191 |
}
|
|
|
192 |
.restricted-option {
|
193 |
background-color: rgba(255, 255, 255, 0.6);
|
194 |
border: 1px solid;
|
200 |
margin: 2px 0 4px;
|
201 |
padding: 7px 8px 5px 6px;
|
202 |
}
|
|
|
203 |
.shield-user-options-block {
|
204 |
}
|
205 |
.shield-user-options-block table {
|
209 |
letter-spacing: 5px;
|
210 |
font-family: monospace;
|
211 |
font-size: 24px;
|
212 |
+
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
|
213 |
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
214 |
padding: 0 7px;
|
215 |
background-color: whitesmoke;
|
216 |
}
|
|
|
217 |
.wp-submenu-wrap a .icwp_highlighted {
|
218 |
color: yellow;
|
219 |
}
|
|
|
220 |
#icwp-wpsf-dashboard_widget {
|
221 |
}
|
222 |
#tableShieldStatisticsWidget {
|
225 |
padding: 5px 10px;
|
226 |
width: 100%;
|
227 |
}
|
|
|
|
|
228 |
.icwp-toggle-switch {
|
229 |
position: relative;
|
230 |
display: inline-block;
|
231 |
width: 60px;
|
232 |
height: 34px;
|
233 |
}
|
|
|
234 |
/* Hide default HTML checkbox */
|
235 |
+
.icwp-toggle-switch input {
|
236 |
+
display: none;
|
237 |
+
}
|
238 |
/* The slider */
|
239 |
.icwp-toggle-switch {
|
240 |
cursor: pointer;
|
249 |
-webkit-transition: .4s;
|
250 |
transition: .4s;
|
251 |
}
|
|
|
252 |
.icwp-toggle-switch .slider:before {
|
253 |
position: absolute;
|
254 |
content: "";
|
260 |
-webkit-transition: .4s;
|
261 |
transition: .4s;
|
262 |
}
|
|
|
263 |
.icwp-toggle-switch input:checked + .slider {
|
264 |
background-color: #65bd84;
|
265 |
}
|
|
|
266 |
.icwp-toggle-switch.disabled input + .slider {
|
267 |
background-color: #bd7429;
|
268 |
}
|
|
|
269 |
.icwp-toggle-switch input:focus + .slider {
|
270 |
box-shadow: 0 0 1px #65bd84;
|
271 |
}
|
|
|
272 |
.icwp-toggle-switch input:checked + .slider:before {
|
273 |
-webkit-transform: translateX(26px);
|
274 |
-ms-transform: translateX(26px);
|
275 |
transform: translateX(26px);
|
276 |
}
|
|
|
277 |
.icwp-growl-notice {
|
278 |
-webkit-transition: width 1.5s;
|
279 |
transition: width 1.5s;
|
290 |
position: fixed;
|
291 |
bottom: 0;
|
292 |
line-height: 22px;
|
293 |
+
box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.6);
|
294 |
z-index: 100000;
|
295 |
opacity: 0.94;
|
296 |
+
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
|
297 |
}
|
298 |
.icwp-growl-notice.shown {
|
299 |
padding: 23px 20px;
|
315 |
.icwp-growl-notice.success {
|
316 |
background: #008a00; /* Old browsers */
|
317 |
background: -moz-linear-gradient(45deg, #008a00 0%, #005700 91%, #004200 100%); /* FF3.6-15 */
|
318 |
+
background: -webkit-linear-gradient(45deg, #008a00 0%, #005700 91%, #004200 100%); /* Chrome10-25,Safari5.1-6 */
|
319 |
+
background: linear-gradient(45deg, #008a00 0%, #005700 91%, #004200 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
320 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#008a00', endColorstr='#004200', GradientType=1); /* IE6-9 fallback on horizontal gradient */
|
321 |
}
|
322 |
.icwp-growl-notice.failed {
|
323 |
background: #a90329; /* Old browsers */
|
324 |
background: -moz-linear-gradient(45deg, #a90329 0%, #8f0222 44%, #6d0019 100%); /* FF3.6-15 */
|
325 |
+
background: -webkit-linear-gradient(45deg, #a90329 0%, #8f0222 44%, #6d0019 100%); /* Chrome10-25,Safari5.1-6 */
|
326 |
+
background: linear-gradient(45deg, #a90329 0%, #8f0222 44%, #6d0019 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
|
327 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a90329', endColorstr='#6d0019', GradientType=1); /* IE6-9 fallback on horizontal gradient */
|
328 |
}
|
|
|
329 |
#icwp-fade-wrapper {
|
330 |
display: none;
|
331 |
position: fixed;
|
333 |
width: 100vw;
|
334 |
top: 0;
|
335 |
left: 0;
|
336 |
+
background: rgba(0, 0, 0, 0.25);
|
337 |
z-index: 999999;
|
338 |
}
|
|
|
339 |
.icwp-waiting {
|
340 |
width: 200px;
|
341 |
height: 200px;
|
346 |
background: url("https://media.giphy.com/media/sxJ1nCeUoNSfe/giphy.gif") no-repeat 0 0 transparent;
|
347 |
background-size: 40px;
|
348 |
}
|
349 |
+
.icwpAjaxTableContainer .tablenav {
|
|
|
350 |
padding: 5px 8px 5px 3px;
|
351 |
}
|
352 |
.icwpAjaxTableContainer .row-fluid .tablenav-pages [class*="span"] {
|
368 |
.icwpAjaxTableContainer .tablenav-pages a:hover {
|
369 |
text-decoration: none;
|
370 |
}
|
|
|
371 |
.icwpAjaxTableContainer table {
|
372 |
border-left: 1px solid transparent;
|
373 |
border-right: 1px solid transparent;
|
resources/css/jquery.fancybox.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@charset "UTF-8";body.fancybox-active{overflow:hidden}body.fancybox-iosfix{position:fixed;left:0;right:0}.fancybox-is-hidden{position:absolute;top:-9999px;left:-9999px;visibility:hidden}.fancybox-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99992;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-stage{position:absolute;top:0;right:0;bottom:0;left:0}.fancybox-outer{overflow-y:auto;-webkit-overflow-scrolling:touch}.fancybox-bg{background:#1e1e1e;opacity:0;transition-duration:inherit;transition-property:opacity;transition-timing-function:cubic-bezier(.47,0,.74,.71)}.fancybox-is-open .fancybox-bg{opacity:.87;transition-timing-function:cubic-bezier(.22,.61,.36,1)}.fancybox-caption-wrap,.fancybox-infobar,.fancybox-toolbar{position:absolute;direction:ltr;z-index:99997;opacity:0;visibility:hidden;transition:opacity .25s,visibility 0s linear .25s;box-sizing:border-box}.fancybox-show-caption .fancybox-caption-wrap,.fancybox-show-infobar .fancybox-infobar,.fancybox-show-toolbar .fancybox-toolbar{opacity:1;visibility:visible;transition:opacity .25s,visibility 0s}.fancybox-infobar{top:0;left:0;font-size:13px;padding:0 10px;height:44px;min-width:44px;line-height:44px;color:#ccc;text-align:center;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:subpixel-antialiased;mix-blend-mode:exclusion}.fancybox-toolbar{top:0;right:0;margin:0;padding:0}.fancybox-stage{overflow:hidden;direction:ltr;z-index:99994;-webkit-transform:translateZ(0)}.fancybox-is-closing .fancybox-stage{overflow:visible}.fancybox-slide{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;overflow:auto;outline:none;white-space:normal;box-sizing:border-box;text-align:center;z-index:99994;-webkit-overflow-scrolling:touch;display:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform}.fancybox-slide:before{content:"";display:inline-block;vertical-align:middle;height:100%;width:0}.fancybox-is-sliding .fancybox-slide,.fancybox-slide--current,.fancybox-slide--next,.fancybox-slide--previous{display:block}.fancybox-slide--image{overflow:visible}.fancybox-slide--image:before{display:none}.fancybox-slide--video .fancybox-content,.fancybox-slide--video iframe{background:#000}.fancybox-slide--map .fancybox-content,.fancybox-slide--map iframe{background:#e5e3df}.fancybox-slide--next{z-index:99995}.fancybox-slide>*{display:inline-block;position:relative;padding:24px;margin:44px 0;border-width:0;vertical-align:middle;text-align:left;background-color:#fff;overflow:auto;box-sizing:border-box}.fancybox-slide>base,.fancybox-slide>link,.fancybox-slide>meta,.fancybox-slide>script,.fancybox-slide>style,.fancybox-slide>title{display:none}.fancybox-slide .fancybox-image-wrap{position:absolute;top:0;left:0;margin:0;padding:0;border:0;z-index:99995;background:transparent;cursor:default;overflow:visible;-webkit-transform-origin:top left;transform-origin:top left;background-size:100% 100%;background-repeat:no-repeat;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform}.fancybox-can-zoomOut .fancybox-image-wrap{cursor:zoom-out}.fancybox-can-zoomIn .fancybox-image-wrap{cursor:zoom-in}.fancybox-can-drag .fancybox-image-wrap{cursor:-webkit-grab;cursor:grab}.fancybox-is-dragging .fancybox-image-wrap{cursor:-webkit-grabbing;cursor:grabbing}.fancybox-image,.fancybox-spaceball{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;border:0;max-width:none;max-height:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fancybox-spaceball{z-index:1}.fancybox-slide--iframe .fancybox-content{padding:0;width:80%;height:80%;max-width:calc(100% - 100px);max-height:calc(100% - 88px);overflow:visible;background:#fff}.fancybox-iframe{display:block;padding:0;border:0;height:100%}.fancybox-error,.fancybox-iframe{margin:0;width:100%;background:#fff}.fancybox-error{padding:40px;max-width:380px;cursor:default}.fancybox-error p{margin:0;padding:0;color:#444;font-size:16px;line-height:20px}.fancybox-button{box-sizing:border-box;display:inline-block;vertical-align:top;width:44px;height:44px;margin:0;padding:10px;border:0;border-radius:0;background:rgba(30,30,30,.6);transition:color .3s ease;cursor:pointer;outline:none}.fancybox-button,.fancybox-button:link,.fancybox-button:visited{color:#ccc}.fancybox-button:focus,.fancybox-button:hover{color:#fff}.fancybox-button[disabled]{color:#ccc;cursor:default;opacity:.6}.fancybox-button svg{display:block;position:relative;overflow:visible;shape-rendering:geometricPrecision}.fancybox-button svg path{fill:currentColor;stroke:currentColor;stroke-linejoin:round;stroke-width:3}.fancybox-button--share svg path{stroke-width:1}.fancybox-button--pause svg path:nth-child(1),.fancybox-button--play svg path:nth-child(2){display:none}.fancybox-button--zoom svg path{fill:transparent}.fancybox-navigation{display:none}.fancybox-show-nav .fancybox-navigation{display:block}.fancybox-navigation button{position:absolute;top:50%;margin:-50px 0 0;z-index:99997;background:transparent;width:60px;height:100px;padding:17px}.fancybox-navigation button:before{content:"";position:absolute;top:30px;right:10px;width:40px;height:40px;background:rgba(30,30,30,.6)}.fancybox-navigation .fancybox-button--arrow_left{left:0}.fancybox-navigation .fancybox-button--arrow_right{right:0}.fancybox-close-small{position:absolute;top:0;right:0;width:40px;height:40px;padding:0;margin:0;border:0;border-radius:0;background:transparent;z-index:10;cursor:pointer}.fancybox-close-small:after{content:"×";position:absolute;top:5px;right:5px;width:30px;height:30px;font:22px/30px Arial,Helvetica Neue,Helvetica,sans-serif;color:#888;font-weight:300;text-align:center;border-radius:50%;border-width:0;background-color:transparent;transition:background-color .25s;box-sizing:border-box;z-index:2}.fancybox-close-small:focus{outline:none}.fancybox-close-small:focus:after{outline:1px dotted #888}.fancybox-close-small:hover:after{color:#555;background:#eee}.fancybox-slide--iframe .fancybox-close-small,.fancybox-slide--image .fancybox-close-small{top:0;right:-40px}.fancybox-slide--iframe .fancybox-close-small:after,.fancybox-slide--image .fancybox-close-small:after{font-size:35px;color:#aaa}.fancybox-slide--iframe .fancybox-close-small:hover:after,.fancybox-slide--image .fancybox-close-small:hover:after{color:#fff;background:transparent}.fancybox-is-scaling .fancybox-close-small,.fancybox-is-zoomable.fancybox-can-drag .fancybox-close-small{display:none}.fancybox-caption-wrap{bottom:0;left:0;right:0;padding:60px 2vw 0;background:linear-gradient(180deg,transparent 0,rgba(0,0,0,.1) 20%,rgba(0,0,0,.2) 40%,rgba(0,0,0,.6) 80%,rgba(0,0,0,.8));pointer-events:none}.fancybox-caption{padding:30px 0;border-top:1px solid hsla(0,0%,100%,.4);font-size:14px;color:#fff;line-height:20px;-webkit-text-size-adjust:none}.fancybox-caption a,.fancybox-caption button,.fancybox-caption select{pointer-events:all;position:relative}.fancybox-caption a{color:#fff;text-decoration:underline}.fancybox-slide>.fancybox-loading{border:6px solid hsla(0,0%,39%,.4);border-top:6px solid hsla(0,0%,100%,.6);border-radius:100%;height:50px;width:50px;-webkit-animation:a .8s infinite linear;animation:a .8s infinite linear;background:transparent;position:absolute;top:50%;left:50%;margin-top:-30px;margin-left:-30px;z-index:99999}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fancybox-animated{transition-timing-function:cubic-bezier(0,0,.25,1)}.fancybox-fx-slide.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}.fancybox-fx-slide.fancybox-slide--current{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}.fancybox-fx-fade.fancybox-slide--next,.fancybox-fx-fade.fancybox-slide--previous{opacity:0;transition-timing-function:cubic-bezier(.19,1,.22,1)}.fancybox-fx-fade.fancybox-slide--current{opacity:1}.fancybox-fx-zoom-in-out.fancybox-slide--previous{-webkit-transform:scale3d(1.5,1.5,1.5);transform:scale3d(1.5,1.5,1.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--next{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0}.fancybox-fx-zoom-in-out.fancybox-slide--current{-webkit-transform:scaleX(1);transform:scaleX(1);opacity:1}.fancybox-fx-rotate.fancybox-slide--previous{-webkit-transform:rotate(-1turn);transform:rotate(-1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--next{-webkit-transform:rotate(1turn);transform:rotate(1turn);opacity:0}.fancybox-fx-rotate.fancybox-slide--current{-webkit-transform:rotate(0deg);transform:rotate(0deg);opacity:1}.fancybox-fx-circular.fancybox-slide--previous{-webkit-transform:scale3d(0,0,0) translate3d(-100%,0,0);transform:scale3d(0,0,0) translate3d(-100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--next{-webkit-transform:scale3d(0,0,0) translate3d(100%,0,0);transform:scale3d(0,0,0) translate3d(100%,0,0);opacity:0}.fancybox-fx-circular.fancybox-slide--current{-webkit-transform:scaleX(1) translateZ(0);transform:scaleX(1) translateZ(0);opacity:1}.fancybox-fx-tube.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0) scale(.1) skew(-10deg);transform:translate3d(-100%,0,0) scale(.1) skew(-10deg)}.fancybox-fx-tube.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0) scale(.1) skew(10deg);transform:translate3d(100%,0,0) scale(.1) skew(10deg)}.fancybox-fx-tube.fancybox-slide--current{-webkit-transform:translateZ(0) scale(1);transform:translateZ(0) scale(1)}.fancybox-share{padding:30px;border-radius:3px;background:#f4f4f4;max-width:90%;text-align:center}.fancybox-share h1{color:#222;margin:0 0 20px;font-size:35px;font-weight:700}.fancybox-share p{margin:0;padding:0}p.fancybox-share__links{margin-right:-10px}.fancybox-share__button{display:inline-block;text-decoration:none;margin:0 10px 10px 0;padding:0 15px;min-width:130px;border:0;border-radius:3px;background:#fff;white-space:nowrap;font-size:14px;font-weight:700;line-height:40px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#fff;transition:all .2s}.fancybox-share__button:hover{text-decoration:none}.fancybox-share__button--fb{background:#3b5998}.fancybox-share__button--fb:hover{background:#344e86}.fancybox-share__button--pt{background:#bd081d}.fancybox-share__button--pt:hover{background:#aa0719}.fancybox-share__button--tw{background:#1da1f2}.fancybox-share__button--tw:hover{background:#0d95e8}.fancybox-share__button svg{position:relative;top:-1px;width:25px;height:25px;margin-right:7px;vertical-align:middle}.fancybox-share__button svg path{fill:#fff}.fancybox-share__input{box-sizing:border-box;width:100%;margin:10px 0 0;padding:10px 15px;background:transparent;color:#5d5b5b;font-size:14px;outline:none;border:0;border-bottom:2px solid #d7d7d7}.fancybox-thumbs{display:none;position:absolute;top:0;bottom:0;right:0;width:212px;margin:0;padding:2px 2px 4px;background:#fff;-webkit-tap-highlight-color:transparent;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;box-sizing:border-box;z-index:99995}.fancybox-thumbs-x{overflow-y:hidden;overflow-x:auto}.fancybox-show-thumbs .fancybox-thumbs{display:block}.fancybox-show-thumbs .fancybox-inner{right:212px}.fancybox-thumbs>ul{list-style:none;position:absolute;position:relative;width:100%;height:100%;margin:0;padding:0;overflow-x:hidden;overflow-y:auto;font-size:0;white-space:nowrap}.fancybox-thumbs-x>ul{overflow:hidden}.fancybox-thumbs-y>ul::-webkit-scrollbar{width:7px}.fancybox-thumbs-y>ul::-webkit-scrollbar-track{background:#fff;border-radius:10px;box-shadow:inset 0 0 6px rgba(0,0,0,.3)}.fancybox-thumbs-y>ul::-webkit-scrollbar-thumb{background:#2a2a2a;border-radius:10px}.fancybox-thumbs>ul>li{float:left;overflow:hidden;padding:0;margin:2px;width:100px;height:75px;max-width:calc(50% - 4px);max-height:calc(100% - 8px);position:relative;cursor:pointer;outline:none;-webkit-tap-highlight-color:transparent;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}li.fancybox-thumbs-loading{background:rgba(0,0,0,.1)}.fancybox-thumbs>ul>li>img{position:absolute;top:0;left:0;max-width:none;max-height:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.fancybox-thumbs>ul>li:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border:4px solid #4ea7f9;z-index:99991;opacity:0;transition:all .2s cubic-bezier(.25,.46,.45,.94)}.fancybox-thumbs>ul>li.fancybox-thumbs-active:before{opacity:1}@media (max-width:800px){.fancybox-thumbs{width:110px}.fancybox-show-thumbs .fancybox-inner{right:110px}.fancybox-thumbs>ul>li{max-width:calc(100% - 10px)}}
|
resources/css/jquery.steps.css
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Common
|
3 |
+
*/
|
4 |
+
|
5 |
+
.wizard,
|
6 |
+
.tabcontrol
|
7 |
+
{
|
8 |
+
display: block;
|
9 |
+
width: 100%;
|
10 |
+
overflow: hidden;
|
11 |
+
}
|
12 |
+
|
13 |
+
.wizard a,
|
14 |
+
.tabcontrol a
|
15 |
+
{
|
16 |
+
outline: 0;
|
17 |
+
}
|
18 |
+
|
19 |
+
.wizard ul,
|
20 |
+
.tabcontrol ul
|
21 |
+
{
|
22 |
+
list-style: none;
|
23 |
+
padding: 0;
|
24 |
+
margin: 0;
|
25 |
+
}
|
26 |
+
|
27 |
+
.wizard ul > li,
|
28 |
+
.tabcontrol ul > li
|
29 |
+
{
|
30 |
+
display: block;
|
31 |
+
padding: 0;
|
32 |
+
}
|
33 |
+
|
34 |
+
/* Accessibility */
|
35 |
+
.wizard > .steps .current-info,
|
36 |
+
.tabcontrol > .steps .current-info
|
37 |
+
{
|
38 |
+
position: absolute;
|
39 |
+
left: -999em;
|
40 |
+
}
|
41 |
+
|
42 |
+
.wizard > .content > .title,
|
43 |
+
.tabcontrol > .content > .title
|
44 |
+
{
|
45 |
+
position: absolute;
|
46 |
+
left: -999em;
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
/*
|
52 |
+
Wizard
|
53 |
+
*/
|
54 |
+
|
55 |
+
.wizard > .steps
|
56 |
+
{
|
57 |
+
position: relative;
|
58 |
+
display: block;
|
59 |
+
width: 100%;
|
60 |
+
}
|
61 |
+
|
62 |
+
.wizard.vertical > .steps
|
63 |
+
{
|
64 |
+
display: inline;
|
65 |
+
float: left;
|
66 |
+
width: 30%;
|
67 |
+
}
|
68 |
+
|
69 |
+
.wizard > .steps .number
|
70 |
+
{
|
71 |
+
font-size: 1.429em;
|
72 |
+
}
|
73 |
+
|
74 |
+
.wizard > .steps > ul > li
|
75 |
+
{
|
76 |
+
width: 25%;
|
77 |
+
}
|
78 |
+
|
79 |
+
.wizard > .steps > ul > li,
|
80 |
+
.wizard > .actions > ul > li
|
81 |
+
{
|
82 |
+
float: left;
|
83 |
+
}
|
84 |
+
|
85 |
+
.wizard.vertical > .steps > ul > li
|
86 |
+
{
|
87 |
+
float: none;
|
88 |
+
width: 100%;
|
89 |
+
}
|
90 |
+
|
91 |
+
.wizard > .steps a,
|
92 |
+
.wizard > .steps a:hover,
|
93 |
+
.wizard > .steps a:active
|
94 |
+
{
|
95 |
+
display: block;
|
96 |
+
width: auto;
|
97 |
+
margin: 0 0.5em 0.5em;
|
98 |
+
padding: 1em 1em;
|
99 |
+
text-decoration: none;
|
100 |
+
|
101 |
+
-webkit-border-radius: 5px;
|
102 |
+
-moz-border-radius: 5px;
|
103 |
+
border-radius: 5px;
|
104 |
+
}
|
105 |
+
|
106 |
+
.wizard > .steps .disabled a,
|
107 |
+
.wizard > .steps .disabled a:hover,
|
108 |
+
.wizard > .steps .disabled a:active
|
109 |
+
{
|
110 |
+
background: #eee;
|
111 |
+
color: #aaa;
|
112 |
+
cursor: default;
|
113 |
+
}
|
114 |
+
|
115 |
+
.wizard > .steps .current a,
|
116 |
+
.wizard > .steps .current a:hover,
|
117 |
+
.wizard > .steps .current a:active
|
118 |
+
{
|
119 |
+
background: rgba(69, 119, 0, 1);
|
120 |
+
color: #fff;
|
121 |
+
cursor: default;
|
122 |
+
}
|
123 |
+
|
124 |
+
.wizard > .steps .done a,
|
125 |
+
.wizard > .steps .done a:hover,
|
126 |
+
.wizard > .steps .done a:active
|
127 |
+
{
|
128 |
+
background: rgba(69, 119, 0, 0.5);
|
129 |
+
color: #fff;
|
130 |
+
}
|
131 |
+
|
132 |
+
.wizard > .steps .error a,
|
133 |
+
.wizard > .steps .error a:hover,
|
134 |
+
.wizard > .steps .error a:active
|
135 |
+
{
|
136 |
+
background: #ff3111;
|
137 |
+
color: #fff;
|
138 |
+
}
|
139 |
+
|
140 |
+
.wizard > .content
|
141 |
+
{
|
142 |
+
background: transparent;
|
143 |
+
display: block;
|
144 |
+
margin: 0.5em;
|
145 |
+
min-height: 35em;
|
146 |
+
overflow: hidden;
|
147 |
+
position: relative;
|
148 |
+
width: auto;
|
149 |
+
|
150 |
+
-webkit-border-radius: 5px;
|
151 |
+
-moz-border-radius: 5px;
|
152 |
+
border-radius: 5px;
|
153 |
+
border: 1px solid transparent;
|
154 |
+
}
|
155 |
+
|
156 |
+
.wizard.vertical > .content
|
157 |
+
{
|
158 |
+
display: inline;
|
159 |
+
float: left;
|
160 |
+
margin: 0 2.5% 0.5em 2.5%;
|
161 |
+
width: 65%;
|
162 |
+
}
|
163 |
+
|
164 |
+
.wizard > .content > .body
|
165 |
+
{
|
166 |
+
float: left;
|
167 |
+
position: absolute;
|
168 |
+
width: 95%;
|
169 |
+
height: 95%;
|
170 |
+
padding: 2.5%;
|
171 |
+
}
|
172 |
+
|
173 |
+
.wizard > .content > .body ul
|
174 |
+
{
|
175 |
+
list-style: disc ;
|
176 |
+
}
|
177 |
+
|
178 |
+
.wizard > .content > .body ul > li
|
179 |
+
{
|
180 |
+
display: list-item;
|
181 |
+
}
|
182 |
+
|
183 |
+
.wizard > .content > .body > iframe
|
184 |
+
{
|
185 |
+
border: 0 none;
|
186 |
+
width: 100%;
|
187 |
+
height: 100%;
|
188 |
+
}
|
189 |
+
|
190 |
+
.wizard > .content > .body input
|
191 |
+
{
|
192 |
+
/*display: block;*/
|
193 |
+
/*border: 1px solid #ccc;*/
|
194 |
+
}
|
195 |
+
|
196 |
+
.wizard > .content > .body input[type="checkbox"]
|
197 |
+
{
|
198 |
+
display: inline-block;
|
199 |
+
}
|
200 |
+
|
201 |
+
.wizard > .content > .body input.error
|
202 |
+
{
|
203 |
+
background: rgb(251, 227, 228);
|
204 |
+
border: 1px solid #fbc2c4;
|
205 |
+
color: #8a1f11;
|
206 |
+
}
|
207 |
+
|
208 |
+
.wizard > .content > .body label
|
209 |
+
{
|
210 |
+
/*display: inline-block;*/
|
211 |
+
/*margin-bottom: 0.5em;*/
|
212 |
+
}
|
213 |
+
|
214 |
+
.wizard > .content > .body label.error
|
215 |
+
{
|
216 |
+
color: #8a1f11;
|
217 |
+
display: inline-block;
|
218 |
+
margin-left: 1.5em;
|
219 |
+
}
|
220 |
+
|
221 |
+
.wizard > .actions
|
222 |
+
{
|
223 |
+
position: relative;
|
224 |
+
display: block;
|
225 |
+
text-align: right;
|
226 |
+
width: 100%;
|
227 |
+
}
|
228 |
+
|
229 |
+
.wizard.vertical > .actions
|
230 |
+
{
|
231 |
+
display: inline;
|
232 |
+
float: right;
|
233 |
+
margin: 0 2.5%;
|
234 |
+
width: 95%;
|
235 |
+
}
|
236 |
+
|
237 |
+
.wizard > .actions > ul
|
238 |
+
{
|
239 |
+
display: inline-block;
|
240 |
+
text-align: right;
|
241 |
+
}
|
242 |
+
|
243 |
+
.wizard > .actions > ul > li
|
244 |
+
{
|
245 |
+
margin: 0 0.5em;
|
246 |
+
}
|
247 |
+
|
248 |
+
.wizard.vertical > .actions > ul > li
|
249 |
+
{
|
250 |
+
margin: 0 0 0 1em;
|
251 |
+
}
|
252 |
+
|
253 |
+
.wizard > .actions a,
|
254 |
+
.wizard > .actions a:hover,
|
255 |
+
.wizard > .actions a:active
|
256 |
+
{
|
257 |
+
background: rgba(69, 119, 0, 1);
|
258 |
+
color: #fff;
|
259 |
+
display: block;
|
260 |
+
padding: 0.5em 1em;
|
261 |
+
text-decoration: none;
|
262 |
+
|
263 |
+
-webkit-border-radius: 5px;
|
264 |
+
-moz-border-radius: 5px;
|
265 |
+
border-radius: 5px;
|
266 |
+
}
|
267 |
+
|
268 |
+
.wizard > .actions .disabled a,
|
269 |
+
.wizard > .actions .disabled a:hover,
|
270 |
+
.wizard > .actions .disabled a:active
|
271 |
+
{
|
272 |
+
background: #eee;
|
273 |
+
color: #aaa;
|
274 |
+
}
|
275 |
+
|
276 |
+
.wizard > .loading
|
277 |
+
{
|
278 |
+
}
|
279 |
+
|
280 |
+
.wizard > .loading .spinner
|
281 |
+
{
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
|
286 |
+
/*
|
287 |
+
Tabcontrol
|
288 |
+
*/
|
289 |
+
|
290 |
+
.tabcontrol > .steps
|
291 |
+
{
|
292 |
+
position: relative;
|
293 |
+
display: block;
|
294 |
+
width: 100%;
|
295 |
+
}
|
296 |
+
|
297 |
+
.tabcontrol > .steps > ul
|
298 |
+
{
|
299 |
+
position: relative;
|
300 |
+
margin: 6px 0 0 0;
|
301 |
+
top: 1px;
|
302 |
+
z-index: 1;
|
303 |
+
}
|
304 |
+
|
305 |
+
.tabcontrol > .steps > ul > li
|
306 |
+
{
|
307 |
+
float: left;
|
308 |
+
margin: 5px 2px 0 0;
|
309 |
+
padding: 1px;
|
310 |
+
|
311 |
+
-webkit-border-top-left-radius: 5px;
|
312 |
+
-webkit-border-top-right-radius: 5px;
|
313 |
+
-moz-border-radius-topleft: 5px;
|
314 |
+
-moz-border-radius-topright: 5px;
|
315 |
+
border-top-left-radius: 5px;
|
316 |
+
border-top-right-radius: 5px;
|
317 |
+
}
|
318 |
+
|
319 |
+
.tabcontrol > .steps > ul > li:hover
|
320 |
+
{
|
321 |
+
background: #edecec;
|
322 |
+
border: 1px solid #bbb;
|
323 |
+
padding: 0;
|
324 |
+
}
|
325 |
+
|
326 |
+
.tabcontrol > .steps > ul > li.current
|
327 |
+
{
|
328 |
+
background: #fff;
|
329 |
+
border: 1px solid #bbb;
|
330 |
+
border-bottom: 0 none;
|
331 |
+
padding: 0 0 1px 0;
|
332 |
+
margin-top: 0;
|
333 |
+
}
|
334 |
+
|
335 |
+
.tabcontrol > .steps > ul > li > a
|
336 |
+
{
|
337 |
+
color: #5f5f5f;
|
338 |
+
display: inline-block;
|
339 |
+
border: 0 none;
|
340 |
+
margin: 0;
|
341 |
+
padding: 10px 30px;
|
342 |
+
text-decoration: none;
|
343 |
+
}
|
344 |
+
|
345 |
+
.tabcontrol > .steps > ul > li > a:hover
|
346 |
+
{
|
347 |
+
text-decoration: none;
|
348 |
+
}
|
349 |
+
|
350 |
+
.tabcontrol > .steps > ul > li.current > a
|
351 |
+
{
|
352 |
+
padding: 15px 30px 10px 30px;
|
353 |
+
}
|
354 |
+
|
355 |
+
.tabcontrol > .content
|
356 |
+
{
|
357 |
+
position: relative;
|
358 |
+
display: inline-block;
|
359 |
+
width: 100%;
|
360 |
+
height: 35em;
|
361 |
+
overflow: hidden;
|
362 |
+
border-top: 1px solid #bbb;
|
363 |
+
padding-top: 20px;
|
364 |
+
}
|
365 |
+
|
366 |
+
.tabcontrol > .content > .body
|
367 |
+
{
|
368 |
+
float: left;
|
369 |
+
position: absolute;
|
370 |
+
width: 95%;
|
371 |
+
height: 95%;
|
372 |
+
padding: 2.5%;
|
373 |
+
}
|
374 |
+
|
375 |
+
.tabcontrol > .content > .body ul
|
376 |
+
{
|
377 |
+
list-style: disc !important;
|
378 |
+
}
|
379 |
+
|
380 |
+
.tabcontrol > .content > .body ul > li
|
381 |
+
{
|
382 |
+
display: list-item;
|
383 |
+
}
|
resources/css/pages.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body {
|
2 |
+
background: #fafafa;
|
3 |
+
color: #555;
|
4 |
+
}
|
5 |
+
|
6 |
+
#ShieldLogo {
|
7 |
+
padding: 40px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.wizard > .content {
|
11 |
+
background: #ffffff;
|
12 |
+
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
|
13 |
+
}
|
resources/css/plugin.css
CHANGED
@@ -7,6 +7,9 @@
|
|
7 |
.bootstrap-wpadmin .row {
|
8 |
margin-left: 0;
|
9 |
}
|
|
|
|
|
|
|
10 |
#pluginlogo_32 {
|
11 |
background: url("../images/pluginlogo_32x32.png?ver=1.0.0") no-repeat 0 3px transparent;
|
12 |
}
|
@@ -96,7 +99,7 @@ table.table-audit_trail .cell-ip {
|
|
96 |
.bootstrap-wpadmin .page-header {
|
97 |
padding-bottom: 17px;
|
98 |
margin: 18px 0 0;
|
99 |
-
border-bottom: 1px solid
|
100 |
}
|
101 |
/* Form elements */
|
102 |
.bootstrap-wpadmin form fieldset {
|
@@ -330,15 +333,15 @@ label input[type=checkbox] {
|
|
330 |
|
331 |
/** FEature summaries **/
|
332 |
.bootstrap-wpadmin .feature-summary-blocks {
|
333 |
-
border: 1px solid transparent;
|
334 |
-
border-left: 1px solid #ddd;
|
335 |
text-align: center;
|
336 |
-
width:
|
|
|
|
|
337 |
}
|
338 |
.feature-summary-blocks .feature-icon:before {
|
339 |
-webkit-font-smoothing: antialiased;
|
340 |
display: inline-block;
|
341 |
-
font:
|
342 |
vertical-align: top;
|
343 |
}
|
344 |
.feature-summary-blocks a {
|
@@ -346,12 +349,6 @@ label input[type=checkbox] {
|
|
346 |
text-shadow: 1px 0 0 rgba(0, 0, 0, 0.4);
|
347 |
width: 100%;
|
348 |
}
|
349 |
-
.feature-summary-blocks .feature-icon:before {
|
350 |
-
-webkit-font-smoothing: antialiased;
|
351 |
-
display: inline-block;
|
352 |
-
font: 48px/1 'dashicons';
|
353 |
-
vertical-align: top;
|
354 |
-
}
|
355 |
|
356 |
.feature-summary-blocks .summary-state {
|
357 |
border: 1px solid transparent;
|
@@ -359,7 +356,27 @@ label input[type=checkbox] {
|
|
359 |
text-align: center;
|
360 |
margin-bottom: -1px;
|
361 |
}
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
.feature-summary-blocks .summary-state:hover {
|
364 |
border: 1px solid rgba(0, 0, 0, 0.1);
|
365 |
border-left: 1px solid transparent;
|
@@ -383,7 +400,7 @@ label input[type=checkbox] {
|
|
383 |
font-size: 8px;
|
384 |
}
|
385 |
.feature-summary-blocks .feature-icon:before {
|
386 |
-
font-size:
|
387 |
}
|
388 |
}
|
389 |
.feature-summary-blocks .state-on a {
|
@@ -459,4 +476,4 @@ input[type="email"] {
|
|
459 |
}
|
460 |
.bootstrap-wpadmin .row .shield-free-block p {
|
461 |
margin-bottom: 18px;
|
462 |
-
}
|
7 |
.bootstrap-wpadmin .row {
|
8 |
margin-left: 0;
|
9 |
}
|
10 |
+
.bootstrap-wpadmin > .row > div[class*=span]:first-child {
|
11 |
+
margin-left: 0;
|
12 |
+
}
|
13 |
#pluginlogo_32 {
|
14 |
background: url("../images/pluginlogo_32x32.png?ver=1.0.0") no-repeat 0 3px transparent;
|
15 |
}
|
99 |
.bootstrap-wpadmin .page-header {
|
100 |
padding-bottom: 17px;
|
101 |
margin: 18px 0 0;
|
102 |
+
border-bottom: 1px solid transparent;
|
103 |
}
|
104 |
/* Form elements */
|
105 |
.bootstrap-wpadmin form fieldset {
|
333 |
|
334 |
/** FEature summaries **/
|
335 |
.bootstrap-wpadmin .feature-summary-blocks {
|
|
|
|
|
336 |
text-align: center;
|
337 |
+
width: 100%;
|
338 |
+
margin-top: 20px;
|
339 |
+
box-shadow: 3px 3px 6px 0 rgba(0,0,0,0.3);
|
340 |
}
|
341 |
.feature-summary-blocks .feature-icon:before {
|
342 |
-webkit-font-smoothing: antialiased;
|
343 |
display: inline-block;
|
344 |
+
font: 32px/1 'dashicons';
|
345 |
vertical-align: top;
|
346 |
}
|
347 |
.feature-summary-blocks a {
|
349 |
text-shadow: 1px 0 0 rgba(0, 0, 0, 0.4);
|
350 |
width: 100%;
|
351 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
|
353 |
.feature-summary-blocks .summary-state {
|
354 |
border: 1px solid transparent;
|
356 |
text-align: center;
|
357 |
margin-bottom: -1px;
|
358 |
}
|
359 |
+
|
360 |
+
.feature-summary-blocks .summary-state.active-feature {
|
361 |
+
background-color: rgba(69, 119, 0, 1);
|
362 |
+
}
|
363 |
+
.feature-summary-blocks .summary-state.active-feature a {
|
364 |
+
color: rgba(255,255,255,1);
|
365 |
+
}
|
366 |
+
.feature-summary-blocks .summary-state.active-feature.state-off {
|
367 |
+
background-color: rgba( 173, 84, 0, 0.85 );
|
368 |
+
}
|
369 |
+
.feature-summary-blocks .summary-state .popover {
|
370 |
+
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
|
371 |
+
padding: 0;
|
372 |
+
border-radius: 1px;
|
373 |
+
text-align: left;
|
374 |
+
width: 200px;
|
375 |
+
}
|
376 |
+
.feature-summary-blocks .summary-state .popover .arrow {
|
377 |
+
display: none;
|
378 |
+
}
|
379 |
+
.feature-summary-blocks .summary-state.active-feature.state-off:hover,
|
380 |
.feature-summary-blocks .summary-state:hover {
|
381 |
border: 1px solid rgba(0, 0, 0, 0.1);
|
382 |
border-left: 1px solid transparent;
|
400 |
font-size: 8px;
|
401 |
}
|
402 |
.feature-summary-blocks .feature-icon:before {
|
403 |
+
font-size: 16px;
|
404 |
}
|
405 |
}
|
406 |
.feature-summary-blocks .state-on a {
|
476 |
}
|
477 |
.bootstrap-wpadmin .row .shield-free-block p {
|
478 |
margin-bottom: 18px;
|
479 |
+
}
|
resources/css/wizard.css
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
html {
|
2 |
+
overflow-y: scroll;
|
3 |
+
}
|
4 |
+
body {
|
5 |
+
padding-bottom: 200px;
|
6 |
+
}
|
7 |
+
body.wait {
|
8 |
+
cursor: wait !important;
|
9 |
+
}
|
10 |
+
.wizard > .content {
|
11 |
+
background: #ffffff;
|
12 |
+
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
|
13 |
+
}
|
14 |
+
.wizard.vertical > .steps {
|
15 |
+
width: 20%; /** from 30 **/
|
16 |
+
}
|
17 |
+
.wizard.vertical > .content {
|
18 |
+
width: 75%; /** from 65 **/
|
19 |
+
}
|
20 |
+
.wizard > .content > .body {
|
21 |
+
height: auto;
|
22 |
+
position: relative;
|
23 |
+
padding: 0;
|
24 |
+
width: 100%
|
25 |
+
}
|
26 |
+
.wizard > .content > .body .slide-header {
|
27 |
+
padding: 3% 3% 0 3%;
|
28 |
+
}
|
29 |
+
.wizard > .content > .body .slide-header .btn-block {
|
30 |
+
margin-bottom: -1px;
|
31 |
+
}
|
32 |
+
.wizard > .content > .body .slide-header hr {
|
33 |
+
margin: 15px 0;
|
34 |
+
}
|
35 |
+
.wizard > .content > .body .slide-body {
|
36 |
+
padding: 0 6% 0 6%;
|
37 |
+
}
|
38 |
+
.wizard > .content > .body .slide-footer {
|
39 |
+
padding: 0 6% 3% 6%;
|
40 |
+
}
|
41 |
+
.wizard.vertical > .actions {
|
42 |
+
margin-bottom: 20px;
|
43 |
+
}
|
44 |
+
.wizard h3 {
|
45 |
+
margin-bottom: 20px;
|
46 |
+
}
|
47 |
+
.wizard p {
|
48 |
+
margin-bottom: 20px;
|
49 |
+
}
|
50 |
+
.wizard .body ul {
|
51 |
+
list-style: square inside none;
|
52 |
+
padding-left: 20px;
|
53 |
+
}
|
54 |
+
.wizard p.wizard-response {
|
55 |
+
padding: 10px 15px;
|
56 |
+
}
|
57 |
+
|
58 |
+
.wizard .slide-body img {
|
59 |
+
float: left;
|
60 |
+
width: 40%;
|
61 |
+
margin-right: 20px;
|
62 |
+
}
|
63 |
+
.wizard .slide-body .media {
|
64 |
+
margin-top: 25px
|
65 |
+
}
|
66 |
+
.wizard .slide-body .media-object {
|
67 |
+
border: 1px solid #888;
|
68 |
+
height: 64px;
|
69 |
+
width: 64px;
|
70 |
+
}
|
resources/images/shield/shieldnetworkmini.png
ADDED
Binary file
|
resources/images/wizard/general-module_onoff.png
ADDED
Binary file
|
resources/images/wizard/general-option_help.png
ADDED
Binary file
|
resources/images/wizard/general-shield_actions.png
ADDED
Binary file
|
resources/images/wizard/general-shield_help.png
ADDED
Binary file
|
resources/images/wizard/general-shield_modules.png
ADDED
Binary file
|
resources/images/wizard/general-shield_options.png
ADDED
Binary file
|
resources/images/wizard/general-shield_where.png
ADDED
Binary file
|
resources/js/jquery.fancybox.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// ==================================================
|
2 |
+
// fancyBox v3.2.10
|
3 |
+
//
|
4 |
+
// Licensed GPLv3 for open source use
|
5 |
+
// or fancyBox Commercial License for commercial use
|
6 |
+
//
|
7 |
+
// http://fancyapps.com/fancybox/
|
8 |
+
// Copyright 2017 fancyApps
|
9 |
+
//
|
10 |
+
// ==================================================
|
11 |
+
!function(t,e,n,o){"use strict";function i(t){var e=n(t.currentTarget),o=t.data?t.data.options:{},i=e.attr("data-fancybox")||"",a=0,s=[];t.isDefaultPrevented()||(t.preventDefault(),i?(s=o.selector?n(o.selector):t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+i+'"]'):n('[data-fancybox="'+i+'"]'),a=s.index(e),a<0&&(a=0)):s=[e],n.fancybox.open(s,o,a))}if(n){if(n.fn.fancybox)return void("console"in t&&console.log("fancyBox already initialized"));var a={loop:!1,margin:[44,0],gutter:50,keyboard:!0,arrows:!0,infobar:!0,toolbar:!0,buttons:["slideShow","fullScreen","thumbs","share","close"],idleTime:3,smallBtn:"auto",protect:!1,modal:!1,image:{preload:"auto"},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen allowtransparency="true" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},defaultType:"image",animationEffect:"zoom",animationDuration:500,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption-wrap"><div class="fancybox-caption"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}<p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}"><svg viewBox="0 0 40 40"><path d="M20,23 L20,8 L20,23 L13,16 L20,23 L27,16 L20,23 M26,28 L13,28 L27,28 L14,28" /></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg viewBox="0 0 40 40"><path d="M 18,17 m-8,0 a 8,8 0 1,0 16,0 a 8,8 0 1,0 -16,0 M25,23 L31,29 L25,23" /></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg viewBox="0 0 40 40"><path d="M10,10 L30,30 M30,10 L10,30" /></svg></button>',smallBtn:'<button data-fancybox-close class="fancybox-close-small" title="{{CLOSE}}"></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><svg viewBox="0 0 40 40"><path d="M10,20 L30,20 L10,20 L18,28 L10,20 L18,12 L10,20"></path></svg></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><svg viewBox="0 0 40 40"><path d="M30,20 L10,20 L30,20 L22,28 L30,20 L22,12 L30,20"></path></svg></button>'},parentEl:"body",autoFocus:!1,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:4e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{idleTime:!1,margin:0,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},u=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),d=function(){var t,n=e.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in i)if(n.style[t]!==o)return i[t];return"transitionend"}(),f=function(t){return t&&t.length&&t[0].offsetHeight},p=function(t,o,i){var a=this;a.opts=n.extend(!0,{index:i},n.fancybox.defaults,o||{}),n.fancybox.isMobile&&(a.opts=n.extend(!0,{},a.opts,a.opts.mobile)),o&&n.isArray(o.buttons)&&(a.opts.buttons=o.buttons),a.id=a.opts.id||++c,a.group=[],a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=null,a.createGroup(t),a.group.length&&(a.$lastFocus=n(e.activeElement).blur(),a.slides={},a.init())};n.extend(p.prototype,{init:function(){var i,a,s,c=this,l=c.group[c.currIndex],u=l.opts,d=n.fancybox.scrollbarWidth;c.scrollTop=r.scrollTop(),c.scrollLeft=r.scrollLeft(),n.fancybox.getInstance()||(n("body").addClass("fancybox-active"),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!t.MSStream?"image"!==l.type&&n("body").css("top",n("body").scrollTop()*-1).addClass("fancybox-iosfix"):!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(d===o&&(i=n('<div style="width:50px;height:50px;overflow:scroll;" />').appendTo("body"),d=n.fancybox.scrollbarWidth=i[0].offsetWidth-i[0].clientWidth,i.remove()),n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar { margin-right: '+d+"px; }</style>"),n("body").addClass("compensate-for-scrollbar"))),s="",n.each(u.buttons,function(t,e){s+=u.btnTpl[e]||""}),a=n(c.translate(c,u.baseTpl.replace("{{buttons}}",s).replace("{{arrows}}",u.btnTpl.arrowLeft+u.btnTpl.arrowRight))).attr("id","fancybox-container-"+c.id).addClass("fancybox-is-hidden").addClass(u.baseClass).data("FancyBox",c).appendTo(u.parentEl),c.$refs={container:a},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){c.$refs[t]=a.find(".fancybox-"+t)}),c.trigger("onInit"),c.activate(),c.jumpTo(c.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang];return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var i=n[e];return i===o?t:i})},createGroup:function(t){var e=this,i=n.makeArray(t);n.each(i,function(t,i){var a,s,r,c,l,u={},d={};n.isPlainObject(i)?(u=i,d=i.opts||i):"object"===n.type(i)&&n(i).length?(a=n(i),d=a.data(),d=n.extend({},d,d.options||{}),d.$orig=a,u.src=d.src||a.attr("href"),u.type||u.src||(u.type="inline",u.src=i)):u={type:"html",src:i+""},u.opts=n.extend(!0,{},e.opts,d),n.isArray(d.buttons)&&(u.opts.buttons=d.buttons),s=u.type||u.opts.type,c=u.src||"",!s&&c&&(c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?s="pdf":(r=c.match(/\.(mp4|mov|ogv)((\?|#).*)?$/i))?(s="video",u.opts.videoFormat||(u.opts.videoFormat="video/"+("ogv"===r[1]?"ogg":r[1]))):"#"===c.charAt(0)&&(s="inline")),s?u.type=s:e.trigger("objectNeedsType",u),u.index=e.group.length,u.opts.$orig&&!u.opts.$orig.length&&delete u.opts.$orig,!u.opts.$thumb&&u.opts.$orig&&(u.opts.$thumb=u.opts.$orig.find("img:first")),u.opts.$thumb&&!u.opts.$thumb.length&&delete u.opts.$thumb,"function"===n.type(u.opts.caption)&&(u.opts.caption=u.opts.caption.apply(i,[e,u])),"function"===n.type(e.opts.caption)&&(u.opts.caption=e.opts.caption.apply(i,[e,u])),u.opts.caption instanceof n||(u.opts.caption=u.opts.caption===o?"":u.opts.caption+""),"ajax"===s&&(l=c.split(/\s+/,2),l.length>1&&(u.src=l.shift(),u.opts.filter=l.shift())),"auto"==u.opts.smallBtn&&(n.inArray(s,["html","inline","ajax"])>-1?(u.opts.toolbar=!1,u.opts.smallBtn=!0):u.opts.smallBtn=!1),"pdf"===s&&(u.type="iframe",u.opts.iframe.preload=!1),u.opts.modal&&(u.opts=n.extend(!0,u.opts,{infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),e.group.push(u)})},addEvents:function(){var o=this;o.removeEvents(),o.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),o.close(t)}).on("click.fb-prev touchend.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),o.previous()}).on("click.fb-next touchend.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),o.next()}).on("click.fb","[data-fancybox-zoom]",function(t){o[o.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?u(function(){o.update()}):(o.$refs.stage.hide(),setTimeout(function(){o.$refs.stage.show(),o.update()},600))}),r.on("focusin.fb",function(t){var i=n.fancybox?n.fancybox.getInstance():null;i.isClosing||!i.current||!i.current.opts.trapFocus||n(t.target).hasClass("fancybox-container")||n(t.target).is(e)||i&&"fixed"!==n(t.target).css("position")&&!i.$refs.container.has(t.target).length&&(t.stopPropagation(),i.focus(),s.scrollTop(o.scrollTop).scrollLeft(o.scrollLeft))}),r.on("keydown.fb",function(t){var e=o.current,i=t.keyCode||t.which;if(e&&e.opts.keyboard&&!n(t.target).is("input")&&!n(t.target).is("textarea"))return 8===i||27===i?(t.preventDefault(),void o.close(t)):37===i||38===i?(t.preventDefault(),void o.previous()):39===i||40===i?(t.preventDefault(),void o.next()):void o.trigger("afterKeydown",t,i)}),o.group[o.currIndex].opts.idleTime&&(o.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){o.idleSecondsCounter=0,o.isIdle&&o.showControls(),o.isIdle=!1}),o.idleInterval=t.setInterval(function(){o.idleSecondsCounter++,o.idleSecondsCounter>=o.group[o.currIndex].opts.idleTime&&!o.isDragging&&(o.isIdle=!0,o.idleSecondsCounter=0,o.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("focusin.fb keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e,i){var a,s,r,c,l,u,d,p=this,h=p.group.length;if(!(p.isDragging||p.isClosing||p.isAnimating&&p.firstRun)){if(t=parseInt(t,10),s=p.current?p.current.opts.loop:p.opts.loop,!s&&(t<0||t>=h))return!1;if(a=p.firstRun=null===p.firstRun,!(h<2&&!a&&p.isDragging)){if(c=p.current,p.prevIndex=p.currIndex,p.prevPos=p.currPos,r=p.createSlide(t),h>1&&((s||r.index>0)&&p.createSlide(t-1),(s||r.index<h-1)&&p.createSlide(t+1)),p.current=r,p.currIndex=r.index,p.currPos=r.pos,p.trigger("beforeShow",a),p.updateControls(),u=n.fancybox.getTranslate(r.$slide),r.isMoved=(0!==u.left||0!==u.top)&&!r.$slide.hasClass("fancybox-animated"),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),a)return r.opts.animationEffect&&e&&p.$refs.container.css("transition-duration",e+"ms"),p.$refs.container.removeClass("fancybox-is-hidden"),f(p.$refs.container),p.$refs.container.addClass("fancybox-is-open"),r.$slide.addClass("fancybox-slide--current"),p.loadSlide(r),void p.preload("image");n.each(p.slides,function(t,e){n.fancybox.stop(e.$slide)}),r.$slide.removeClass("fancybox-slide--next fancybox-slide--previous").addClass("fancybox-slide--current"),r.isMoved?(l=Math.round(r.$slide.width()),n.each(p.slides,function(t,o){var i=o.pos-r.pos;n.fancybox.animate(o.$slide,{top:0,left:i*l+i*o.opts.gutter},e,function(){o.$slide.removeAttr("style").removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===p.currPos&&(r.isMoved=!1,p.complete())})})):p.$refs.stage.children().removeAttr("style"),r.isLoaded?p.revealContent(r):p.loadSlide(r),p.preload("image"),c.pos!==r.pos&&(d="fancybox-slide--"+(c.pos>r.pos?"next":"previous"),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current fancybox-slide--next fancybox-slide--previous"),c.isComplete=!1,e&&(r.isMoved||r.opts.transitionEffect)&&(r.isMoved?c.$slide.addClass(d):(d="fancybox-animated "+d+" fancybox-fx-"+r.opts.transitionEffect,n.fancybox.animate(c.$slide,d,e,function(){c.$slide.removeClass(d).removeAttr("style")}))))}}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,i){var a,s,r,c,l,u=this,d=u.current,f=d.$content,p=parseInt(d.$slide.width(),10),h=parseInt(d.$slide.height(),10),g=d.width,b=d.height;"image"!=d.type||d.hasError||!f||u.isAnimating||(n.fancybox.stop(f),u.isAnimating=!0,t=t===o?.5*p:t,e=e===o?.5*h:e,a=n.fancybox.getTranslate(f),c=g/a.width,l=b/a.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=a.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=a.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),u.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},i||330,function(){u.isAnimating=!1}),u.SlideShow&&u.SlideShow.isActive&&u.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;"image"!=i.type||i.hasError||!a||o.isAnimating||(n.fancybox.stop(a),o.isAnimating=!0,e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,i,a,s,r=this,c=t.$content,l=t.width,u=t.height,d=t.opts.margin;return!(!c||!c.length||!l&&!u)&&("number"===n.type(d)&&(d=[d,d]),2==d.length&&(d=[d[0],d[1],d[0],d[1]]),e=parseInt(r.$refs.stage.width(),10)-(d[1]+d[3]),o=parseInt(r.$refs.stage.height(),10)-(d[0]+d[2]),i=Math.min(1,e/l,o/u),a=Math.floor(i*l),s=Math.floor(i*u),{top:Math.floor(.5*(o-s))+d[0],left:Math.floor(.5*(e-a))+d[3],width:a,height:s})},update:function(){var t=this;n.each(t.slides,function(e,n){t.updateSlide(n)})},updateSlide:function(t,e){var o=this,i=t&&t.$content;i&&(t.width||t.height)&&(o.isAnimating=!1,n.fancybox.stop(i),n.fancybox.setTranslate(i,o.getFitPos(t)),t.pos===o.currPos&&o.updateCursor()),t.$slide.trigger("refresh"),o.trigger("onUpdate",t)},centerSlide:function(t,e){var i,a,s=this;s.current&&(i=Math.round(t.$slide.width()),a=t.pos-s.current.pos,n.fancybox.animate(t.$slide,{top:0,left:a*i+a*t.opts.gutter,opacity:1},e===o?0:e,null,!1))},updateCursor:function(t,e){var n,i=this,a=i.$refs.container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-drag fancybox-can-zoomOut");i.current&&!i.isClosing&&(i.isZoomable()?(a.addClass("fancybox-is-zoomable"),n=t!==o&&e!==o?t<i.current.width&&e<i.current.height:i.isScaledDown(),n?a.addClass("fancybox-can-zoomIn"):i.current.opts.touch?a.addClass("fancybox-can-drag"):a.addClass("fancybox-can-zoomOut")):i.current.opts.touch&&a.addClass("fancybox-can-drag"))},isZoomable:function(){var t,e=this,o=e.current;if(o&&!e.isClosing)return!!("image"===o.type&&o.isLoaded&&!o.hasError&&("zoom"===o.opts.clickContent||n.isFunction(o.opts.clickContent)&&"zoom"===o.opts.clickContent(o))&&(t=e.getFitPos(o),o.width>t.width||o.height>t.height))},isScaledDown:function(){var t=this,e=t.current,o=e.$content,i=!1;return o&&(i=n.fancybox.getTranslate(o),i=i.width<e.width||i.height<e.height),i},canPan:function(){var t=this,e=t.current,n=e.$content,o=!1;return n&&(o=t.getFitPos(e),o=Math.abs(n.width()-o.width)>1||Math.abs(n.height()-o.height)>1),o},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){switch(t.isLoading=!0,a.trigger("beforeLoad",t),e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass("fancybox-slide--"+(e||"unknown")).addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;case"video":a.setContent(t,'<video controls><source src="'+t.src+'" type="'+t.opts.videoFormat+"\">Your browser doesn't support HTML5 video</video>");break;default:a.setError(t)}return!0}},setImage:function(e){var o,i,a,s,r=this,c=e.opts.srcset||e.opts.image.srcset;if(c){a=t.devicePixelRatio||1,s=t.innerWidth*a,i=c.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),i.sort(function(t,e){return t.value-e.value});for(var l=0;l<i.length;l++){var u=i[l];if("w"===u.postfix&&u.value>=s||"x"===u.postfix&&u.value>=a){o=u;break}}!o&&i.length&&(o=i[i.length-1]),o&&(e.src=o.url,e.width&&e.height&&"w"==o.postfix&&(e.height=e.width/e.height*o.value,e.width=o.value))}e.$content=n('<div class="fancybox-image-wrap"></div>').addClass("fancybox-is-hidden").appendTo(e.$slide),e.opts.preload!==!1&&e.opts.width&&e.opts.height&&(e.opts.thumb||e.opts.$thumb)?(e.width=e.opts.width,e.height=e.opts.height,e.$ghost=n("<img />").one("error",function(){n(this).remove(),e.$ghost=null,r.setBigImage(e)}).one("load",function(){r.afterLoad(e),r.setBigImage(e)}).addClass("fancybox-image").appendTo(e.$content).attr("src",e.opts.thumb||e.opts.$thumb.attr("src"))):r.setBigImage(e)},setBigImage:function(t){var e=this,o=n("<img />");t.$image=o.one("error",function(){e.setError(t)}).one("load",function(){clearTimeout(t.timouts),t.timouts=null,e.isClosing||(t.width=t.opts.width||this.naturalWidth,t.height=t.opts.height||this.naturalHeight,t.opts.image.srcset&&o.attr("sizes","100vw").attr("srcset",t.opts.image.srcset),e.hideLoading(t),t.$ghost?t.timouts=setTimeout(function(){t.timouts=null,t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))):e.afterLoad(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(o[0].complete||"complete"==o[0].readyState)&&o[0].naturalWidth&&o[0].naturalHeight?o.trigger("load"):o[0].error?o.trigger("error"):t.timouts=setTimeout(function(){o[0].complete||t.hasError||e.showLoading(t)},100)},setIframe:function(t){var e,i=this,a=t.opts.iframe,s=t.$slide;t.$content=n('<div class="fancybox-content'+(a.preload?" fancybox-is-hidden":"")+'"></div>').css(a.css).appendTo(s),e=n(a.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(a.attr).appendTo(t.$content),a.preload?(i.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),i.afterLoad(t)}),s.on("refresh.fb",function(){var n,i,s,r=t.$content,c=a.css.width,l=a.css.height;if(1===e[0].isReady){try{i=e.contents(),s=i.find("body")}catch(t){}s&&s.length&&(c===o&&(n=e[0].contentWindow.document.documentElement.scrollWidth,c=Math.ceil(s.outerWidth(!0)+(r.width()-n)),c+=r.outerWidth()-r.innerWidth()),l===o&&(l=Math.ceil(s.outerHeight(!0)),l+=r.outerHeight()-r.innerHeight()),c&&r.width(c),l&&r.height(l)),r.removeClass("fancybox-is-hidden")}})):this.afterLoad(t),e.attr("src",t.src),t.opts.smallBtn===!0&&t.$content.prepend(i.translate(t,t.opts.btnTpl.smallBtn)),s.one("onReset",function(){try{n(this).find("iframe").hide().attr("src","//about:blank")}catch(t){}n(this).empty(),t.isLoaded=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$slide.empty(),l(e)&&e.parent().length?(e.parent(".fancybox-slide--inline").trigger("onReset"),t.$placeholder=n("<div></div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents(),3===e[0].nodeType&&(e=n("<div>").html(e))),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1)}),t.$content=n(e).appendTo(t.$slide),this.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.removeClass("fancybox-slide--"+t.type),this.setContent(t,this.translate(t,t.opts.errorTpl))},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.opts.spinnerTpl).appendTo(t.$slide))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),t.opts.smallBtn&&!t.$smallBtn&&(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content.filter("div,form").first())),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.revealContent(t))},revealContent:function(t){var e,i,a,s,r,c=this,l=t.$slide,u=!1;return e=t.opts[c.firstRun?"animationEffect":"transitionEffect"],a=t.opts[c.firstRun?"animationDuration":"transitionDuration"],a=parseInt(t.forcedDuration===o?a:t.forcedDuration,10),!t.isMoved&&t.pos===c.currPos&&a||(e=!1),"zoom"!==e||t.pos===c.currPos&&a&&"image"===t.type&&!t.hasError&&(u=c.getThumbPos(t))||(e="fade"),"zoom"===e?(r=c.getFitPos(t),r.scaleX=r.width/u.width,r.scaleY=r.height/u.height,delete r.width,delete r.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-u.width/u.height)>.1),s&&(u.opacity=.1,r.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),u),f(t.$content),void n.fancybox.animate(t.$content,r,a,function(){c.complete()})):(c.updateSlide(t),e?(n.fancybox.stop(l),i="fancybox-animated fancybox-slide--"+(t.pos>=c.prevPos?"next":"previous")+" fancybox-fx-"+e,l.removeAttr("style").removeClass("fancybox-slide--current fancybox-slide--next fancybox-slide--previous").addClass(i),t.$content.removeClass("fancybox-is-hidden"),f(l),void n.fancybox.animate(l,"fancybox-slide--current",a,function(e){l.removeClass(i).removeAttr("style"),t.pos===c.currPos&&c.complete()},!0)):(f(l),t.$content.removeClass("fancybox-is-hidden"),void(t.pos===c.currPos&&c.complete())))},getThumbPos:function(o){var i,a=this,s=!1,r=function(e){for(var o,i=e[0],a=i.getBoundingClientRect(),s=[];null!==i.parentElement;)"hidden"!==n(i.parentElement).css("overflow")&&"auto"!==n(i.parentElement).css("overflow")||s.push(i.parentElement.getBoundingClientRect()),i=i.parentElement;return o=s.every(function(t){var e=Math.min(a.right,t.right)-Math.max(a.left,t.left),n=Math.min(a.bottom,t.bottom)-Math.max(a.top,t.top);return e>0&&n>0}),o&&a.bottom>0&&a.right>0&&a.left<n(t).width()&&a.top<n(t).height()},c=o.opts.$thumb,l=c?c.offset():0;return l&&c[0].ownerDocument===e&&r(c)&&(i=a.$refs.stage.offset(),s={top:l.top-i.top+parseFloat(c.css("border-top-width")||0),left:l.left-i.left+parseFloat(c.css("border-left-width")||0),width:c.width(),height:c.height(),scaleX:1,scaleY:1}),s},complete:function(){var t=this,o=t.current,i={};o.isMoved||!o.isLoaded||o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),t.preload("inline"),f(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(t.slides,function(e,o){o.pos>=t.currPos-1&&o.pos<=t.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),t.slides=i,t.updateCursor(),t.trigger("afterShow"),o.$slide.find("video,audio").first().trigger("play"),(n(e.activeElement).is("[disabled]")||o.opts.autoFocus&&"image"!=o.type&&"iframe"!==o.type)&&t.focus())},preload:function(t){var e=this,n=e.slides[e.currPos+1],o=e.slides[e.currPos-1];n&&n.type===t&&e.loadSlide(n),o&&o.type===t&&e.loadSlide(o)},focus:function(){var t,e=this.current;this.isClosing||(e&&e.isComplete&&(t=e.$slide.find("input[autofocus]:enabled:visible:first"),t.length||(t=e.$slide.find("button,:input,[tabindex],a").filter(":enabled:visible:first"))),t=t&&t.length?t:this.$refs.container,t.focus())},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l=this,p=l.current,h=function(){l.cleanUp(t)};return!l.isClosing&&(l.isClosing=!0,l.trigger("beforeClose",t)===!1?(l.isClosing=!1,u(function(){l.update()}),!1):(l.removeEvents(),p.timouts&&clearTimeout(p.timouts),a=p.$content,o=p.opts.animationEffect,i=n.isNumeric(e)?e:o?p.opts.animationDuration:0,p.$slide.off(d).removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),p.$slide.siblings().trigger("onReset").remove(),i&&l.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing"),l.hideLoading(p),l.hideControls(),l.updateCursor(),"zoom"!==o||t!==!0&&a&&i&&"image"===p.type&&!p.hasError&&(c=l.getThumbPos(p))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),r=n.fancybox.getTranslate(a),r.width=r.width*r.scaleX,r.height=r.height*r.scaleY,s=p.opts.zoomOpacity,"auto"==s&&(s=Math.abs(p.width/p.height-c.width/c.height)>.1),s&&(c.opacity=0),r.scaleX=r.width/c.width,r.scaleY=r.height/c.height,r.width=c.width,r.height=c.height,n.fancybox.setTranslate(p.$content,r),f(p.$content),n.fancybox.animate(p.$content,c,i,h),!0):(o&&i?t===!0?setTimeout(h,i):n.fancybox.animate(p.$slide.removeClass("fancybox-slide--current"),"fancybox-animated fancybox-slide--previous fancybox-fx-"+o,i,h):h(),!0)))},cleanUp:function(t){var o,i,a=this,r=n("body");a.current.$slide.trigger("onReset"),a.$refs.container.empty().remove(),a.trigger("afterClose",t),a.$lastFocus&&a.current.opts.backFocus&&a.$lastFocus.focus(),a.current=null,o=n.fancybox.getInstance(),o?o.activate():(s.scrollTop(a.scrollTop).scrollLeft(a.scrollLeft),r.removeClass("fancybox-active compensate-for-scrollbar"),r.hasClass("fancybox-iosfix")&&(i=parseInt(e.body.style.top,10),r.removeClass("fancybox-iosfix").css("top","").scrollTop(i*-1)),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;return s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),o===!1?o:void("afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i))},updateControls:function(t){var e=this,n=e.current,o=n.index,i=n.opts.caption,a=e.$refs.container,s=e.$refs.caption;n.$slide.trigger("refresh"),e.$caption=i&&i.length?s.html(i):null,e.isHiddenControls||e.isIdle||e.showControls(),a.find("[data-fancybox-count]").html(e.group.length),a.find("[data-fancybox-index]").html(o+1),a.find("[data-fancybox-prev]").prop("disabled",!n.opts.loop&&o<=0),a.find("[data-fancybox-next]").prop("disabled",!n.opts.loop&&o>=e.group.length-1),"image"===n.type?a.find("[data-fancybox-download]").attr("href",n.opts.image.src||n.src).show():a.find("[data-fancybox-download],[data-fancybox-zoom]").hide()},hideControls:function(){this.isHiddenControls=!0,this.$refs.container.removeClass("fancybox-show-infobar fancybox-show-toolbar fancybox-show-caption fancybox-show-nav")},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.isHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal),t.$caption?n.addClass("fancybox-show-caption "):n.removeClass("fancybox-show-caption")},toggleControls:function(){this.isHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.2.10",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof p&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new p(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close())},destroy:function(){this.close(!0),r.off("click.fb-start")},isMobile:e.createTouch!==o&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;if(!t||!t.length)return!1;if(e=t.eq(0).css("transform"),e&&e.indexOf("matrix")!==-1?(e=e.split("(")[1],e=e.split(")")[0],e=e.split(",")):e=[],e.length)e=e.length>10?[e[13],e[12],e[0],e[5]]:[e[5],e[4],e[0],e[3]],e=e.map(parseFloat);else{e=[0,0,1,1];var n=/\.*translate\((.*)px,(.*)px\)/i,o=n.exec(t.eq(0).attr("style"));o&&(e[0]=parseFloat(o[2]),e[1]=parseFloat(o[1]))}return{top:e[0],left:e[1],scaleX:e[2],scaleY:e[3],opacity:parseFloat(t.css("opacity")),width:t.width(),height:t.height()}},setTranslate:function(t,e){var n="",i={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o&&(n=(n.length?n+" ":"")+"scale("+e.scaleX+", "+e.scaleY+")"),n.length&&(i.transform=n),e.opacity!==o&&(i.opacity=e.opacity),e.width!==o&&(i.width=e.width),e.height!==o&&(i.height=e.height),t.css(i)},animate:function(t,e,i,a,s){n.isFunction(i)&&(a=i,i=null),n.isPlainObject(e)||t.removeAttr("style"),t.on(d,function(i){(!i||!i.originalEvent||t.is(i.originalEvent.target)&&"z-index"!=i.originalEvent.propertyName)&&(n.fancybox.stop(t),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(t.css("transition-duration",""),e.width=Math.round(t.width()*e.scaleX),e.height=Math.round(t.height()*e.scaleY),e.scaleX=1,e.scaleY=1,n.fancybox.setTranslate(t,e)),s===!1&&t.removeAttr("style")):s!==!0&&t.removeClass(e),n.isFunction(a)&&a(i))}),n.isNumeric(i)&&t.css("transition-duration",i+"ms"),n.isPlainObject(e)?n.fancybox.setTranslate(t,e):t.addClass(e),e.scaleX&&t.hasClass("fancybox-image-wrap")&&t.parent().addClass("fancybox-is-scaling"),t.data("timer",setTimeout(function(){t.trigger("transitionend")},i+16))},stop:function(t){clearTimeout(t.data("timer")),t.off("transitionend").css("transition-duration",""),t.hasClass("fancybox-image-wrap")&&t.parent().removeClass("fancybox-is-scaling")}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i)}}(window,document,window.jQuery||jQuery),function(t){"use strict";var e=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e},n={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"
|
12 |
+
},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1,api:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},metacafe:{matcher:/metacafe.com\/watch\/(\d+)\/(.*)?/,type:"iframe",url:"//www.metacafe.com/embed/$1/?ap=1"},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:"iframe",url:"//www.dailymotion.com/embed/video/$1"},vine:{matcher:/vine.co\/v\/([a-zA-Z0-9\?\=\-]+)/,type:"iframe",url:"//vine.co/v/$1/embed/simple"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12])+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,u,d,f,p=a.src||"",h=!1;s=t.extend(!0,{},n,a.opts.media),t.each(s,function(n,o){if(c=p.match(o.matcher)){if(h=o.type,d={},o.paramPlace&&c[o.paramPlace]){u=c[o.paramPlace],"?"==u[0]&&(u=u.substring(1)),u=u.split("&");for(var i=0;i<u.length;++i){var s=u[i].split("=",2);2==s.length&&(d[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,a.opts[n],d),p="function"===t.type(o.url)?o.url.call(this,c,l,a):e(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,a):e(o.thumb,c),"vimeo"===n&&(p=p.replace("&%23","#")),!1}}),h?(a.src=p,a.type=h,a.opts.thumb||a.opts.$thumb&&a.opts.$thumb.length||(a.opts.thumb=r),"iframe"===h&&(t.extend(!0,a.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}}),a.contentProvider=f,a.opts.slideClass+=" fancybox-slide--"+("gmap_place"==f||"gmap_search"==f?"map":"video"))):p&&(a.type=a.opts.defaultType)})}(window.jQuery||jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},u=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};u.prototype.destroy=function(){this.$container.off(".fb.touch")},u.prototype.ontouchstart=function(o){var i=this,c=n(o.target),u=i.instance,d=u.current,f=d.$content,p="touchstart"==o.type;if(p&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!d||i.instance.isAnimating||i.instance.isClosing)return o.stopPropagation(),void o.preventDefault();if(i.realPoints=i.startPoints=a(o),i.startPoints){if(o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=f,i.opts=d.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.sliderStartPos=i.sliderLastPos||{top:0,left:0},i.contentStartPos=n.fancybox.getTranslate(i.$content),i.contentLastPos=null,i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(d.$slide[0].clientWidth),i.canvasHeight=Math.round(d.$slide[0].clientHeight),n(e).off(".fb.touch").on(p?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(p?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),!i.opts&&!u.canPan()||!c.is(i.$stage)&&!i.$stage.find(c).length)return void(c.is("img")&&o.preventDefault());n.fancybox.isMobile&&(l(c)||l(c.parent()))||o.preventDefault(),1===i.startPoints.length&&("image"===d.type&&(i.contentStartPos.width>i.canvasWidth+1||i.contentStartPos.height>i.canvasHeight+1)?(n.fancybox.stop(i.$content),i.$content.css("transition-duration",""),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-controls--isGrabbing")),2!==i.startPoints.length||u.isAnimating||d.hasError||"image"!==d.type||!d.isLoaded&&!d.$ghost||(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.$content.css("transition-duration",""),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))}}},u.prototype.onscroll=function(t){self.isScrolling=!0},u.prototype.ontouchmove=function(t){var e=this,o=n(t.target);return e.isScrolling||!o.is(e.$stage)&&!e.$stage.find(o).length?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.instance.canPan())&&e.newPoints&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},u.prototype.onSwipe=function(e){var a,s=this,r=s.isSwiping,c=s.sliderStartPos.left||0;if(r!==!0)"x"==r&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?c+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?c-=Math.pow(-s.distanceX,.8):c+=s.distanceX),s.sliderLastPos={top:"x"==r?0:s.sliderStartPos.top+s.distanceY,left:c},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,s.instance.group.length<2&&s.opts.vertical?s.isSwiping="y":s.instance.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),s.canTap=!1,"y"===s.isSwiping&&n.fancybox.isMobile&&(l(s.$target)||l(s.$target.parent())))return void(s.isScrolling=!0);s.instance.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(s.instance.slides,function(t,e){n.fancybox.stop(e.$slide),e.$slide.css("transition-duration",""),e.inTransition=!1,e.pos===s.instance.current.pos&&(s.sliderStartPos.left=n.fancybox.getTranslate(e.$slide).left)}),s.instance.SlideShow&&s.instance.SlideShow.isActive&&s.instance.SlideShow.stop()}},u.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&(i(t.requestId),t.requestId=null),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},u.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,u=s.distanceY,d=s.contentStartPos,f=d.left,p=d.top,h=d.width,g=d.height;return i=h>r?f+l:f,a=p+u,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),h>r&&(l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i<n&&(i=n+1-Math.pow(n-f-l,.8)||0)),g>c&&(u>0&&a>e&&(a=e-1+Math.pow(-e+p+u,.8)||0),u<0&&a<o&&(a=o+1-Math.pow(o-p-u,.8)||0)),{top:a,left:i,scaleX:d.scaleX,scaleY:d.scaleY}},u.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},u.prototype.onZoom=function(){var e=this,a=e.contentStartPos.width,r=e.contentStartPos.height,c=e.contentStartPos.left,l=e.contentStartPos.top,u=s(e.newPoints[0],e.newPoints[1]),d=u/e.startDistanceBetweenFingers,f=Math.floor(a*d),p=Math.floor(r*d),h=(a-f)*e.percentageOfImageAtPinchPointX,g=(r-p)*e.percentageOfImageAtPinchPointY,b=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),m=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=b-e.centerPointStartX,v=m-e.centerPointStartY,x=c+(h+y),w=l+(g+v),$={top:w,left:x,scaleX:e.contentStartPos.scaleX*d,scaleY:e.contentStartPos.scaleY*d};e.canTap=!1,e.newWidth=f,e.newHeight=p,e.contentLastPos=$,e.requestId&&(i(e.requestId),e.requestId=null),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},u.prototype.ontouchend=function(t){var o=this,s=Math.max((new Date).getTime()-o.startTime,1),r=o.isSwiping,c=o.isPanning,l=o.isZooming,u=o.isScrolling;return o.endPoints=a(t),o.$container.removeClass("fancybox-controls--isGrabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap?o.onTap(t):(o.speed=366,o.velocityX=o.distanceX/s*.5,o.velocityY=o.distanceY/s*.5,o.speedX=Math.max(.5*o.speed,Math.min(1.5*o.speed,1/Math.abs(o.velocityX)*o.speed)),void(c?o.endPanning():l?o.endZooming():o.endSwiping(r,u)))},u.prototype.endSwiping=function(t,e){var o=this,i=!1,a=o.instance.group.length;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},150),i=o.instance.close(!0,300)):"x"==t&&o.distanceX>50&&a>1?i=o.instance.previous(o.speedX):"x"==t&&o.distanceX<-50&&a>1&&(i=o.instance.next(o.speedX)),i!==!1||"x"!=t&&"y"!=t||(e||a<2?o.instance.centerSlide(o.instance.current,150):o.instance.jumpTo(o.instance.current.index)),o.$container.removeClass("fancybox-is-sliding")},u.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(i.opts.momentum===!1?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+i.velocityX*i.speed,e=i.contentLastPos.top+i.velocityY*i.speed),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,330))},u.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.setTranslate(a.content,n.fancybox.getTranslate(a.$content)),n.fancybox.animate(a.$content,o,150)))},u.prototype.onTap=function(t){var e,o=this,i=n(t.target),s=o.instance,r=s.current,c=t&&a(t)||o.startPoints,l=c[0]?c[0].x-o.$stage.offset().left:0,u=c[0]?c[0].y-o.$stage.offset().top:0,d=function(e){var i=r.opts[e];if(n.isFunction(i)&&(i=i.apply(s,[r,t])),i)switch(i){case"close":s.close(o.startEvent);break;case"toggleControls":s.toggleControls(!0);break;case"next":s.next();break;case"nextOrClose":s.group.length>1?s.next():s.close(o.startEvent);break;case"zoom":"image"==r.type&&(r.isLoaded||r.$ghost)&&(s.canPan()?s.scaleToFit():s.isScaledDown()?s.scaleToActual(l,u):s.group.length<2&&s.close(o.startEvent))}};if((!t.originalEvent||2!=t.originalEvent.button)&&(i.is("img")||!(l>i[0].clientWidth+i.offset().left))){if(i.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))e="Outside";else if(i.is(".fancybox-slide"))e="Slide";else{if(!s.current.$content||!s.current.$content.find(i).addBack().filter(i).length)return;e="Content"}if(o.tapped){if(clearTimeout(o.tapped),o.tapped=null,Math.abs(l-o.tapX)>50||Math.abs(u-o.tapY)>50)return this;d("dblclick"+e)}else o.tapX=l,o.tapY=u,r.opts["dblclick"+e]&&r.opts["dblclick"+e]!==r.opts["click"+e]?o.tapped=setTimeout(function(){o.tapped=null,d("click"+e)},500):d("click"+e);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new u(e))})}(window,document,window.jQuery||jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg viewBox="0 0 40 40"><path d="M13,12 L27,20 L13,27 Z" /><path d="M15,10 v19 M23,10 v19" /></svg></button>'},slideShow:{autoStart:!1,speed:3e3}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this;t.$button=t.instance.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),(t.instance.group.length<2||!t.instance.group[t.instance.currIndex].opts.slideShow)&&t.$button.hide()},set:function(t){var e=this;e.instance&&e.instance.current&&(t===!0||e.instance.current.opts.loop||e.instance.currIndex<e.instance.group.length-1)?e.timer=setTimeout(function(){e.isActive&&e.instance.jumpTo((e.instance.currIndex+1)%e.instance.group.length)},e.instance.current.opts.slideShow.speed):(e.stop(),e.instance.idleSecondsCounter=0,e.instance.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null},start:function(){var t=this,e=t.instance.current;e&&(t.isActive=!0,t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.set(!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",e.opts.i18n[e.opts.lang].PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,window.jQuery||jQuery),function(t,e){"use strict";var n=function(){var e,n,o,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],a={};for(n=0;n<i.length;n++)if(e=i[n],e&&e[1]in t){for(o=0;o<e.length;o++)a[i[0][o]]=e[o];return a}return!1}();if(!n)return void(e&&e.fancybox&&(e.fancybox.defaults.btnTpl.fullScreen=!1));var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fullscreen" title="{{FULL_SCREEN}}"><svg viewBox="0 0 40 40"><path d="M9,12 h22 v16 h-22 v-16 v16 h22 v-16 Z" /></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on({"onInit.fb":function(t,e){var n;e&&e.group[e.currIndex].opts.fullScreen?(n=e.$refs.container,n.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle(n[0])}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(n[0]),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle(e.$refs.container[0]))},"beforeClose.fb":function(t){t&&t.FullScreen&&o.exit()}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t))})}(document,window.jQuery||jQuery),function(t,e){"use strict";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg viewBox="0 0 120 120"><path d="M30,30 h14 v14 h-14 Z M50,30 h14 v14 h-14 Z M70,30 h14 v14 h-14 Z M30,50 h14 v14 h-14 Z M50,50 h14 v14 h-14 Z M70,50 h14 v14 h-14 Z M30,70 h14 v14 h-14 Z M50,70 h14 v14 h-14 Z M70,70 h14 v14 h-14 Z" /></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var n=function(t){this.init(t)};e.extend(n.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this;e.instance=t,t.Thumbs=e;var n=t.group[0],o=t.group[1];e.opts=t.group[t.currIndex].opts.thumbs,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]"),e.opts&&n&&o&&("image"==n.type||n.opts.thumb||n.opts.$thumb)&&("image"==o.type||o.opts.thumb||o.opts.$thumb)?(e.$button.show().on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,n,o=this,i=o.instance,a=o.opts.parentEl;o.$grid=e('<div class="fancybox-thumbs fancybox-thumbs-'+o.opts.axis+'"></div>').appendTo(i.$refs.container.find(a).addBack().filter(a)),t="<ul>",e.each(i.group,function(e,o){n=o.opts.thumb||(o.opts.$thumb?o.opts.$thumb.attr("src"):null),n||"image"!==o.type||(n=o.src),n&&n.length&&(t+='<li data-index="'+e+'" tabindex="0" class="fancybox-thumbs-loading"><img data-src="'+n+'" /></li>')}),t+="</ul>",o.$list=e(t).appendTo(o.$grid).on("click","li",function(){i.jumpTo(e(this).data("index"))}),o.$list.find("img").hide().one("load",function(){var t,n,o,i,a=e(this).parent().removeClass("fancybox-thumbs-loading"),s=a.outerWidth(),r=a.outerHeight();t=this.naturalWidth||this.width,n=this.naturalHeight||this.height,o=t/s,i=n/r,o>=1&&i>=1&&(o>i?(t/=i,n=r):(t=s,n/=o)),e(this).css({width:Math.floor(t),height:Math.floor(n),"margin-top":n>r?Math.floor(.3*r-.3*n):Math.floor(.5*r-.5*n),"margin-left":Math.floor(.5*s-.5*t)}).show()}).each(function(){this.src=e(this).data("src")}),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"))+i.group.length*o.$list.children().eq(0).outerWidth(!0)+"px")},focus:function(t){var e,n,o=this,i=o.$list;o.instance.current&&(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active"),n=e.position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left<i.parent().scrollLeft()||n.left>i.parent().scrollLeft()+(i.parent().width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){this.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),this.isVisible?(this.$grid||this.create(),this.instance.trigger("onThumbsShow"),this.focus(0)):this.$grid&&this.instance.trigger("onThumbsHide"),this.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var o;e&&!e.Thumbs&&(o=new n(e),o.isActive&&o.opts.autoStart===!0&&o.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,window.jQuery),function(t,e){"use strict";function n(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg viewBox="0 0 40 40"><path d="M6,30 C8,18 19,16 23,16 L23,16 L23,10 L33,20 L23,29 L23,24 C19,24 8,27 6,30 Z"></svg></button>'},share:{tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p class="fancybox-share__links"><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance();i&&(t=i.current.opts.hash===!1?i.current.src:window.location,o=i.current.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.current.type?encodeURIComponent(i.current.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{animationEffect:"fade",animationDuration:250,afterLoad:function(t,e){e.$content.find(".fancybox-share__links a").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})}}}))})}(document,window.jQuery||jQuery),function(t,e,n){"use strict";function o(){var t=e.location.hash.substr(1),n=t.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return o<1&&(o=1),{hash:t,index:o,gallery:i}}function i(t){var e;""!==t.gallery&&(e=n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1),e.length||(e=n("#"+n.escapeSelector(t.gallery))),e.length&&(s=!1,e.trigger("click")))}function a(t){var e;return!!t&&(e=t.current?t.current.opts:t.opts,e.hash||(e.$orig?e.$orig.data("fancybox"):""))}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)});var s=!0,r=null,c=null;n(function(){n.fancybox.defaults.hash!==!1&&(n(t).on({"onInit.fb":function(t,e){var n,i;e.group[e.currIndex].opts.hash!==!1&&(n=o(),i=a(e),i&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i){var l;i&&i.opts.hash!==!1&&(l=a(o),l&&""!==l&&(e.location.hash.indexOf(l)<0&&(o.opts.origHash=e.location.hash),r=l+(o.group.length>1?"-"+(i.index+1):""),"replaceState"in e.history?(c&&clearTimeout(c),c=setTimeout(function(){e.history[s?"pushState":"replaceState"]({},t.title,e.location.pathname+e.location.search+"#"+r),c=null,s=!1},300)):e.location.hash=r))},"beforeClose.fb":function(o,i,s){var l,u;c&&clearTimeout(c),s.opts.hash!==!1&&(l=a(i),u=i&&i.opts.origHash?i.opts.origHash:"",l&&""!==l&&("replaceState"in history?e.history.replaceState({},t.title,e.location.pathname+e.location.search+u):(e.location.hash=u,n(e).scrollTop(i.scrollTop).scrollLeft(i.scrollLeft))),r=null)}}),n(e).on("hashchange.fb",function(){var t=o();n.fancybox.getInstance()?!r||r===t.gallery+"-"+t.index||1===t.index&&r==t.gallery||(r=null,n.fancybox.close()):""!==t.gallery&&i(t)}),setTimeout(function(){i(o())},50))})}(document,window,window.jQuery||jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<1||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,window.jQuery||jQuery);
|
resources/js/jquery.steps.min.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery Steps v1.1.0 - 09/04/2014
|
3 |
+
* Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com)
|
4 |
+
* Licensed under MIT http://www.opensource.org/licenses/MIT
|
5 |
+
*/
|
6 |
+
!function(a,b){function c(a,b){o(a).push(b)}function d(d,e,f){var g=d.children(e.headerTag),h=d.children(e.bodyTag);g.length>h.length?R(Z,"contents"):g.length<h.length&&R(Z,"titles");var i=e.startIndex;if(f.stepCount=g.length,e.saveState&&a.cookie){var j=a.cookie(U+q(d)),k=parseInt(j,0);!isNaN(k)&&k<f.stepCount&&(i=k)}f.currentIndex=i,g.each(function(e){var f=a(this),g=h.eq(e),i=g.data("mode"),j=null==i?$.html:r($,/^\s*$/.test(i)||isNaN(i)?i:parseInt(i,0)),k=j===$.html||g.data("url")===b?"":g.data("url"),l=j!==$.html&&"1"===g.data("loaded"),m=a.extend({},bb,{title:f.html(),content:j===$.html?g.html():"",contentUrl:k,contentMode:j,contentLoaded:l});c(d,m)})}function e(a){a.triggerHandler("canceled")}function f(a,b){return a.currentIndex-b}function g(b,c){var d=i(b);b.unbind(d).removeData("uid").removeData("options").removeData("state").removeData("steps").removeData("eventNamespace").find(".actions a").unbind(d),b.removeClass(c.clearFixCssClass+" vertical");var e=b.find(".content > *");e.removeData("loaded").removeData("mode").removeData("url"),e.removeAttr("id").removeAttr("role").removeAttr("tabindex").removeAttr("class").removeAttr("style")._removeAria("labelledby")._removeAria("hidden"),b.find(".content > [data-mode='async'],.content > [data-mode='iframe']").empty();var f=a('<{0} class="{1}"></{0}>'.format(b.get(0).tagName,b.attr("class"))),g=b._id();return null!=g&&""!==g&&f._id(g),f.html(b.find(".content").html()),b.after(f),b.remove(),f}function h(a,b){var c=a.find(".steps li").eq(b.currentIndex);a.triggerHandler("finishing",[b.currentIndex])?(c.addClass("done").removeClass("error"),a.triggerHandler("finished",[b.currentIndex])):c.addClass("error")}function i(a){var b=a.data("eventNamespace");return null==b&&(b="."+q(a),a.data("eventNamespace",b)),b}function j(a,b){var c=q(a);return a.find("#"+c+V+b)}function k(a,b){var c=q(a);return a.find("#"+c+W+b)}function l(a,b){var c=q(a);return a.find("#"+c+X+b)}function m(a){return a.data("options")}function n(a){return a.data("state")}function o(a){return a.data("steps")}function p(a,b){var c=o(a);return(0>b||b>=c.length)&&R(Y),c[b]}function q(a){var b=a.data("uid");return null==b&&(b=a._id(),null==b&&(b="steps-uid-".concat(T),a._id(b)),T++,a.data("uid",b)),b}function r(a,c){if(S("enumType",a),S("keyOrValue",c),"string"==typeof c){var d=a[c];return d===b&&R("The enum key '{0}' does not exist.",c),d}if("number"==typeof c){for(var e in a)if(a[e]===c)return c;R("Invalid enum value '{0}'.",c)}else R("Invalid key or value type.")}function s(a,b,c){return B(a,b,c,v(c,1))}function t(a,b,c){return B(a,b,c,f(c,1))}function u(a,b,c,d){if((0>d||d>=c.stepCount)&&R(Y),!(b.forceMoveForward&&d<c.currentIndex)){var e=c.currentIndex;return a.triggerHandler("stepChanging",[c.currentIndex,d])?(c.currentIndex=d,O(a,b,c),E(a,b,c,e),D(a,b,c),A(a,b,c),P(a,b,c,d,e,function(){a.triggerHandler("stepChanged",[d,e])})):a.find(".steps li").eq(e).addClass("error"),!0}}function v(a,b){return a.currentIndex+b}function w(b){var c=a.extend(!0,{},cb,b);return this.each(function(){var b=a(this),e={currentIndex:c.startIndex,currentStep:null,stepCount:0,transitionElement:null};b.data("options",c),b.data("state",e),b.data("steps",[]),d(b,c,e),J(b,c,e),G(b,c),c.autoFocus&&0===T&&j(b,c.startIndex).focus(),b.triggerHandler("init",[c.startIndex])})}function x(b,c,d,e,f){(0>e||e>d.stepCount)&&R(Y),f=a.extend({},bb,f),y(b,e,f),d.currentIndex!==d.stepCount&&d.currentIndex>=e&&(d.currentIndex++,O(b,c,d)),d.stepCount++;var g=b.find(".content"),h=a("<{0}>{1}</{0}>".format(c.headerTag,f.title)),i=a("<{0}></{0}>".format(c.bodyTag));return(null==f.contentMode||f.contentMode===$.html)&&i.html(f.content),0===e?g.prepend(i).prepend(h):k(b,e-1).after(i).after(h),K(b,d,i,e),N(b,c,d,h,e),F(b,c,d,e),e===d.currentIndex&&E(b,c,d),D(b,c,d),b}function y(a,b,c){o(a).splice(b,0,c)}function z(b){var c=a(this),d=m(c),e=n(c);if(d.suppressPaginationOnFocus&&c.find(":focus").is(":input"))return b.preventDefault(),!1;var f={left:37,right:39};b.keyCode===f.left?(b.preventDefault(),t(c,d,e)):b.keyCode===f.right&&(b.preventDefault(),s(c,d,e))}function A(b,c,d){if(d.stepCount>0){var e=d.currentIndex,f=p(b,e);if(!c.enableContentCache||!f.contentLoaded)switch(r($,f.contentMode)){case $.iframe:b.find(".content > .body").eq(d.currentIndex).empty().html('<iframe src="'+f.contentUrl+'" frameborder="0" scrolling="no" />').data("loaded","1");break;case $.async:var g=k(b,e)._aria("busy","true").empty().append(M(c.loadingTemplate,{text:c.labels.loading}));a.ajax({url:f.contentUrl,cache:!1}).done(function(a){g.empty().html(a)._aria("busy","false").data("loaded","1"),b.triggerHandler("contentLoaded",[e])})}}}function B(a,b,c,d){var e=c.currentIndex;if(d>=0&&d<c.stepCount&&!(b.forceMoveForward&&d<c.currentIndex)){var f=j(a,d),g=f.parent(),h=g.hasClass("disabled");return g._enableAria(),f.click(),e===c.currentIndex&&h?(g._enableAria(!1),!1):!0}return!1}function C(b){b.preventDefault();var c=a(this),d=c.parent().parent().parent().parent(),f=m(d),g=n(d),i=c.attr("href");switch(i.substring(i.lastIndexOf("#")+1)){case"cancel":e(d);break;case"finish":h(d,g);break;case"next":s(d,f,g);break;case"previous":t(d,f,g)}}function D(a,b,c){if(b.enablePagination){var d=a.find(".actions a[href$='#finish']").parent(),e=a.find(".actions a[href$='#next']").parent();if(!b.forceMoveForward){var f=a.find(".actions a[href$='#previous']").parent();f._enableAria(c.currentIndex>0)}b.enableFinishButton&&b.showFinishButtonAlways?(d._enableAria(c.stepCount>0),e._enableAria(c.stepCount>1&&c.stepCount>c.currentIndex+1)):(d._showAria(b.enableFinishButton&&c.stepCount===c.currentIndex+1),e._showAria(0===c.stepCount||c.stepCount>c.currentIndex+1)._enableAria(c.stepCount>c.currentIndex+1||!b.enableFinishButton))}}function E(b,c,d,e){var f=j(b,d.currentIndex),g=a('<span class="current-info audible">'+c.labels.current+" </span>"),h=b.find(".content > .title");if(null!=e){var i=j(b,e);i.parent().addClass("done").removeClass("error")._selectAria(!1),h.eq(e).removeClass("current").next(".body").removeClass("current"),g=i.find(".current-info"),f.focus()}f.prepend(g).parent()._selectAria().removeClass("done")._enableAria(),h.eq(d.currentIndex).addClass("current").next(".body").addClass("current")}function F(a,b,c,d){for(var e=q(a),f=d;f<c.stepCount;f++){var g=e+V+f,h=e+W+f,i=e+X+f,j=a.find(".title").eq(f)._id(i);a.find(".steps a").eq(f)._id(g)._aria("controls",h).attr("href","#"+i).html(M(b.titleTemplate,{index:f+1,title:j.html()})),a.find(".body").eq(f)._id(h)._aria("labelledby",i)}}function G(a,b){var c=i(a);a.bind("canceled"+c,b.onCanceled),a.bind("contentLoaded"+c,b.onContentLoaded),a.bind("finishing"+c,b.onFinishing),a.bind("finished"+c,b.onFinished),a.bind("init"+c,b.onInit),a.bind("stepChanging"+c,b.onStepChanging),a.bind("stepChanged"+c,b.onStepChanged),b.enableKeyNavigation&&a.bind("keyup"+c,z),a.find(".actions a").bind("click"+c,C)}function H(a,b,c,d){return 0>d||d>=c.stepCount||c.currentIndex===d?!1:(I(a,d),c.currentIndex>d&&(c.currentIndex--,O(a,b,c)),c.stepCount--,l(a,d).remove(),k(a,d).remove(),j(a,d).parent().remove(),0===d&&a.find(".steps li").first().addClass("first"),d===c.stepCount&&a.find(".steps li").eq(d).addClass("last"),F(a,b,c,d),D(a,b,c),!0)}function I(a,b){o(a).splice(b,1)}function J(b,c,d){var e='<{0} class="{1}">{2}</{0}>',f=r(_,c.stepsOrientation),g=f===_.vertical?" vertical":"",h=a(e.format(c.contentContainerTag,"content "+c.clearFixCssClass,b.html())),i=a(e.format(c.stepsContainerTag,"steps "+c.clearFixCssClass,'<ul role="tablist"></ul>')),j=h.children(c.headerTag),k=h.children(c.bodyTag);b.attr("role","application").empty().append(i).append(h).addClass(c.cssClass+" "+c.clearFixCssClass+g),k.each(function(c){K(b,d,a(this),c)}),j.each(function(e){N(b,c,d,a(this),e)}),E(b,c,d),L(b,c,d)}function K(a,b,c,d){var e=q(a),f=e+W+d,g=e+X+d;c._id(f).attr("role","tabpanel")._aria("labelledby",g).addClass("body")._showAria(b.currentIndex===d)}function L(a,b,c){if(b.enablePagination){var d='<{0} class="actions {1}"><ul role="menu" aria-label="{2}">{3}</ul></{0}>',e='<li><a href="#{0}" role="menuitem">{1}</a></li>',f="";b.forceMoveForward||(f+=e.format("previous",b.labels.previous)),f+=e.format("next",b.labels.next),b.enableFinishButton&&(f+=e.format("finish",b.labels.finish)),b.enableCancelButton&&(f+=e.format("cancel",b.labels.cancel)),a.append(d.format(b.actionContainerTag,b.clearFixCssClass,b.labels.pagination,f)),D(a,b,c),A(a,b,c)}}function M(a,c){for(var d=a.match(/#([a-z]*)#/gi),e=0;e<d.length;e++){var f=d[e],g=f.substring(1,f.length-1);c[g]===b&&R("The key '{0}' does not exist in the substitute collection!",g),a=a.replace(f,c[g])}return a}function N(b,c,d,e,f){var g=q(b),h=g+V+f,j=g+W+f,k=g+X+f,l=b.find(".steps > ul"),m=M(c.titleTemplate,{index:f+1,title:e.html()}),n=a('<li role="tab"><a id="'+h+'" href="#'+k+'" aria-controls="'+j+'">'+m+"</a></li>");n._enableAria(c.enableAllSteps||d.currentIndex>f),d.currentIndex>f&&n.addClass("done"),e._id(k).attr("tabindex","-1").addClass("title"),0===f?l.prepend(n):l.find("li").eq(f-1).after(n),0===f&&l.find("li").removeClass("first").eq(f).addClass("first"),f===d.stepCount-1&&l.find("li").removeClass("last").eq(f).addClass("last"),n.children("a").bind("click"+i(b),Q)}function O(b,c,d){c.saveState&&a.cookie&&a.cookie(U+q(b),d.currentIndex)}function P(b,c,d,e,f,g){var h=b.find(".content > .body"),i=r(ab,c.transitionEffect),j=c.transitionEffectSpeed,k=h.eq(e),l=h.eq(f);switch(i){case ab.fade:case ab.slide:var m=i===ab.fade?"fadeOut":"slideUp",o=i===ab.fade?"fadeIn":"slideDown";d.transitionElement=k,l[m](j,function(){var b=a(this)._showAria(!1).parent().parent(),c=n(b);c.transitionElement&&(c.transitionElement[o](j,function(){a(this)._showAria()}).promise().done(g),c.transitionElement=null)});break;case ab.slideLeft:var p=l.outerWidth(!0),q=e>f?-p:p,s=e>f?p:-p;a.when(l.animate({left:q},j,function(){a(this)._showAria(!1)}),k.css("left",s+"px")._showAria().animate({left:0},j)).done(g);break;default:a.when(l._showAria(!1),k._showAria()).done(g)}}function Q(b){b.preventDefault();var c=a(this),d=c.parent().parent().parent().parent(),e=m(d),f=n(d),g=f.currentIndex;if(c.parent().is(":not(.disabled):not(.current)")){var h=c.attr("href"),i=parseInt(h.substring(h.lastIndexOf("-")+1),0);u(d,e,f,i)}return g===f.currentIndex?(j(d,g).focus(),!1):void 0}function R(a){throw arguments.length>1&&(a=a.format(Array.prototype.slice.call(arguments,1))),new Error(a)}function S(a,b){null==b&&R("The argument '{0}' is null or undefined.",a)}a.fn.extend({_aria:function(a,b){return this.attr("aria-"+a,b)},_removeAria:function(a){return this.removeAttr("aria-"+a)},_enableAria:function(a){return null==a||a?this.removeClass("disabled")._aria("disabled","false"):this.addClass("disabled")._aria("disabled","true")},_showAria:function(a){return null==a||a?this.show()._aria("hidden","false"):this.hide()._aria("hidden","true")},_selectAria:function(a){return null==a||a?this.addClass("current")._aria("selected","true"):this.removeClass("current")._aria("selected","false")},_id:function(a){return a?this.attr("id",a):this.attr("id")}}),String.prototype.format||(String.prototype.format=function(){for(var b=1===arguments.length&&a.isArray(arguments[0])?arguments[0]:arguments,c=this,d=0;d<b.length;d++){var e=new RegExp("\\{"+d+"\\}","gm");c=c.replace(e,b[d])}return c});var T=0,U="jQu3ry_5teps_St@te_",V="-t-",W="-p-",X="-h-",Y="Index out of range.",Z="One or more corresponding step {0} are missing.";a.fn.steps=function(b){return a.fn.steps[b]?a.fn.steps[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?void a.error("Method "+b+" does not exist on jQuery.steps"):w.apply(this,arguments)},a.fn.steps.add=function(a){var b=n(this);return x(this,m(this),b,b.stepCount,a)},a.fn.steps.destroy=function(){return g(this,m(this))},a.fn.steps.finish=function(){h(this,n(this))},a.fn.steps.getCurrentIndex=function(){return n(this).currentIndex},a.fn.steps.getCurrentStep=function(){return p(this,n(this).currentIndex)},a.fn.steps.getStep=function(a){return p(this,a)},a.fn.steps.insert=function(a,b){return x(this,m(this),n(this),a,b)},a.fn.steps.next=function(){return s(this,m(this),n(this))},a.fn.steps.previous=function(){return t(this,m(this),n(this))},a.fn.steps.remove=function(a){return H(this,m(this),n(this),a)},a.fn.steps.setStep=function(){throw new Error("Not yet implemented!")},a.fn.steps.skip=function(){throw new Error("Not yet implemented!")};var $=a.fn.steps.contentMode={html:0,iframe:1,async:2},_=a.fn.steps.stepsOrientation={horizontal:0,vertical:1},ab=a.fn.steps.transitionEffect={none:0,fade:1,slide:2,slideLeft:3},bb=a.fn.steps.stepModel={title:"",content:"",contentUrl:"",contentMode:$.html,contentLoaded:!1},cb=a.fn.steps.defaults={headerTag:"h1",bodyTag:"div",contentContainerTag:"div",actionContainerTag:"div",stepsContainerTag:"div",cssClass:"wizard",clearFixCssClass:"clearfix",stepsOrientation:_.horizontal,titleTemplate:'<span class="number">#index#.</span> #title#',loadingTemplate:'<span class="spinner"></span> #text#',autoFocus:!1,enableAllSteps:!1,enableKeyNavigation:!0,enablePagination:!0,suppressPaginationOnFocus:!0,enableContentCache:!0,enableCancelButton:!1,enableFinishButton:!0,preloadContent:!1,showFinishButtonAlways:!1,forceMoveForward:!1,saveState:!1,startIndex:0,transitionEffect:ab.none,transitionEffectSpeed:200,onStepChanging:function(){return!0},onStepChanged:function(){},onCanceled:function(){},onFinishing:function(){return!0},onFinished:function(){},onContentLoaded:function(){},onInit:function(){},labels:{cancel:"Cancel",current:"current step:",pagination:"Pagination",finish:"Finish",next:"Next",previous:"Previous",loading:"Loading ..."}}}(jQuery);
|
resources/js/wizard.js
ADDED
File without changes
|
src/common/icwp-data.php
CHANGED
@@ -1,573 +1,622 @@
|
|
1 |
<?php
|
2 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
}
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
47 |
}
|
|
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
foreach ( $aArray2 as $key => $Value ) {
|
56 |
-
if ( array_key_exists( $key, $aArray1 ) && is_array( $Value ) ) {
|
57 |
-
$aArray1[ $key ] = $this->mergeArraysRecursive( $aArray1[ $key ], $aArray2[ $key ] );
|
58 |
-
}
|
59 |
-
else {
|
60 |
-
$aArray1[ $key ] = $Value;
|
61 |
-
}
|
62 |
-
}
|
63 |
-
return $aArray1;
|
64 |
-
}
|
65 |
-
/**
|
66 |
-
* @return string URI Path in lowercase
|
67 |
-
*/
|
68 |
-
public function getRequestPath() {
|
69 |
-
$aRequestParts = $this->getRequestUriParts();
|
70 |
-
return $aRequestParts[ 'path' ];
|
71 |
-
}
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
*/
|
76 |
-
public function getRequestUri() {
|
77 |
-
return $this->FetchServer( 'REQUEST_URI' );
|
78 |
}
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
* @return array
|
83 |
-
*/
|
84 |
-
public function getRawRequestParams( $bIncludeCookie = true ) {
|
85 |
-
$aParams = array_merge( $_GET, $_POST );
|
86 |
-
return $bIncludeCookie ? array_merge( $aParams, $_COOKIE ) : $aParams;
|
87 |
}
|
|
|
|
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
}
|
100 |
-
return $this->aRequestUriParts;
|
101 |
-
}
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
113 |
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
-
return $sPath;
|
118 |
}
|
119 |
|
120 |
-
|
121 |
-
|
122 |
-
* @param string $sNeedle
|
123 |
-
* @return bool
|
124 |
-
*/
|
125 |
-
public function getIfStringEndsIn( $sHaystack, $sNeedle ) {
|
126 |
-
$nNeedleLength = strlen( $sNeedle );
|
127 |
-
$sStringEndsIn = substr( $sHaystack, strlen( $sHaystack ) - $nNeedleLength, $nNeedleLength );
|
128 |
-
return ( $sStringEndsIn == $sNeedle );
|
129 |
-
}
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
return ( $nLastPeriod === false ) ? $sPath : str_replace( '.', '', substr( $sPath, $nLastPeriod ) );
|
138 |
-
}
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
public function extractCommaSeparatedList( $sRawList = '' ) {
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
return $aRawList;
|
156 |
}
|
157 |
-
|
158 |
-
$
|
159 |
-
|
160 |
-
$
|
161 |
-
|
162 |
-
|
163 |
-
if ( empty( $sRawLine ) ) {
|
164 |
continue;
|
165 |
}
|
166 |
-
$
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$bHadStar = true;
|
174 |
-
}
|
175 |
-
else {
|
176 |
-
//If there's only 1 item on the line, we assume it to be a global
|
177 |
-
// parameter rule
|
178 |
-
if ( count( $aParts ) == 1 || empty( $aParts[ 1 ] ) ) { // there was no comma in this line in the first place
|
179 |
-
array_unshift( $aParts, '*' );
|
180 |
-
}
|
181 |
}
|
182 |
-
|
183 |
-
$aParams = empty( $aParts[ 1 ] ) ? array() : explode( ',', $aParts[ 1 ] );
|
184 |
-
$aNewList[ $aParts[ 0 ] ] = $aParams;
|
185 |
}
|
186 |
-
return $aNewList;
|
187 |
-
}
|
188 |
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
$sUserAgent = self::FetchServer( 'HTTP_USER_AGENT' );
|
195 |
-
if ( empty( $sUserAgent ) ) {
|
196 |
-
return false;
|
197 |
-
}
|
198 |
|
199 |
-
|
200 |
-
|
|
|
|
|
201 |
|
202 |
-
|
|
|
|
|
203 |
}
|
204 |
|
205 |
-
|
206 |
-
|
207 |
-
* @param integer $nLength
|
208 |
-
* @param integer $nStrength
|
209 |
-
* @param boolean $bIgnoreAmb
|
210 |
-
* @return string
|
211 |
-
*/
|
212 |
-
static public function GenerateRandomString( $nLength = 10, $nStrength = 7, $bIgnoreAmb = true ) {
|
213 |
-
$aChars = array( 'abcdefghijkmnopqrstuvwxyz' );
|
214 |
-
|
215 |
-
if ( $nStrength & 2 ) {
|
216 |
-
$aChars[] = '023456789';
|
217 |
-
}
|
218 |
-
|
219 |
-
if ( $nStrength & 4 ) {
|
220 |
-
$aChars[] = 'ABCDEFGHJKLMNPQRSTUVWXYZ';
|
221 |
-
}
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
}
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
231 |
-
|
232 |
-
$
|
233 |
-
for ( $i = 0; $i < $nLength; $i++ ) {
|
234 |
-
$sPassword .= $sCharset[ ( rand() % strlen( $sCharset ) ) ];
|
235 |
-
}
|
236 |
-
return $sPassword;
|
237 |
}
|
238 |
|
239 |
-
|
240 |
-
|
241 |
-
*/
|
242 |
-
static public function GenerateRandomLetter() {
|
243 |
-
$sAtoZ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
244 |
-
$nRandomInt = rand( 0, ( strlen( $sAtoZ ) - 1 ) );
|
245 |
-
return $sAtoZ[ $nRandomInt ];
|
246 |
}
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
*/
|
251 |
-
static public function GetIsRequestPost() {
|
252 |
-
return ( self::GetRequestMethod() == 'post' );
|
253 |
}
|
254 |
|
255 |
-
|
256 |
-
|
257 |
-
* @return bool|string
|
258 |
-
*/
|
259 |
-
static public function GetRequestMethod() {
|
260 |
-
$sRequestMethod = self::FetchServer( 'REQUEST_METHOD' );
|
261 |
-
return ( empty( $sRequestMethod ) ? false : strtolower( $sRequestMethod ) );
|
262 |
}
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
$sScriptName = self::FetchServer( 'SCRIPT_NAME' );
|
269 |
-
return !empty( $sScriptName ) ? $sScriptName : self::FetchServer( 'PHP_SELF' );
|
270 |
}
|
|
|
|
|
271 |
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
|
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
public static function ArrayFetch( &$aArray, $sKey, $mDefault = null ) {
|
286 |
-
if ( !isset( $aArray[ $sKey ] ) ) {
|
287 |
-
return $mDefault;
|
288 |
-
}
|
289 |
-
return $aArray[ $sKey ];
|
290 |
-
}
|
291 |
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
}
|
304 |
-
return self::ArrayFetch( $_COOKIE, $sKey, $mDefault );
|
305 |
}
|
|
|
|
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
}
|
318 |
}
|
319 |
-
return self::ArrayFetch( $_ENV, $sKey, $mDefault );
|
320 |
}
|
|
|
|
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
}
|
333 |
}
|
334 |
-
return self::ArrayFetch( $_GET, $sKey, $mDefault );
|
335 |
}
|
|
|
|
|
336 |
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
}
|
348 |
}
|
349 |
-
return self::ArrayFetch( $_POST, $sKey, $mDefault );
|
350 |
}
|
|
|
|
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
}
|
365 |
}
|
366 |
-
return is_null( $mFetchVal ) ? $mDefault : $mFetchVal;
|
367 |
}
|
|
|
|
|
368 |
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
}
|
380 |
}
|
381 |
-
return self::ArrayFetch( $_SERVER, $sKey, $mDefault );
|
382 |
}
|
|
|
|
|
383 |
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
}
|
478 |
-
else {
|
479 |
-
return $sVersion;
|
480 |
-
}
|
481 |
}
|
482 |
-
|
483 |
-
|
484 |
-
* @param string $sAtLeastVersion
|
485 |
-
* @return bool
|
486 |
-
*/
|
487 |
-
public function getPhpVersionIsAtLeast( $sAtLeastVersion ) {
|
488 |
-
return version_compare( $this->getPhpVersion(), $sAtLeastVersion, '>=' );
|
489 |
}
|
|
|
490 |
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
|
|
497 |
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
&& function_exists( 'openssl_verify' )
|
505 |
-
&& defined( 'OPENSSL_ALGO_SHA1' );
|
506 |
-
}
|
507 |
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
518 |
}
|
519 |
-
return $oObject;
|
520 |
}
|
|
|
|
|
521 |
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
|
539 |
-
|
540 |
-
|
541 |
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
}
|
550 |
-
|
551 |
-
return $aSubjectArray;
|
552 |
}
|
553 |
|
554 |
-
|
555 |
-
|
556 |
-
* @param string $sDomainName
|
557 |
-
* @return bool
|
558 |
-
*/
|
559 |
-
public function isValidDomainName( $sDomainName ) {
|
560 |
-
$sDomainName = trim( $sDomainName );
|
561 |
-
return ( preg_match( "/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $sDomainName ) //valid chars check
|
562 |
-
&& preg_match( "/^.{1,253}$/", $sDomainName ) //overall length check
|
563 |
-
&& preg_match( "/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $sDomainName ) );//length of each label
|
564 |
-
}
|
565 |
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
}
|
573 |
-
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_DataProcessor', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
+
|
6 |
+
class ICWP_WPSF_DataProcessor extends ICWP_WPSF_Foundation {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_DataProcessor
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var bool
|
15 |
+
*/
|
16 |
+
public static $bUseFilterInput = false;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var integer
|
20 |
+
*/
|
21 |
+
protected static $nRequestTime;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
protected $aRequestUriParts;
|
27 |
+
|
28 |
+
protected function __construct() {}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @return ICWP_WPSF_DataProcessor
|
32 |
+
*/
|
33 |
+
public static function GetInstance() {
|
34 |
+
if ( is_null( self::$oInstance ) ) {
|
35 |
+
self::$oInstance = new self();
|
36 |
+
}
|
37 |
+
return self::$oInstance;
|
38 |
+
}
|
39 |
|
40 |
+
/**
|
41 |
+
* @return int
|
42 |
+
*/
|
43 |
+
public static function GetRequestTime() {
|
44 |
+
if ( empty( self::$nRequestTime ) ) {
|
45 |
+
self::$nRequestTime = time();
|
46 |
+
}
|
47 |
+
return self::$nRequestTime;
|
48 |
+
}
|
49 |
|
50 |
+
/**
|
51 |
+
* @param array $aArray1
|
52 |
+
* @param array $aArray2
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function mergeArraysRecursive( $aArray1, $aArray2 ) {
|
56 |
+
foreach ( $aArray2 as $key => $Value ) {
|
57 |
+
if ( array_key_exists( $key, $aArray1 ) && is_array( $Value ) ) {
|
58 |
+
$aArray1[ $key ] = $this->mergeArraysRecursive( $aArray1[ $key ], $aArray2[ $key ] );
|
59 |
+
}
|
60 |
+
else {
|
61 |
+
$aArray1[ $key ] = $Value;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
return $aArray1;
|
65 |
+
}
|
66 |
|
67 |
+
/**
|
68 |
+
* @param string $sKey
|
69 |
+
* @param null $mDefault
|
70 |
+
* @param bool $bTrim -automatically trim whitespace
|
71 |
+
* @return mixed|null
|
72 |
+
*/
|
73 |
+
public function query( $sKey, $mDefault = null, $bTrim = true ) {
|
74 |
+
$mVal = $this->FetchGet( $sKey, $mDefault );
|
75 |
+
return ( $bTrim && is_scalar( $mVal ) ) ? trim( $mVal ) : $mVal;
|
76 |
+
}
|
77 |
|
78 |
+
/**
|
79 |
+
* @param string $sKey
|
80 |
+
* @param null $mDefault
|
81 |
+
* @param bool $bTrim -automatically trim whitespace
|
82 |
+
* @return mixed|null
|
83 |
+
*/
|
84 |
+
public function post( $sKey, $mDefault = null, $bTrim = true ) {
|
85 |
+
$mVal = $this->FetchPost( $sKey, $mDefault );
|
86 |
+
return ( $bTrim && is_scalar( $mVal ) ) ? trim( $mVal ) : $mVal;
|
87 |
+
}
|
88 |
|
89 |
+
/**
|
90 |
+
* @return string URI Path in lowercase
|
91 |
+
*/
|
92 |
+
public function getRequestPath() {
|
93 |
+
$aRequestParts = $this->getRequestUriParts();
|
94 |
+
return $aRequestParts[ 'path' ];
|
95 |
+
}
|
96 |
|
97 |
+
/**
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
public function getRequestUri() {
|
101 |
+
return $this->FetchServer( 'REQUEST_URI' );
|
102 |
+
}
|
103 |
|
104 |
+
/**
|
105 |
+
* @param bool $bIncludeCookie
|
106 |
+
* @return array
|
107 |
+
*/
|
108 |
+
public function getRawRequestParams( $bIncludeCookie = true ) {
|
109 |
+
$aParams = array_merge( $_GET, $_POST );
|
110 |
+
return $bIncludeCookie ? array_merge( $aParams, $_COOKIE ) : $aParams;
|
111 |
+
}
|
|
|
112 |
|
113 |
+
/**
|
114 |
+
* @return array
|
115 |
+
*/
|
116 |
+
public function getRequestUriParts() {
|
117 |
+
if ( !isset( $this->aRequestUriParts ) ) {
|
118 |
+
$aExploded = explode( '?', $this->getRequestUri(), 2 );
|
119 |
+
$this->aRequestUriParts = array(
|
120 |
+
'path' => empty( $aExploded[ 0 ] ) ? '' : $aExploded[ 0 ],
|
121 |
+
'query' => empty( $aExploded[ 1 ] ) ? '' : $aExploded[ 1 ],
|
122 |
+
);
|
123 |
}
|
124 |
+
return $this->aRequestUriParts;
|
125 |
+
}
|
126 |
|
127 |
+
/**
|
128 |
+
* @param string $sPath
|
129 |
+
* @param string $sExtensionToAdd
|
130 |
+
* @return string
|
131 |
+
*/
|
132 |
+
public function addExtensionToFilePath( $sPath, $sExtensionToAdd ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
+
if ( strpos( $sExtensionToAdd, '.' ) === false ) {
|
135 |
+
$sExtensionToAdd = '.'.$sExtensionToAdd;
|
|
|
|
|
|
|
136 |
}
|
137 |
|
138 |
+
if ( !$this->getIfStringEndsIn( $sPath, $sExtensionToAdd ) ) {
|
139 |
+
$sPath = $sPath.$sExtensionToAdd;
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
+
return $sPath;
|
142 |
+
}
|
143 |
|
144 |
+
/**
|
145 |
+
* @param string $sHaystack
|
146 |
+
* @param string $sNeedle
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public function getIfStringEndsIn( $sHaystack, $sNeedle ) {
|
150 |
+
$nNeedleLength = strlen( $sNeedle );
|
151 |
+
$sStringEndsIn = substr( $sHaystack, strlen( $sHaystack ) - $nNeedleLength, $nNeedleLength );
|
152 |
+
return ( $sStringEndsIn == $sNeedle );
|
153 |
+
}
|
|
|
|
|
|
|
154 |
|
155 |
+
/**
|
156 |
+
* @param string $sPath
|
157 |
+
* @return string
|
158 |
+
*/
|
159 |
+
public function getExtension( $sPath ) {
|
160 |
+
$nLastPeriod = strrpos( $sPath, '.' );
|
161 |
+
return ( $nLastPeriod === false ) ? $sPath : str_replace( '.', '', substr( $sPath, $nLastPeriod ) );
|
162 |
+
}
|
163 |
|
164 |
+
/**
|
165 |
+
* @param string $sUrl
|
166 |
+
* @return string
|
167 |
+
*/
|
168 |
+
public function urlStripQueryPart( $sUrl ) {
|
169 |
+
return preg_replace( '#\s?\?.*$#', '', $sUrl );
|
170 |
+
}
|
171 |
|
172 |
+
/**
|
173 |
+
* Will strip everything from a URL except Scheme+Host and requires that Scheme+Host be present
|
174 |
+
* @return string|false
|
175 |
+
*/
|
176 |
+
public function validateSimpleHttpUrl( $sUrl ) {
|
177 |
+
$sValidatedUrl = false;
|
178 |
+
|
179 |
+
$sUrl = trim( $this->urlStripQueryPart( $sUrl ) );
|
180 |
+
if ( filter_var( $sUrl, FILTER_VALIDATE_URL ) ) { // we have a scheme+host
|
181 |
+
$aParts = parse_url( $sUrl );
|
182 |
+
if ( in_array( $aParts[ 'scheme' ], array( 'http', 'https' ) ) ) {
|
183 |
+
$sValidatedUrl = rtrim( $sUrl, '/' );
|
184 |
}
|
|
|
185 |
}
|
186 |
|
187 |
+
return $sValidatedUrl;
|
188 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
|
190 |
+
/**
|
191 |
+
* @return boolean
|
192 |
+
*/
|
193 |
+
public function validEmail( $sEmail ) {
|
194 |
+
return ( !empty( $sEmail ) && function_exists( 'is_email' ) && is_email( $sEmail ) );
|
195 |
+
}
|
|
|
|
|
196 |
|
197 |
+
/**
|
198 |
+
* @param string $sRawList
|
199 |
+
* @return array
|
200 |
+
*/
|
201 |
+
public function extractCommaSeparatedList( $sRawList = '' ) {
|
202 |
+
|
203 |
+
$aRawList = array();
|
204 |
+
if ( empty( $sRawList ) ) {
|
205 |
+
return $aRawList;
|
206 |
}
|
207 |
|
208 |
+
$aRawList = array_map( 'trim', preg_split( '/\r\n|\r|\n/', $sRawList ) );
|
209 |
+
$aNewList = array();
|
210 |
+
$bHadStar = false;
|
211 |
+
foreach ( $aRawList as $sKey => $sRawLine ) {
|
|
|
212 |
|
213 |
+
if ( empty( $sRawLine ) ) {
|
214 |
+
continue;
|
|
|
215 |
}
|
216 |
+
$sRawLine = str_replace( ' ', '', $sRawLine );
|
217 |
+
$aParts = explode( ',', $sRawLine, 2 );
|
218 |
+
// we only permit 1x line beginning with *
|
219 |
+
if ( $aParts[ 0 ] == '*' ) {
|
220 |
+
if ( $bHadStar ) {
|
|
|
|
|
221 |
continue;
|
222 |
}
|
223 |
+
$bHadStar = true;
|
224 |
+
}
|
225 |
+
else {
|
226 |
+
//If there's only 1 item on the line, we assume it to be a global
|
227 |
+
// parameter rule
|
228 |
+
if ( count( $aParts ) == 1 || empty( $aParts[ 1 ] ) ) { // there was no comma in this line in the first place
|
229 |
+
array_unshift( $aParts, '*' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
|
|
|
|
|
|
231 |
}
|
|
|
|
|
232 |
|
233 |
+
$aParams = empty( $aParts[ 1 ] ) ? array() : explode( ',', $aParts[ 1 ] );
|
234 |
+
$aNewList[ $aParts[ 0 ] ] = $aParams;
|
235 |
+
}
|
236 |
+
return $aNewList;
|
237 |
+
}
|
|
|
|
|
|
|
|
|
238 |
|
239 |
+
/**
|
240 |
+
* Taken from http://www.phacks.net/detecting-search-engine-bot-and-web-spiders/
|
241 |
+
*/
|
242 |
+
public static function IsSearchEngineBot() {
|
243 |
|
244 |
+
$sUserAgent = self::FetchServer( 'HTTP_USER_AGENT' );
|
245 |
+
if ( empty( $sUserAgent ) ) {
|
246 |
+
return false;
|
247 |
}
|
248 |
|
249 |
+
$sBots = 'Googlebot|bingbot|Twitterbot|Baiduspider|ia_archiver|R6_FeedFetcher|NetcraftSurveyAgent'
|
250 |
+
.'|Sogou web spider|Yahoo! Slurp|facebookexternalhit|PrintfulBot|msnbot|UnwindFetchor|urlresolver|Butterfly|TweetmemeBot';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
+
return ( preg_match( "/$sBots/", $sUserAgent ) > 0 );
|
253 |
+
}
|
|
|
254 |
|
255 |
+
/**
|
256 |
+
* Strength can be 1, 3, 7, 15
|
257 |
+
* @param integer $nLength
|
258 |
+
* @param integer $nStrength
|
259 |
+
* @param boolean $bIgnoreAmb
|
260 |
+
* @return string
|
261 |
+
*/
|
262 |
+
static public function GenerateRandomString( $nLength = 10, $nStrength = 7, $bIgnoreAmb = true ) {
|
263 |
+
$aChars = array( 'abcdefghijkmnopqrstuvwxyz' );
|
264 |
|
265 |
+
if ( $nStrength & 2 ) {
|
266 |
+
$aChars[] = '023456789';
|
|
|
|
|
|
|
|
|
267 |
}
|
268 |
|
269 |
+
if ( $nStrength & 4 ) {
|
270 |
+
$aChars[] = 'ABCDEFGHJKLMNPQRSTUVWXYZ';
|
|
|
|
|
|
|
|
|
|
|
271 |
}
|
272 |
|
273 |
+
if ( $nStrength & 8 ) {
|
274 |
+
$aChars[] = '$%^&*#';
|
|
|
|
|
|
|
275 |
}
|
276 |
|
277 |
+
if ( !$bIgnoreAmb ) {
|
278 |
+
$aChars[] = 'OOlI1';
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
|
281 |
+
$sPassword = '';
|
282 |
+
$sCharset = implode( '', $aChars );
|
283 |
+
for ( $i = 0 ; $i < $nLength ; $i++ ) {
|
284 |
+
$sPassword .= $sCharset[ ( rand()%strlen( $sCharset ) ) ];
|
|
|
|
|
285 |
}
|
286 |
+
return $sPassword;
|
287 |
+
}
|
288 |
|
289 |
+
/**
|
290 |
+
* @return string
|
291 |
+
*/
|
292 |
+
static public function GenerateRandomLetter() {
|
293 |
+
$sAtoZ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
294 |
+
$nRandomInt = rand( 0, ( strlen( $sAtoZ ) - 1 ) );
|
295 |
+
return $sAtoZ[ $nRandomInt ];
|
296 |
+
}
|
297 |
|
298 |
+
/**
|
299 |
+
* @return bool
|
300 |
+
*/
|
301 |
+
static public function GetIsRequestPost() {
|
302 |
+
return ( self::GetRequestMethod() == 'post' );
|
303 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
|
305 |
+
/**
|
306 |
+
* Returns the current request method as an all-lower-case string
|
307 |
+
* @return bool|string
|
308 |
+
*/
|
309 |
+
static public function GetRequestMethod() {
|
310 |
+
$sRequestMethod = self::FetchServer( 'REQUEST_METHOD' );
|
311 |
+
return ( empty( $sRequestMethod ) ? false : strtolower( $sRequestMethod ) );
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* @return string|null
|
316 |
+
*/
|
317 |
+
static public function GetScriptName() {
|
318 |
+
$sScriptName = self::FetchServer( 'SCRIPT_NAME' );
|
319 |
+
return !empty( $sScriptName ) ? $sScriptName : self::FetchServer( 'PHP_SELF' );
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* @return bool
|
324 |
+
*/
|
325 |
+
static public function GetUseFilterInput() {
|
326 |
+
return self::$bUseFilterInput && function_exists( 'filter_input' );
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* @param array $aArray
|
331 |
+
* @param string $sKey The array key to fetch
|
332 |
+
* @param mixed $mDefault
|
333 |
+
* @return mixed|null
|
334 |
+
*/
|
335 |
+
public static function ArrayFetch( &$aArray, $sKey, $mDefault = null ) {
|
336 |
+
if ( !isset( $aArray[ $sKey ] ) ) {
|
337 |
+
return $mDefault;
|
338 |
+
}
|
339 |
+
return $aArray[ $sKey ];
|
340 |
+
}
|
341 |
+
|
342 |
+
/**
|
343 |
+
* @param string $sKey The $_COOKIE key
|
344 |
+
* @param mixed $mDefault
|
345 |
+
* @return mixed|null
|
346 |
+
*/
|
347 |
+
public static function FetchCookie( $sKey, $mDefault = null ) {
|
348 |
+
if ( self::GetUseFilterInput() && defined( 'INPUT_COOKIE' ) ) {
|
349 |
+
$mPossible = filter_input( INPUT_COOKIE, $sKey );
|
350 |
+
if ( !empty( $mPossible ) ) {
|
351 |
+
return $mPossible;
|
352 |
}
|
|
|
353 |
}
|
354 |
+
return self::ArrayFetch( $_COOKIE, $sKey, $mDefault );
|
355 |
+
}
|
356 |
|
357 |
+
/**
|
358 |
+
* @param string $sKey
|
359 |
+
* @param mixed $mDefault
|
360 |
+
* @return mixed|null
|
361 |
+
*/
|
362 |
+
public static function FetchEnv( $sKey, $mDefault = null ) {
|
363 |
+
if ( self::GetUseFilterInput() && defined( 'INPUT_ENV' ) ) {
|
364 |
+
$sPossible = filter_input( INPUT_ENV, $sKey );
|
365 |
+
if ( !empty( $sPossible ) ) {
|
366 |
+
return $sPossible;
|
|
|
367 |
}
|
|
|
368 |
}
|
369 |
+
return self::ArrayFetch( $_ENV, $sKey, $mDefault );
|
370 |
+
}
|
371 |
|
372 |
+
/**
|
373 |
+
* @param string $sKey
|
374 |
+
* @param mixed $mDefault
|
375 |
+
* @return mixed|null
|
376 |
+
*/
|
377 |
+
public static function FetchGet( $sKey, $mDefault = null ) {
|
378 |
+
if ( self::GetUseFilterInput() && defined( 'INPUT_GET' ) ) {
|
379 |
+
$mPossible = filter_input( INPUT_GET, $sKey );
|
380 |
+
if ( !empty( $mPossible ) ) {
|
381 |
+
return $mPossible;
|
|
|
382 |
}
|
|
|
383 |
}
|
384 |
+
return self::ArrayFetch( $_GET, $sKey, $mDefault );
|
385 |
+
}
|
386 |
|
387 |
+
/**
|
388 |
+
* @param string $sKey The $_POST key
|
389 |
+
* @param mixed $mDefault
|
390 |
+
* @return mixed|null
|
391 |
+
*/
|
392 |
+
public static function FetchPost( $sKey, $mDefault = null ) {
|
393 |
+
if ( self::GetUseFilterInput() && defined( 'INPUT_POST' ) ) {
|
394 |
+
$mPossible = filter_input( INPUT_POST, $sKey );
|
395 |
+
if ( !empty( $mPossible ) ) {
|
396 |
+
return $mPossible;
|
|
|
397 |
}
|
|
|
398 |
}
|
399 |
+
return self::ArrayFetch( $_POST, $sKey, $mDefault );
|
400 |
+
}
|
401 |
|
402 |
+
/**
|
403 |
+
* @param string $sKey
|
404 |
+
* @param boolean $bIncludeCookie
|
405 |
+
* @param mixed $mDefault
|
406 |
+
* @return mixed|null
|
407 |
+
*/
|
408 |
+
public static function FetchRequest( $sKey, $bIncludeCookie = false, $mDefault = null ) {
|
409 |
+
$mFetchVal = self::FetchPost( $sKey );
|
410 |
+
if ( is_null( $mFetchVal ) ) {
|
411 |
+
$mFetchVal = self::FetchGet( $sKey );
|
412 |
+
if ( is_null( $mFetchVal && $bIncludeCookie ) ) {
|
413 |
+
$mFetchVal = self::FetchCookie( $sKey );
|
|
|
414 |
}
|
|
|
415 |
}
|
416 |
+
return is_null( $mFetchVal ) ? $mDefault : $mFetchVal;
|
417 |
+
}
|
418 |
|
419 |
+
/**
|
420 |
+
* @param string $sKey
|
421 |
+
* @param mixed $mDefault
|
422 |
+
* @return mixed|null
|
423 |
+
*/
|
424 |
+
public static function FetchServer( $sKey, $mDefault = null ) {
|
425 |
+
if ( self::GetUseFilterInput() && defined( 'INPUT_SERVER' ) ) {
|
426 |
+
$sPossible = filter_input( INPUT_SERVER, $sKey );
|
427 |
+
if ( !empty( $sPossible ) ) {
|
428 |
+
return $sPossible;
|
|
|
429 |
}
|
|
|
430 |
}
|
431 |
+
return self::ArrayFetch( $_SERVER, $sKey, $mDefault );
|
432 |
+
}
|
433 |
|
434 |
+
/**
|
435 |
+
* @param string $sRequestedUrl
|
436 |
+
* @param string $sBaseUrl
|
437 |
+
*/
|
438 |
+
public function doSendApache404( $sRequestedUrl, $sBaseUrl ) {
|
439 |
+
$bForwardedProto = $this->FetchServer( 'HTTP_X_FORWARDED_PROTO' ) == 'https';
|
440 |
+
header( 'HTTP/1.1 404 Not Found' );
|
441 |
+
$sDie = sprintf(
|
442 |
+
'<html><head><title>404 Not Found</title><style type="text/css"></style></head><body><h1>Not Found</h1><p>The requested URL %s was not found on this server.</p><p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p><hr><address>Apache Server at %s Port %s</address></body></html>',
|
443 |
+
$sRequestedUrl,
|
444 |
+
$sBaseUrl,
|
445 |
+
( $bForwardedProto || is_ssl() ) ? 443 : $this->FetchServer( 'SERVER_PORT' )
|
446 |
+
);
|
447 |
+
die( $sDie );
|
448 |
+
}
|
449 |
|
450 |
+
/**
|
451 |
+
* @param string $sStringContent
|
452 |
+
* @param string $sFilename
|
453 |
+
* @return bool
|
454 |
+
*/
|
455 |
+
public function downloadStringAsFile( $sStringContent, $sFilename ) {
|
456 |
+
header( "Content-type: application/octet-stream" );
|
457 |
+
header( "Content-disposition: attachment; filename=".$sFilename );
|
458 |
+
header( "Content-Transfer-Encoding: binary" );
|
459 |
+
header( "Content-Length: ".strlen( $sStringContent ) );
|
460 |
+
echo $sStringContent;
|
461 |
+
die();
|
462 |
+
}
|
463 |
|
464 |
+
/**
|
465 |
+
* Use this to reliably read the contents of a PHP file that doesn't have executable
|
466 |
+
* PHP Code.
|
467 |
+
* Why use this? In the name of naive security, silly web hosts can prevent reading the contents of
|
468 |
+
* non-PHP files so we simply put the content we want to have read into a php file and then "include" it.
|
469 |
+
* @param string $sFile
|
470 |
+
* @return string
|
471 |
+
*/
|
472 |
+
public function readFileContentsUsingInclude( $sFile ) {
|
473 |
+
ob_start();
|
474 |
+
include( $sFile );
|
475 |
+
return ob_get_clean();
|
476 |
+
}
|
477 |
|
478 |
+
/**
|
479 |
+
* @param $sKey
|
480 |
+
* @param $mValue
|
481 |
+
* @param int $nExpireLength
|
482 |
+
* @param null $sPath
|
483 |
+
* @param null $sDomain
|
484 |
+
* @param bool $bSsl
|
485 |
+
* @return bool
|
486 |
+
*/
|
487 |
+
public function setCookie( $sKey, $mValue, $nExpireLength = 3600, $sPath = null, $sDomain = null, $bSsl = false ) {
|
488 |
+
if ( function_exists( 'headers_sent' ) && headers_sent() ) {
|
489 |
+
return false;
|
490 |
+
}
|
491 |
+
$_COOKIE[ $sKey ] = $mValue;
|
492 |
+
return setcookie(
|
493 |
+
$sKey,
|
494 |
+
$mValue,
|
495 |
+
(int)( $this->time() + $nExpireLength ),
|
496 |
+
( is_null( $sPath ) && defined( 'COOKIEPATH' ) ) ? COOKIEPATH : $sPath,
|
497 |
+
( is_null( $sDomain ) && defined( 'COOKIE_DOMAIN' ) ) ? COOKIE_DOMAIN : $sDomain,
|
498 |
+
$bSsl
|
499 |
+
);
|
500 |
+
}
|
501 |
|
502 |
+
/**
|
503 |
+
* @param string $sKey
|
504 |
+
* @return bool
|
505 |
+
*/
|
506 |
+
public function setDeleteCookie( $sKey ) {
|
507 |
+
unset( $_COOKIE[ $sKey ] );
|
508 |
+
return $this->setCookie( $sKey, '', -3600 );
|
509 |
+
}
|
510 |
|
511 |
+
/**
|
512 |
+
* @return string
|
513 |
+
*/
|
514 |
+
public function getPhpVersion() {
|
515 |
+
return ( defined( 'PHP_VERSION' ) ? PHP_VERSION : phpversion() );
|
516 |
+
}
|
517 |
|
518 |
+
/**
|
519 |
+
* Cleans out any of the junk that can appear in a PHP version and returns just the 5.4.45
|
520 |
+
* e.g. 5.4.45-0+deb7u5
|
521 |
+
* @return string
|
522 |
+
*/
|
523 |
+
public function getPhpVersionCleaned() {
|
524 |
+
$sVersion = $this->getPhpVersion();
|
525 |
+
if ( preg_match( '#^[0-9]{1}\.[0-9]{1}(\.[0-9]{1,3})?#', $sVersion, $aMatches ) ) {
|
526 |
+
return $aMatches[ 0 ];
|
|
|
|
|
|
|
|
|
527 |
}
|
528 |
+
else {
|
529 |
+
return $sVersion;
|
|
|
|
|
|
|
|
|
|
|
530 |
}
|
531 |
+
}
|
532 |
|
533 |
+
/**
|
534 |
+
* @param string $sAtLeastVersion
|
535 |
+
* @return bool
|
536 |
+
*/
|
537 |
+
public function getPhpVersionIsAtLeast( $sAtLeastVersion ) {
|
538 |
+
return version_compare( $this->getPhpVersion(), $sAtLeastVersion, '>=' );
|
539 |
+
}
|
540 |
|
541 |
+
/**
|
542 |
+
* @return bool
|
543 |
+
*/
|
544 |
+
public function getPhpSupportsNamespaces() {
|
545 |
+
return $this->getPhpVersionIsAtLeast( '5.3' );
|
546 |
+
}
|
|
|
|
|
|
|
547 |
|
548 |
+
/**
|
549 |
+
* @return bool
|
550 |
+
*/
|
551 |
+
public function getCanOpensslSign() {
|
552 |
+
return function_exists( 'base64_decode' )
|
553 |
+
&& function_exists( 'openssl_sign' )
|
554 |
+
&& function_exists( 'openssl_verify' )
|
555 |
+
&& defined( 'OPENSSL_ALGO_SHA1' );
|
556 |
+
}
|
557 |
+
|
558 |
+
/**
|
559 |
+
* @param array $aArray
|
560 |
+
* @return stdClass
|
561 |
+
*/
|
562 |
+
public function convertArrayToStdClass( $aArray ) {
|
563 |
+
$oObject = new stdClass();
|
564 |
+
if ( !empty( $aArray ) && is_array( $aArray ) ) {
|
565 |
+
foreach ( $aArray as $sKey => $mValue ) {
|
566 |
+
$oObject->{$sKey} = $mValue;
|
567 |
}
|
|
|
568 |
}
|
569 |
+
return $oObject;
|
570 |
+
}
|
571 |
|
572 |
+
/**
|
573 |
+
* @param array $aSubjectArray
|
574 |
+
* @param mixed $mValue
|
575 |
+
* @param int $nDesiredPosition
|
576 |
+
* @return array
|
577 |
+
*/
|
578 |
+
public function setArrayValueToPosition( $aSubjectArray, $mValue, $nDesiredPosition ) {
|
579 |
|
580 |
+
if ( $nDesiredPosition < 0 ) {
|
581 |
+
return $aSubjectArray;
|
582 |
+
}
|
583 |
|
584 |
+
$nMaxPossiblePosition = count( $aSubjectArray ) - 1;
|
585 |
+
if ( $nDesiredPosition > $nMaxPossiblePosition ) {
|
586 |
+
$nDesiredPosition = $nMaxPossiblePosition;
|
587 |
+
}
|
588 |
|
589 |
+
$nPosition = array_search( $mValue, $aSubjectArray );
|
590 |
+
if ( $nPosition !== false && $nPosition != $nDesiredPosition ) {
|
591 |
|
592 |
+
// remove existing and reset index
|
593 |
+
unset( $aSubjectArray[ $nPosition ] );
|
594 |
+
$aSubjectArray = array_values( $aSubjectArray );
|
595 |
|
596 |
+
// insert and update
|
597 |
+
// http://stackoverflow.com/questions/3797239/insert-new-item-in-array-on-any-position-in-php
|
598 |
+
array_splice( $aSubjectArray, $nDesiredPosition, 0, $mValue );
|
|
|
|
|
|
|
599 |
}
|
600 |
|
601 |
+
return $aSubjectArray;
|
602 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
603 |
|
604 |
+
/**
|
605 |
+
* Taken from: http://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php
|
606 |
+
* @param string $sDomainName
|
607 |
+
* @return bool
|
608 |
+
*/
|
609 |
+
public function isValidDomainName( $sDomainName ) {
|
610 |
+
$sDomainName = trim( $sDomainName );
|
611 |
+
return ( preg_match( "/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $sDomainName ) //valid chars check
|
612 |
+
&& preg_match( "/^.{1,253}$/", $sDomainName ) //overall length check
|
613 |
+
&& preg_match( "/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $sDomainName ) );//length of each label
|
614 |
+
}
|
615 |
+
|
616 |
+
/**
|
617 |
+
* @return int
|
618 |
+
*/
|
619 |
+
public function time() {
|
620 |
+
return self::GetRequestTime();
|
621 |
}
|
622 |
+
}
|
src/common/icwp-edd.php
CHANGED
@@ -20,6 +20,43 @@ class ICWP_WPSF_Edd extends ICWP_WPSF_Foundation {
|
|
20 |
return self::$oInstance;
|
21 |
}
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
/**
|
24 |
* @param string $sStoreUrl
|
25 |
* @param string $sKey
|
20 |
return self::$oInstance;
|
21 |
}
|
22 |
|
23 |
+
/**
|
24 |
+
* A simple outgoing POST request to see that we can communicate with the ODP servers
|
25 |
+
* @param string $sStoreUrl
|
26 |
+
* @return string
|
27 |
+
*/
|
28 |
+
public function ping( $sStoreUrl ) {
|
29 |
+
$oLicense = null;
|
30 |
+
|
31 |
+
$sStoreUrl = add_query_arg(
|
32 |
+
array( 'license_ping' => 'Y' ),
|
33 |
+
$sStoreUrl
|
34 |
+
);
|
35 |
+
|
36 |
+
$aParams = array(
|
37 |
+
'method' => 'POST',
|
38 |
+
'body' => array(
|
39 |
+
'ping' => 'pong',
|
40 |
+
'license' => 'abcdefghi',
|
41 |
+
'item_id' => '123',
|
42 |
+
'url' => $this->loadWp()->getWpUrl()
|
43 |
+
)
|
44 |
+
);
|
45 |
+
|
46 |
+
$mResponse = $this->loadFS()
|
47 |
+
->requestUrl( $sStoreUrl, $aParams );
|
48 |
+
|
49 |
+
$sResult = 'Unknown error communicating with license server';
|
50 |
+
if ( is_array( $mResponse ) && !empty( $mResponse[ 'body' ] ) ) {
|
51 |
+
$aResult = @json_decode( $mResponse[ 'body' ], true );
|
52 |
+
$sResult = ( isset( $aResult[ 'success' ] ) && $aResult[ 'success' ] ) ? 'success' : 'unknown failure';
|
53 |
+
}
|
54 |
+
else if ( is_wp_error( $mResponse ) ) {
|
55 |
+
$sResult = $mResponse->get_error_message();
|
56 |
+
}
|
57 |
+
return $sResult;
|
58 |
+
}
|
59 |
+
|
60 |
/**
|
61 |
* @param string $sStoreUrl
|
62 |
* @param string $sKey
|
src/common/icwp-factory.php
CHANGED
@@ -6,14 +6,13 @@ if ( class_exists( 'ICWP_WPSF_Factory', false ) ) {
|
|
6 |
class ICWP_WPSF_Factory {
|
7 |
|
8 |
/**
|
9 |
-
* @param string $sOptionsName
|
10 |
* @return ICWP_WPSF_OptionsVO
|
11 |
*/
|
12 |
-
static public function OptionsVo(
|
13 |
if ( !class_exists( 'ICWP_WPSF_OptionsVO' ) ) {
|
14 |
require_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'icwp-optionsvo.php' );
|
15 |
}
|
16 |
-
return new ICWP_WPSF_OptionsVO(
|
17 |
}
|
18 |
|
19 |
/**
|
6 |
class ICWP_WPSF_Factory {
|
7 |
|
8 |
/**
|
|
|
9 |
* @return ICWP_WPSF_OptionsVO
|
10 |
*/
|
11 |
+
static public function OptionsVo() {
|
12 |
if ( !class_exists( 'ICWP_WPSF_OptionsVO' ) ) {
|
13 |
require_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'icwp-optionsvo.php' );
|
14 |
}
|
15 |
+
return new ICWP_WPSF_OptionsVO();
|
16 |
}
|
17 |
|
18 |
/**
|
src/common/icwp-foundation.php
CHANGED
@@ -314,8 +314,8 @@ class ICWP_WPSF_Foundation {
|
|
314 |
|
315 |
/**
|
316 |
*/
|
317 |
-
static public function
|
318 |
-
self::requireCommonLib( 'lib
|
319 |
}
|
320 |
|
321 |
/**
|
314 |
|
315 |
/**
|
316 |
*/
|
317 |
+
static public function loadAutoload() {
|
318 |
+
self::requireCommonLib( 'lib/vendor/autoload.php' );
|
319 |
}
|
320 |
|
321 |
/**
|
src/common/icwp-googlearecaptcha.php
CHANGED
@@ -1,45 +1,46 @@
|
|
1 |
<?php
|
2 |
-
if (
|
|
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
}
|
23 |
-
return self::$oInstance;
|
24 |
}
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
}
|
41 |
}
|
42 |
-
return self::$oGR;
|
43 |
}
|
|
|
44 |
}
|
45 |
-
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_GoogleRecaptcha', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
|
6 |
+
class ICWP_WPSF_GoogleRecaptcha {
|
7 |
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_GoogleRecaptcha
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
|
13 |
+
/**
|
14 |
+
* @var \ReCaptcha\ReCaptcha
|
15 |
+
*/
|
16 |
+
protected static $oGR;
|
17 |
|
18 |
+
/**
|
19 |
+
* @return ICWP_WPSF_GoogleRecaptcha
|
20 |
+
*/
|
21 |
+
public static function GetInstance() {
|
22 |
+
if ( is_null( self::$oInstance ) ) {
|
23 |
+
self::$oInstance = new self();
|
|
|
|
|
24 |
}
|
25 |
+
return self::$oInstance;
|
26 |
+
}
|
27 |
|
28 |
+
/**
|
29 |
+
*/
|
30 |
+
protected function loadGoogleRecaptchaLib() {
|
31 |
+
return require_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'googlerecaptcha/autoload.php' );
|
32 |
+
}
|
33 |
|
34 |
+
/**
|
35 |
+
* @param string $sSecret
|
36 |
+
* @return \ReCaptcha\ReCaptcha
|
37 |
+
*/
|
38 |
+
public function getGoogleRecaptchaLib( $sSecret ) {
|
39 |
+
if ( !isset( self::$oGR ) ) {
|
40 |
+
if ( $this->loadGoogleRecaptchaLib() ) {
|
41 |
+
self::$oGR = new \ReCaptcha\ReCaptcha( $sSecret, new \ReCaptcha\RequestMethod\WordpressPost() );
|
|
|
42 |
}
|
|
|
43 |
}
|
44 |
+
return self::$oGR;
|
45 |
}
|
46 |
+
}
|
src/common/icwp-googleauthenticator.php
CHANGED
@@ -1,72 +1,73 @@
|
|
1 |
<?php
|
2 |
-
if (
|
|
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
}
|
23 |
-
return self::$oInstance;
|
24 |
}
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
}
|
57 |
-
return class_exists( 'PHPGangsta_GoogleAuthenticator', false );
|
58 |
}
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
}
|
68 |
}
|
69 |
-
return self::$oGA;
|
70 |
}
|
|
|
71 |
}
|
72 |
-
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_GoogleAuthenticator', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
|
6 |
+
class ICWP_WPSF_GoogleAuthenticator {
|
7 |
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_GoogleAuthenticator
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
|
13 |
+
/**
|
14 |
+
* @var PHPGangsta_GoogleAuthenticator
|
15 |
+
*/
|
16 |
+
protected static $oGA;
|
17 |
|
18 |
+
/**
|
19 |
+
* @return ICWP_WPSF_GoogleAuthenticator
|
20 |
+
*/
|
21 |
+
public static function GetInstance() {
|
22 |
+
if ( is_null( self::$oInstance ) ) {
|
23 |
+
self::$oInstance = new self();
|
|
|
|
|
24 |
}
|
25 |
+
return self::$oInstance;
|
26 |
+
}
|
27 |
|
28 |
+
/**
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function generateNewSecret() {
|
32 |
+
return $this->getGoogleAuthenticatorLib()->createSecret();
|
33 |
+
}
|
34 |
|
35 |
+
/**
|
36 |
+
* @param string $sSecret
|
37 |
+
* @param string $sName
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
public function getGoogleQrChartUrl( $sSecret, $sName = 'icwp' ) {
|
41 |
+
return $this->getGoogleAuthenticatorLib()->getQRCodeGoogleUrl( $sName, $sSecret );
|
42 |
+
}
|
43 |
|
44 |
+
/**
|
45 |
+
* @param string $sSecret
|
46 |
+
* @param string $sPassword
|
47 |
+
* @return bool
|
48 |
+
*/
|
49 |
+
public function verifyOtp( $sSecret, $sPassword ) {
|
50 |
+
return $this->getGoogleAuthenticatorLib()->verifyCode( $sSecret, $sPassword );
|
51 |
+
}
|
52 |
|
53 |
+
/**
|
54 |
+
*/
|
55 |
+
protected function loadGoogleAuthenticatorLib() {
|
56 |
+
if ( !class_exists( 'PHPGangsta_GoogleAuthenticator', false ) ) {
|
57 |
+
require_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'googleauthenticator/googleauthenticator.php' );
|
|
|
|
|
58 |
}
|
59 |
+
return class_exists( 'PHPGangsta_GoogleAuthenticator', false );
|
60 |
+
}
|
61 |
|
62 |
+
/**
|
63 |
+
* @return PHPGangsta_GoogleAuthenticator
|
64 |
+
*/
|
65 |
+
protected function getGoogleAuthenticatorLib() {
|
66 |
+
if ( !isset( self::$oGA ) ) {
|
67 |
+
if ( $this->loadGoogleAuthenticatorLib() ) {
|
68 |
+
self::$oGA = new PHPGangsta_GoogleAuthenticator();
|
|
|
69 |
}
|
|
|
70 |
}
|
71 |
+
return self::$oGA;
|
72 |
}
|
73 |
+
}
|
src/common/icwp-optionsvo.php
CHANGED
@@ -45,13 +45,11 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
45 |
/**
|
46 |
* @var string
|
47 |
*/
|
48 |
-
protected $
|
49 |
|
50 |
/**
|
51 |
-
* @param string $sOptionsName
|
52 |
*/
|
53 |
-
public function __construct(
|
54 |
-
$this->sOptionsName = $sOptionsName;
|
55 |
}
|
56 |
|
57 |
/**
|
@@ -96,6 +94,13 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
96 |
return $this->getStoredOptions();
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
/**
|
100 |
* Returns an array of all the transferable options and their values
|
101 |
* @return array
|
@@ -377,8 +382,8 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
377 |
/**
|
378 |
* @return string
|
379 |
*/
|
380 |
-
public function
|
381 |
-
return $this->
|
382 |
}
|
383 |
|
384 |
/**
|
@@ -412,7 +417,6 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
412 |
|
413 |
/**
|
414 |
* @return array
|
415 |
-
* @throws Exception
|
416 |
*/
|
417 |
public function getRawData_FullFeatureConfig() {
|
418 |
if ( empty( $this->aRawOptionsConfigData ) ) {
|
@@ -674,7 +678,6 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
674 |
|
675 |
/**
|
676 |
* @return array
|
677 |
-
* @throws Exception
|
678 |
*/
|
679 |
private function readConfiguration() {
|
680 |
$oWp = $this->loadWp();
|
@@ -705,7 +708,7 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
705 |
private function readConfigurationJson() {
|
706 |
$aConfig = json_decode( $this->readConfigurationFileContents(), true );
|
707 |
if ( empty( $aConfig ) ) {
|
708 |
-
throw new Exception( sprintf( 'Reading JSON configuration from file "%s" failed.', $this->
|
709 |
}
|
710 |
return $aConfig;
|
711 |
}
|
@@ -716,32 +719,32 @@ class ICWP_WPSF_OptionsVO extends ICWP_WPSF_Foundation {
|
|
716 |
*/
|
717 |
private function readConfigurationFileContents() {
|
718 |
if ( !$this->getConfigFileExists() ) {
|
719 |
-
throw new Exception( sprintf( 'Configuration file "%s" does not exist.', $this->
|
720 |
}
|
721 |
-
return $this->
|
722 |
}
|
723 |
|
724 |
/**
|
725 |
* @return string
|
726 |
*/
|
727 |
private function getSpecTransientStorageKey() {
|
728 |
-
return 'icwp_'.md5( $this->
|
729 |
}
|
730 |
|
731 |
/**
|
732 |
* @return bool
|
733 |
*/
|
734 |
private function getConfigFileExists() {
|
735 |
-
$sPath = $this->
|
736 |
return !empty( $sPath ) && $this->loadFS()->isFile( $sPath );
|
737 |
}
|
738 |
|
739 |
/**
|
740 |
-
* @
|
|
|
741 |
*/
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
);
|
746 |
}
|
747 |
}
|
45 |
/**
|
46 |
* @var string
|
47 |
*/
|
48 |
+
protected $sPathToConfig;
|
49 |
|
50 |
/**
|
|
|
51 |
*/
|
52 |
+
public function __construct() {
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
94 |
return $this->getStoredOptions();
|
95 |
}
|
96 |
|
97 |
+
/**
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
public function getSlug() {
|
101 |
+
return $this->getFeatureProperty( 'slug' );
|
102 |
+
}
|
103 |
+
|
104 |
/**
|
105 |
* Returns an array of all the transferable options and their values
|
106 |
* @return array
|
382 |
/**
|
383 |
* @return string
|
384 |
*/
|
385 |
+
public function getPathToConfig() {
|
386 |
+
return $this->sPathToConfig;
|
387 |
}
|
388 |
|
389 |
/**
|
417 |
|
418 |
/**
|
419 |
* @return array
|
|
|
420 |
*/
|
421 |
public function getRawData_FullFeatureConfig() {
|
422 |
if ( empty( $this->aRawOptionsConfigData ) ) {
|
678 |
|
679 |
/**
|
680 |
* @return array
|
|
|
681 |
*/
|
682 |
private function readConfiguration() {
|
683 |
$oWp = $this->loadWp();
|
708 |
private function readConfigurationJson() {
|
709 |
$aConfig = json_decode( $this->readConfigurationFileContents(), true );
|
710 |
if ( empty( $aConfig ) ) {
|
711 |
+
throw new Exception( sprintf( 'Reading JSON configuration from file "%s" failed.', $this->getSlug() ) );
|
712 |
}
|
713 |
return $aConfig;
|
714 |
}
|
719 |
*/
|
720 |
private function readConfigurationFileContents() {
|
721 |
if ( !$this->getConfigFileExists() ) {
|
722 |
+
throw new Exception( sprintf( 'Configuration file "%s" does not exist.', $this->getPathToConfig() ) );
|
723 |
}
|
724 |
+
return $this->loadDP()->readFileContentsUsingInclude( $this->getPathToConfig() );
|
725 |
}
|
726 |
|
727 |
/**
|
728 |
* @return string
|
729 |
*/
|
730 |
private function getSpecTransientStorageKey() {
|
731 |
+
return 'icwp_'.md5( $this->getPathToConfig() );
|
732 |
}
|
733 |
|
734 |
/**
|
735 |
* @return bool
|
736 |
*/
|
737 |
private function getConfigFileExists() {
|
738 |
+
$sPath = $this->getPathToConfig();
|
739 |
return !empty( $sPath ) && $this->loadFS()->isFile( $sPath );
|
740 |
}
|
741 |
|
742 |
/**
|
743 |
+
* @param string $sPathToConfig
|
744 |
+
* @return $this
|
745 |
*/
|
746 |
+
public function setPathToConfig( $sPathToConfig ) {
|
747 |
+
$this->sPathToConfig = $sPathToConfig;
|
748 |
+
return $this;
|
|
|
749 |
}
|
750 |
}
|
src/common/icwp-render.php
CHANGED
@@ -1,332 +1,334 @@
|
|
1 |
<?php
|
2 |
-
if (
|
|
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
}
|
24 |
-
return self::$oInstance;
|
25 |
}
|
|
|
|
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
return $sOutput;
|
82 |
}
|
|
|
|
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
return $sContents;
|
93 |
-
}
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
}
|
102 |
-
|
103 |
-
$sTemplate = $this->getTemplateRoot() . ltrim( $this->getTemplate(), DIRECTORY_SEPARATOR );
|
104 |
-
if ( $this->loadFS()->isFile( $sTemplate ) ) {
|
105 |
-
ob_start();
|
106 |
-
include( $sTemplate );
|
107 |
-
$sContents = ob_get_contents();
|
108 |
-
ob_end_clean();
|
109 |
-
}
|
110 |
-
else {
|
111 |
-
$sContents = 'Error: Template file not found: ' . $sTemplate;
|
112 |
-
}
|
113 |
-
|
114 |
-
return $sContents;
|
115 |
}
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
private function renderTwig() {
|
123 |
-
throw new Exception( 'Twig codebase has been removed since version 5.3.3. Render using PHP instead.' );
|
124 |
-
$oTwig = $this->getTwigEnvironment();
|
125 |
-
return $oTwig->render( $this->getTemplate(), $this->getRenderVars() );
|
126 |
}
|
127 |
-
|
128 |
-
|
129 |
-
*/
|
130 |
-
public function display() {
|
131 |
-
echo $this->render();
|
132 |
-
return $this;
|
133 |
}
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
protected function autoload() {
|
138 |
-
if ( !class_exists( 'Twig_Autoloader', false ) ) {
|
139 |
-
require_once( $this->sAutoloaderPath );
|
140 |
-
Twig_Autoloader::register();
|
141 |
-
}
|
142 |
-
}
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
$this->oTwigEnv = new Twig_Environment( $this->getTwigLoader(),
|
158 |
-
array(
|
159 |
-
'debug' => true,
|
160 |
-
'strict_variables' => true,
|
161 |
-
)
|
162 |
-
);
|
163 |
-
}
|
164 |
-
return $this->oTwigEnv;
|
165 |
-
}
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$this->oTwigLoader = new Twig_Loader_Filesystem( $this->getTemplateRoot() );
|
174 |
-
}
|
175 |
-
return $this->oTwigLoader;
|
176 |
}
|
|
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
}
|
185 |
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
195 |
}
|
|
|
|
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
$
|
203 |
-
return $this->loadFS()->exists( $sFullPath );
|
204 |
}
|
|
|
|
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
$sTemplate = $this->loadDataProcessor()->addExtensionToFilePath( $sTemplate, $this->getEngineStub() );
|
215 |
-
return path_join( $this->getTemplateRoot(), $sTemplate );
|
216 |
-
}
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
228 |
}
|
|
|
|
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
236 |
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
}
|
|
|
|
|
|
|
245 |
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
253 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
// if ( !preg_match( '#\.twig$#', $sPath ) ) {
|
261 |
// $sPath = $sPath . '.twig';
|
262 |
// }
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
$sStub = 'html';
|
318 |
-
break;
|
319 |
-
|
320 |
-
case self::TEMPLATE_ENGINE_PHP:
|
321 |
-
$sStub = 'php';
|
322 |
-
break;
|
323 |
-
|
324 |
-
default:
|
325 |
-
$sStub = 'php';
|
326 |
-
break;
|
327 |
-
}
|
328 |
-
return $sStub;
|
329 |
}
|
|
|
330 |
}
|
331 |
-
|
332 |
-
endif;
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_Render', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
|
6 |
+
class ICWP_WPSF_Render extends ICWP_WPSF_Foundation {
|
7 |
|
8 |
+
const TEMPLATE_ENGINE_TWIG = 0;
|
9 |
+
const TEMPLATE_ENGINE_PHP = 1;
|
10 |
+
const TEMPLATE_ENGINE_HTML = 2;
|
11 |
|
12 |
+
/**
|
13 |
+
* @var ICWP_WPSF_Render
|
14 |
+
*/
|
15 |
+
protected static $oInstance = null;
|
16 |
|
17 |
+
private function __construct() {}
|
18 |
|
19 |
+
/**
|
20 |
+
* @return ICWP_WPSF_Render
|
21 |
+
*/
|
22 |
+
public static function GetInstance() {
|
23 |
+
if ( is_null( self::$oInstance ) ) {
|
24 |
+
self::$oInstance = new self();
|
|
|
|
|
25 |
}
|
26 |
+
return self::$oInstance;
|
27 |
+
}
|
28 |
|
29 |
+
/**
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected $aRenderVars;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
protected $sTemplatePath;
|
38 |
+
|
39 |
+
/**
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
protected $sAutoloaderPath;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
protected $sTemplate;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @var int
|
51 |
+
*/
|
52 |
+
protected $nTemplateEngine;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @var Twig_Environment
|
56 |
+
*/
|
57 |
+
protected $oTwigEnv;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @var Twig_Loader_Filesystem
|
61 |
+
*/
|
62 |
+
protected $oTwigLoader;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @return string
|
66 |
+
* @throws Exception
|
67 |
+
*/
|
68 |
+
public function render() {
|
69 |
+
|
70 |
+
switch ( $this->getTemplateEngine() ) {
|
71 |
+
|
72 |
+
case self::TEMPLATE_ENGINE_TWIG :
|
73 |
+
$sOutput = $this->renderTwig();
|
74 |
+
break;
|
75 |
+
|
76 |
+
case self::TEMPLATE_ENGINE_HTML :
|
77 |
+
$sOutput = $this->renderHtml();
|
78 |
+
break;
|
79 |
+
|
80 |
+
default:
|
81 |
+
$sOutput = $this->renderPhp();
|
82 |
+
break;
|
|
|
83 |
}
|
84 |
+
return $sOutput;
|
85 |
+
}
|
86 |
|
87 |
+
/**
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
private function renderHtml() {
|
91 |
+
ob_start();
|
92 |
+
@include( $this->getTemplateRoot().ltrim( $this->getTemplate(), DIRECTORY_SEPARATOR ) );
|
93 |
+
return ob_get_clean();
|
94 |
+
}
|
|
|
|
|
95 |
|
96 |
+
/**
|
97 |
+
* @return string
|
98 |
+
*/
|
99 |
+
private function renderPhp() {
|
100 |
+
if ( count( $this->getRenderVars() ) > 0 ) {
|
101 |
+
extract( $this->getRenderVars() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
|
104 |
+
$sTemplate = $this->getTemplateRoot().ltrim( $this->getTemplate(), DIRECTORY_SEPARATOR );
|
105 |
+
if ( $this->loadFS()->isFile( $sTemplate ) ) {
|
106 |
+
ob_start();
|
107 |
+
include( $sTemplate );
|
108 |
+
$sContents = ob_get_clean();
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
+
else {
|
111 |
+
$sContents = 'Error: Template file not found: '.$sTemplate;
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
|
114 |
+
return $sContents;
|
115 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
/**
|
118 |
+
* @deprecated
|
119 |
+
* @return string
|
120 |
+
* @throws Exception
|
121 |
+
*/
|
122 |
+
private function renderTwig() {
|
123 |
+
// throw new Exception( 'Twig codebase has been removed since version 5.3.3. Render using PHP instead.' );
|
124 |
+
$oTwig = $this->getTwigEnvironment();
|
125 |
+
return $oTwig->render( $this->getTemplate(), $this->getRenderVars() );
|
126 |
+
}
|
127 |
|
128 |
+
/**
|
129 |
+
*/
|
130 |
+
public function display() {
|
131 |
+
echo $this->render();
|
132 |
+
return $this;
|
133 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
+
/**
|
136 |
+
*/
|
137 |
+
protected function autoload() {
|
138 |
+
if ( !class_exists( 'Twig_Autoloader', false ) ) {
|
139 |
+
require_once( $this->sAutoloaderPath );
|
140 |
+
Twig_Autoloader::register();
|
|
|
|
|
|
|
141 |
}
|
142 |
+
}
|
143 |
|
144 |
+
/**
|
145 |
+
* @return $this
|
146 |
+
*/
|
147 |
+
public function clearRenderVars() {
|
148 |
+
return $this->setRenderVars( array() );
|
149 |
+
}
|
|
|
150 |
|
151 |
+
/**
|
152 |
+
* @return Twig_Environment
|
153 |
+
*/
|
154 |
+
protected function getTwigEnvironment() {
|
155 |
+
if ( !isset( $this->oTwigEnv ) ) {
|
156 |
+
self::loadAutoload();
|
157 |
+
$this->oTwigEnv = new Twig_Environment( $this->getTwigLoader(),
|
158 |
+
array(
|
159 |
+
'debug' => true,
|
160 |
+
'strict_variables' => true,
|
161 |
+
)
|
162 |
+
);
|
163 |
}
|
164 |
+
return $this->oTwigEnv;
|
165 |
+
}
|
166 |
|
167 |
+
/**
|
168 |
+
* @return Twig_Loader_Filesystem
|
169 |
+
*/
|
170 |
+
protected function getTwigLoader() {
|
171 |
+
if ( !isset( $this->oTwigLoader ) ) {
|
172 |
+
$this->oTwigLoader = new Twig_Loader_Filesystem( $this->getTemplateRoot() );
|
|
|
173 |
}
|
174 |
+
return $this->oTwigLoader;
|
175 |
+
}
|
176 |
|
177 |
+
/**
|
178 |
+
* @return string
|
179 |
+
*/
|
180 |
+
public function getTemplate() {
|
181 |
+
$this->sTemplate = $this->loadDataProcessor()
|
182 |
+
->addExtensionToFilePath( $this->sTemplate, $this->getEngineStub() );
|
183 |
+
return $this->sTemplate;
|
184 |
+
}
|
|
|
|
|
|
|
185 |
|
186 |
+
/**
|
187 |
+
* @return int
|
188 |
+
*/
|
189 |
+
public function getTemplateEngine() {
|
190 |
+
if ( !isset( $this->nTemplateEngine )
|
191 |
+
|| !in_array( $this->nTemplateEngine, array(
|
192 |
+
self::TEMPLATE_ENGINE_TWIG,
|
193 |
+
self::TEMPLATE_ENGINE_PHP,
|
194 |
+
self::TEMPLATE_ENGINE_HTML
|
195 |
+
) ) ) {
|
196 |
+
$this->nTemplateEngine = self::TEMPLATE_ENGINE_PHP;
|
197 |
}
|
198 |
+
return $this->nTemplateEngine;
|
199 |
+
}
|
200 |
|
201 |
+
/**
|
202 |
+
* @param string $sTemplate
|
203 |
+
* @return string
|
204 |
+
*/
|
205 |
+
public function getTemplateExists( $sTemplate = '' ) {
|
206 |
+
$sFullPath = $this->getTemplateFullPath( $sTemplate );
|
207 |
+
return $this->loadFS()->exists( $sFullPath );
|
208 |
+
}
|
209 |
|
210 |
+
/**
|
211 |
+
* @param string $sTemplate
|
212 |
+
* @return string
|
213 |
+
*/
|
214 |
+
public function getTemplateFullPath( $sTemplate = '' ) {
|
215 |
+
if ( empty( $sTemplate ) ) {
|
216 |
+
$sTemplate = $this->getTemplate();
|
217 |
}
|
218 |
+
$sTemplate = $this->loadDataProcessor()->addExtensionToFilePath( $sTemplate, $this->getEngineStub() );
|
219 |
+
return path_join( $this->getTemplateRoot(), $sTemplate );
|
220 |
+
}
|
221 |
|
222 |
+
/**
|
223 |
+
* @return string
|
224 |
+
*/
|
225 |
+
public function getTemplateRoot() {
|
226 |
+
$sPath = rtrim( $this->sTemplatePath, DIRECTORY_SEPARATOR );
|
227 |
+
$sStub = $this->getEngineStub();
|
228 |
+
if ( !preg_match( sprintf( '#%s$#', $sStub ), $sPath ) ) {
|
229 |
+
$sPath = $sPath.DIRECTORY_SEPARATOR.$sStub;
|
230 |
}
|
231 |
+
return $sPath.DIRECTORY_SEPARATOR;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* @return array
|
236 |
+
*/
|
237 |
+
public function getRenderVars() {
|
238 |
+
return $this->aRenderVars;
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* @param array $aVars
|
243 |
+
* @return $this
|
244 |
+
*/
|
245 |
+
public function setRenderVars( $aVars ) {
|
246 |
+
$this->aRenderVars = $aVars;
|
247 |
+
return $this;
|
248 |
+
}
|
249 |
+
|
250 |
+
/**
|
251 |
+
* @param string $sPath
|
252 |
+
* @return $this
|
253 |
+
*/
|
254 |
+
public function setAutoloaderPath( $sPath ) {
|
255 |
+
$this->sAutoloaderPath = $sPath;
|
256 |
+
return $this;
|
257 |
+
}
|
258 |
|
259 |
+
/**
|
260 |
+
* @param string $sPath
|
261 |
+
* @return $this
|
262 |
+
*/
|
263 |
+
public function setTemplate( $sPath ) {
|
264 |
// if ( !preg_match( '#\.twig$#', $sPath ) ) {
|
265 |
// $sPath = $sPath . '.twig';
|
266 |
// }
|
267 |
+
$this->sTemplate = $sPath;
|
268 |
+
return $this;
|
269 |
+
}
|
270 |
|
271 |
+
/**
|
272 |
+
* @return $this
|
273 |
+
*/
|
274 |
+
public function setTemplateEngineHtml() {
|
275 |
+
return $this->setTemplateEngine( self::TEMPLATE_ENGINE_HTML );
|
276 |
+
}
|
277 |
|
278 |
+
/**
|
279 |
+
* @return $this
|
280 |
+
*/
|
281 |
+
public function setTemplateEnginePhp() {
|
282 |
+
return $this->setTemplateEngine( self::TEMPLATE_ENGINE_PHP );
|
283 |
+
}
|
284 |
|
285 |
+
/**
|
286 |
+
* @return $this
|
287 |
+
*/
|
288 |
+
public function setTemplateEngineTwig() {
|
289 |
+
return $this->setTemplateEngine( self::TEMPLATE_ENGINE_TWIG );
|
290 |
+
}
|
291 |
|
292 |
+
/**
|
293 |
+
* @param int $nEngine
|
294 |
+
* @return $this
|
295 |
+
*/
|
296 |
+
protected function setTemplateEngine( $nEngine ) {
|
297 |
+
$this->nTemplateEngine = $nEngine;
|
298 |
+
return $this;
|
299 |
+
}
|
300 |
|
301 |
+
/**
|
302 |
+
* @param string $sPath
|
303 |
+
* @return $this
|
304 |
+
*/
|
305 |
+
public function setTemplateRoot( $sPath ) {
|
306 |
+
$this->sTemplatePath = $sPath;
|
307 |
+
return $this;
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* @return string
|
312 |
+
*/
|
313 |
+
private function getEngineStub() {
|
314 |
+
switch ( $this->getTemplateEngine() ) {
|
315 |
+
|
316 |
+
case self::TEMPLATE_ENGINE_TWIG:
|
317 |
+
$sStub = 'twig';
|
318 |
+
break;
|
319 |
|
320 |
+
case self::TEMPLATE_ENGINE_HTML:
|
321 |
+
$sStub = 'html';
|
322 |
+
break;
|
323 |
+
|
324 |
+
case self::TEMPLATE_ENGINE_PHP:
|
325 |
+
$sStub = 'php';
|
326 |
+
break;
|
327 |
+
|
328 |
+
default:
|
329 |
+
$sStub = 'php';
|
330 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
+
return $sStub;
|
333 |
}
|
334 |
+
}
|
|
src/common/icwp-wpcron.php
CHANGED
@@ -1,127 +1,128 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param string $sCronName
|
34 |
-
* @return bool
|
35 |
-
*/
|
36 |
-
public function getIfCronExists( $sCronName ) {
|
37 |
-
return (bool)wp_next_scheduled( $sCronName );
|
38 |
}
|
|
|
|
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
return $this->nNextRun;
|
48 |
-
}
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
}
|
57 |
-
return $this->sRecurrence;
|
58 |
}
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
return $this;
|
67 |
}
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
throw new Exception( sprintf( 'Tried to schedule a new cron but the Callback function is not callable: %s', print_r( $cCallback, true ) ) );
|
96 |
-
}
|
97 |
-
add_action( $sUniqueCronName, $cCallback );
|
98 |
-
return $this->setCronSchedule( $sUniqueCronName );
|
99 |
-
}
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
|
|
|
|
|
|
106 |
}
|
|
|
|
|
|
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
wp_schedule_event( $this->getNextRun(), $this->getRecurrence(), $sUniqueCronActionName );
|
115 |
-
}
|
116 |
-
return $this;
|
117 |
-
}
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
124 |
}
|
|
|
125 |
}
|
126 |
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_WpCron', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
+
|
6 |
+
class ICWP_WPSF_WpCron {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_WpCron
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
+
private function __construct() { }
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var int
|
16 |
+
*/
|
17 |
+
protected $nNextRun;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
protected $sRecurrence;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @return ICWP_WPSF_WpCron
|
26 |
+
*/
|
27 |
+
public static function GetInstance() {
|
28 |
+
if ( is_null( self::$oInstance ) ) {
|
29 |
+
self::$oInstance = new self();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
+
return self::$oInstance;
|
32 |
+
}
|
33 |
|
34 |
+
/**
|
35 |
+
* @param string $sCronName
|
36 |
+
* @return bool
|
37 |
+
*/
|
38 |
+
public function getIfCronExists( $sCronName ) {
|
39 |
+
return (bool)wp_next_scheduled( $sCronName );
|
40 |
+
}
|
|
|
|
|
41 |
|
42 |
+
/**
|
43 |
+
* @return int
|
44 |
+
*/
|
45 |
+
public function getNextRun() {
|
46 |
+
if ( is_null( $this->nNextRun ) ) {
|
47 |
+
return strtotime( 'tomorrow 4am' ) - get_option( 'gmt_offset' )*HOUR_IN_SECONDS;
|
|
|
|
|
48 |
}
|
49 |
+
return $this->nNextRun;
|
50 |
+
}
|
51 |
|
52 |
+
/**
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public function getRecurrence() {
|
56 |
+
if ( empty( $this->sRecurrence ) || !in_array( $this->sRecurrence, $this->getPermittedRecurrences() ) ) {
|
57 |
+
return 'daily';
|
|
|
58 |
}
|
59 |
+
return $this->sRecurrence;
|
60 |
+
}
|
61 |
|
62 |
+
/**
|
63 |
+
* @param int $nNextRun
|
64 |
+
* @return $this
|
65 |
+
*/
|
66 |
+
public function setNextRun( $nNextRun ) {
|
67 |
+
$this->nNextRun = $nNextRun;
|
68 |
+
return $this;
|
69 |
+
}
|
70 |
|
71 |
+
/**
|
72 |
+
* @param string $sRecurrence
|
73 |
+
* @return $this
|
74 |
+
*/
|
75 |
+
public function setRecurrence( $sRecurrence ) {
|
76 |
+
$this->sRecurrence = $sRecurrence;
|
77 |
+
return $this;
|
78 |
+
}
|
79 |
|
80 |
+
/**
|
81 |
+
* @return $this
|
82 |
+
*/
|
83 |
+
public function reset() {
|
84 |
+
return $this
|
85 |
+
->setNextRun( null )
|
86 |
+
->setRecurrence( null );
|
87 |
+
}
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
+
/**
|
90 |
+
* @param string $sUniqueCronName
|
91 |
+
* @param callback $cCallback
|
92 |
+
* @return $this
|
93 |
+
* @throws Exception
|
94 |
+
*/
|
95 |
+
public function createCronJob( $sUniqueCronName, $cCallback ) {
|
96 |
+
if ( !is_callable( $cCallback ) ) {
|
97 |
+
throw new Exception( sprintf( 'Tried to schedule a new cron but the Callback function is not callable: %s', print_r( $cCallback, true ) ) );
|
98 |
}
|
99 |
+
add_action( $sUniqueCronName, $cCallback );
|
100 |
+
return $this->setCronSchedule( $sUniqueCronName );
|
101 |
+
}
|
102 |
|
103 |
+
/**
|
104 |
+
* @param string $sUniqueCronName
|
105 |
+
*/
|
106 |
+
public function deleteCronJob( $sUniqueCronName ) {
|
107 |
+
wp_clear_scheduled_hook( $sUniqueCronName );
|
108 |
+
}
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
/**
|
111 |
+
* @param string $sUniqueCronActionName
|
112 |
+
* @return $this
|
113 |
+
*/
|
114 |
+
protected function setCronSchedule( $sUniqueCronActionName ) {
|
115 |
+
if ( !wp_next_scheduled( $sUniqueCronActionName ) && !defined( 'WP_INSTALLING' ) ) {
|
116 |
+
wp_schedule_event( $this->getNextRun(), $this->getRecurrence(), $sUniqueCronActionName );
|
117 |
+
$this->reset();
|
118 |
}
|
119 |
+
return $this;
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* @return array
|
124 |
+
*/
|
125 |
+
private function getPermittedRecurrences() {
|
126 |
+
return array( 'hourly', 'twicedaily', 'daily' );
|
127 |
+
}
|
128 |
+
}
|
src/common/icwp-wpdb.php
CHANGED
@@ -1,227 +1,220 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
}
|
|
|
|
|
25 |
|
26 |
-
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
}
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
}
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
}
|
86 |
-
$sQuery = sprintf( 'TRUNCATE TABLE `%s`', $sTable );
|
87 |
-
return $this->doSql( $sQuery );
|
88 |
}
|
|
|
|
|
|
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
if ( !empty( $sArrayMapCallBack ) && function_exists( $sArrayMapCallBack ) ) {
|
113 |
-
return array_map( $sArrayMapCallBack, $aColumns );
|
114 |
-
}
|
115 |
-
return $aColumns;
|
116 |
-
}
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
* @return string
|
121 |
-
*/
|
122 |
-
public function getPrefix( $bSiteBase = true ) {
|
123 |
-
$oDb = $this->loadWpdb();
|
124 |
-
return $bSiteBase ? $oDb->base_prefix : $oDb->prefix;
|
125 |
}
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
return $this->loadWpdb()->get_var( $sSql );
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
return $this->loadWpdb()->insert( $sTable, $aData );
|
165 |
-
}
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
return $this->loadWpdb()->get_results( $sQuery, $nFormat );
|
176 |
-
}
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
}
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
return $this->loadWpdb()->update( $sTable, $aData, $aWhere );
|
206 |
-
}
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
return $this->oWpdb;
|
218 |
-
}
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
225 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
}
|
227 |
-
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_WpDb', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
+
|
6 |
+
class ICWP_WPSF_WpDb {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_WpDb
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var wpdb
|
15 |
+
*/
|
16 |
+
protected $oWpdb;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @return ICWP_WPSF_WpDb
|
20 |
+
*/
|
21 |
+
public static function GetInstance() {
|
22 |
+
if ( is_null( self::$oInstance ) ) {
|
23 |
+
self::$oInstance = new self;
|
24 |
+
}
|
25 |
+
return self::$oInstance;
|
26 |
+
}
|
27 |
|
28 |
+
public function __construct() {
|
29 |
+
}
|
30 |
|
31 |
+
/**
|
32 |
+
* @param string $sSQL
|
33 |
+
* @return array
|
34 |
+
*/
|
35 |
+
public function dbDelta( $sSQL ) {
|
36 |
+
require_once( ABSPATH.'wp-admin/includes/upgrade.php' );
|
37 |
+
return dbDelta( $sSQL );
|
38 |
+
}
|
39 |
|
40 |
+
/**
|
41 |
+
* @param string $sTable
|
42 |
+
* @param array $aWhere - delete where (associative array)
|
43 |
+
* @return false|int
|
44 |
+
*/
|
45 |
+
public function deleteRowsFromTableWhere( $sTable, $aWhere ) {
|
46 |
+
return $this->loadWpdb()->delete( $sTable, $aWhere );
|
47 |
+
}
|
48 |
|
49 |
+
/**
|
50 |
+
* Will completely remove this table from the database
|
51 |
+
* @param string $sTable
|
52 |
+
* @return bool|int
|
53 |
+
*/
|
54 |
+
public function doDropTable( $sTable ) {
|
55 |
+
$sQuery = sprintf( 'DROP TABLE IF EXISTS `%s`', $sTable );
|
56 |
+
return $this->doSql( $sQuery );
|
57 |
+
}
|
|
|
58 |
|
59 |
+
/**
|
60 |
+
* Alias for doTruncateTable()
|
61 |
+
* @param string $sTable
|
62 |
+
* @return bool|int
|
63 |
+
*/
|
64 |
+
public function doEmptyTable( $sTable ) {
|
65 |
+
return $this->doTruncateTable( $sTable );
|
66 |
+
}
|
|
|
67 |
|
68 |
+
/**
|
69 |
+
* Given any SQL query, will perform it using the WordPress database object.
|
70 |
+
* @param string $sSqlQuery
|
71 |
+
* @return integer|boolean (number of rows affected or just true/false)
|
72 |
+
*/
|
73 |
+
public function doSql( $sSqlQuery ) {
|
74 |
+
$mResult = $this->loadWpdb()->query( $sSqlQuery );
|
75 |
+
return $mResult;
|
76 |
+
}
|
|
|
77 |
|
78 |
+
/**
|
79 |
+
* @param string $sTable
|
80 |
+
* @return bool|int
|
81 |
+
*/
|
82 |
+
public function doTruncateTable( $sTable ) {
|
83 |
+
if ( !$this->getIfTableExists( $sTable ) ) {
|
84 |
+
return false;
|
|
|
|
|
|
|
85 |
}
|
86 |
+
$sQuery = sprintf( 'TRUNCATE TABLE `%s`', $sTable );
|
87 |
+
return $this->doSql( $sQuery );
|
88 |
+
}
|
89 |
|
90 |
+
public function getCharCollate() {
|
91 |
+
return $this->getWpdb()->get_charset_collate();
|
92 |
+
}
|
93 |
|
94 |
+
/**
|
95 |
+
* @param string $sTable
|
96 |
+
* @return bool
|
97 |
+
*/
|
98 |
+
public function getIfTableExists( $sTable ) {
|
99 |
+
$sQuery = sprintf( "SHOW TABLES LIKE '%s'", $sTable );
|
100 |
+
$mResult = $this->loadWpdb()->get_var( $sQuery );
|
101 |
+
return !is_null( $mResult );
|
102 |
+
}
|
103 |
|
104 |
+
/**
|
105 |
+
* @param string $sTableName
|
106 |
+
* @param string $sArrayMapCallBack
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function getColumnsForTable( $sTableName, $sArrayMapCallBack = '' ) {
|
110 |
+
$aColumns = $this->loadWpdb()->get_col( "DESCRIBE ".$sTableName, 0 );
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
+
if ( !empty( $sArrayMapCallBack ) && function_exists( $sArrayMapCallBack ) ) {
|
113 |
+
return array_map( $sArrayMapCallBack, $aColumns );
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
+
return $aColumns;
|
116 |
+
}
|
117 |
|
118 |
+
/**
|
119 |
+
* @param bool $bSiteBase
|
120 |
+
* @return string
|
121 |
+
*/
|
122 |
+
public function getPrefix( $bSiteBase = true ) {
|
123 |
+
$oDb = $this->loadWpdb();
|
124 |
+
return $bSiteBase ? $oDb->base_prefix : $oDb->prefix;
|
125 |
+
}
|
126 |
|
127 |
+
/**
|
128 |
+
* @return string
|
129 |
+
*/
|
130 |
+
public function getTable_Comments() {
|
131 |
+
return $this->loadWpdb()->comments;
|
132 |
+
}
|
133 |
|
134 |
+
/**
|
135 |
+
* @return string
|
136 |
+
*/
|
137 |
+
public function getTable_Options() {
|
138 |
+
return $this->loadWpdb()->options;
|
139 |
+
}
|
140 |
|
141 |
+
/**
|
142 |
+
* @return string
|
143 |
+
*/
|
144 |
+
public function getTable_Posts() {
|
145 |
+
return $this->loadWpdb()->posts;
|
146 |
+
}
|
|
|
|
|
147 |
|
148 |
+
/**
|
149 |
+
* @param $sSql
|
150 |
+
* @return null|mixed
|
151 |
+
*/
|
152 |
+
public function getVar( $sSql ) {
|
153 |
+
return $this->loadWpdb()->get_var( $sSql );
|
154 |
+
}
|
|
|
|
|
155 |
|
156 |
+
/**
|
157 |
+
* @param string $sTable
|
158 |
+
* @param array $aData
|
159 |
+
* @return int|boolean
|
160 |
+
*/
|
161 |
+
public function insertDataIntoTable( $sTable, $aData ) {
|
162 |
+
return $this->loadWpdb()->insert( $sTable, $aData );
|
163 |
+
}
|
|
|
|
|
164 |
|
165 |
+
/**
|
166 |
+
* @param string $sTable
|
167 |
+
* @param string $nFormat
|
168 |
+
* @return mixed
|
169 |
+
*/
|
170 |
+
public function selectAllFromTable( $sTable, $nFormat = ARRAY_A ) {
|
171 |
+
$sQuery = sprintf( "SELECT * FROM `%s` WHERE `deleted_at` = 0", $sTable );
|
172 |
+
return $this->loadWpdb()->get_results( $sQuery, $nFormat );
|
173 |
+
}
|
174 |
|
175 |
+
/**
|
176 |
+
* @param string $sQuery
|
177 |
+
* @param $nFormat
|
178 |
+
* @return array|boolean
|
179 |
+
*/
|
180 |
+
public function selectCustom( $sQuery, $nFormat = ARRAY_A ) {
|
181 |
+
return $this->loadWpdb()->get_results( $sQuery, $nFormat );
|
182 |
+
}
|
|
|
183 |
|
184 |
+
/**
|
185 |
+
* @param $sQuery
|
186 |
+
* @param string $nFormat
|
187 |
+
* @return null|object|array
|
188 |
+
*/
|
189 |
+
public function selectRow( $sQuery, $nFormat = ARRAY_A ) {
|
190 |
+
return $this->loadWpdb()->get_row( $sQuery, $nFormat );
|
191 |
+
}
|
|
|
|
|
192 |
|
193 |
+
/**
|
194 |
+
* @param string $sTable
|
195 |
+
* @param array $aData - new insert data (associative array, column=>data)
|
196 |
+
* @param array $aWhere - insert where (associative array)
|
197 |
+
* @return integer|boolean (number of rows affected)
|
198 |
+
*/
|
199 |
+
public function updateRowsFromTableWhere( $sTable, $aData, $aWhere ) {
|
200 |
+
return $this->loadWpdb()->update( $sTable, $aData, $aWhere );
|
201 |
+
}
|
|
|
|
|
202 |
|
203 |
+
/**
|
204 |
+
* Loads our WPDB object if required.
|
205 |
+
* @return \wpdb
|
206 |
+
*/
|
207 |
+
protected function loadWpdb() {
|
208 |
+
if ( is_null( $this->oWpdb ) ) {
|
209 |
+
$this->oWpdb = $this->getWpdb();
|
210 |
}
|
211 |
+
return $this->oWpdb;
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
*/
|
216 |
+
private function getWpdb() {
|
217 |
+
global $wpdb;
|
218 |
+
return $wpdb;
|
219 |
}
|
220 |
+
}
|
src/common/icwp-wpfilesystem.php
CHANGED
@@ -1,495 +1,492 @@
|
|
1 |
<?php
|
2 |
-
if (
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
|
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
48 |
}
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @param string $sNeedle
|
54 |
-
* @param string $sDir
|
55 |
-
* @param boolean $bIncludeExtension
|
56 |
-
* @param boolean $bCaseSensitive
|
57 |
-
*
|
58 |
-
* @return bool|null
|
59 |
-
*/
|
60 |
-
public function fileExistsInDir( $sNeedle, $sDir, $bIncludeExtension = true, $bCaseSensitive = false ) {
|
61 |
-
if ( empty( $sNeedle ) || empty( $sDir ) ) {
|
62 |
-
return false;
|
63 |
}
|
|
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
-
$
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
$oDirIt = new DirectoryIterator( $sDir );
|
74 |
}
|
75 |
-
|
76 |
-
|
|
|
77 |
}
|
78 |
-
}
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
$sNeedlePreExtension = $bHasExtension ? substr( $sNeedle, 0, $nDotPosition ) : $sNeedle;
|
88 |
-
|
89 |
-
$bFound = false;
|
90 |
-
foreach ( $oDirIt as $oFileItem ) {
|
91 |
-
if ( !$oFileItem->isFile() ) {
|
92 |
-
continue;
|
93 |
-
}
|
94 |
-
$sFilename = $oFileItem->getFilename();
|
95 |
-
if ( !$bCaseSensitive ) {
|
96 |
-
$sFilename = strtolower( $sFilename );
|
97 |
-
}
|
98 |
-
|
99 |
-
if ( $bIncludeExtension ) {
|
100 |
-
$bFound = ( $sFilename == $sNeedle );
|
101 |
-
}
|
102 |
-
else {
|
103 |
-
// This is not entirely accurate as it only finds whether a file "starts" with needle, ignoring subsequent characters
|
104 |
-
$bFound = ( strpos( $sFilename, $sNeedlePreExtension ) === 0 );
|
105 |
-
}
|
106 |
-
|
107 |
-
if ( $bFound ) {
|
108 |
-
break;
|
109 |
-
}
|
110 |
}
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
if ( $bCaseSensitive ) {
|
116 |
-
return $this->exists( $this->pathJoin( $sDir, $sNeedle ) );
|
117 |
-
}
|
118 |
-
$sNeedle = strtolower( $sNeedle );
|
119 |
-
if ( $oHandle = opendir( $sDir ) ) {
|
120 |
-
|
121 |
-
while ( false !== ( $sFileEntry = readdir( $oHandle ) ) ) {
|
122 |
-
if ( !$this->isFile( $this->pathJoin( $sDir, $sFileEntry ) ) ) {
|
123 |
-
continue;
|
124 |
-
}
|
125 |
-
if ( $sNeedle == strtolower( $sFileEntry ) ) {
|
126 |
-
return true;
|
127 |
-
}
|
128 |
}
|
129 |
}
|
130 |
|
131 |
-
return
|
132 |
}
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
* @param string $sPath
|
137 |
-
* @return string
|
138 |
-
*/
|
139 |
-
public function normalizeFilePathDS( $sPath ) {
|
140 |
-
return ( DIRECTORY_SEPARATOR == '/' ) ? $sPath : str_replace( '\\', '/', $sPath );
|
141 |
}
|
|
|
|
|
142 |
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
if (
|
148 |
-
|
149 |
}
|
150 |
}
|
151 |
}
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
$sSchema = $bSecure? 'https://' : 'http://';
|
173 |
-
$sUrl = ( strpos( $sUrl, 'http' ) !== 0 )? $sSchema.$sUrl : $sUrl;
|
174 |
-
return ( $this->getUrl( $sUrl ) != false );
|
175 |
}
|
|
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
public function getWpConfigPath() {
|
181 |
-
return $this->sWpConfigPath;
|
182 |
-
}
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
190 |
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
return $mResult;
|
199 |
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* @param string $sUrl
|
203 |
-
* @param array $aRequestArgs
|
204 |
-
* @return array|bool
|
205 |
-
*/
|
206 |
-
public function getUrl( $sUrl, $aRequestArgs = array() ) {
|
207 |
-
$aRequestArgs['method'] = 'GET';
|
208 |
-
return $this->requestUrl( $sUrl, $aRequestArgs );
|
209 |
-
}
|
210 |
-
|
211 |
-
/**
|
212 |
-
* @param string $sUrl
|
213 |
-
* @param array $aRequestArgs
|
214 |
-
* @return false|string
|
215 |
-
*/
|
216 |
-
public function getUrlContent( $sUrl, $aRequestArgs = array() ) {
|
217 |
-
$aResponse = $this->getUrl( $sUrl, $aRequestArgs );
|
218 |
-
if ( !$aResponse || !isset( $aResponse['body'] ) ) {
|
219 |
-
return false;
|
220 |
-
}
|
221 |
-
return $aResponse['body'];
|
222 |
-
}
|
223 |
-
|
224 |
-
/**
|
225 |
-
* @param string $sUrl
|
226 |
-
* @param array $aRequestArgs
|
227 |
-
* @return array|false
|
228 |
-
*/
|
229 |
-
public function postUrl( $sUrl, $aRequestArgs = array() ) {
|
230 |
-
$aRequestArgs[ 'method' ] = 'POST';
|
231 |
-
return $this->requestUrl( $sUrl, $aRequestArgs );
|
232 |
-
}
|
233 |
-
|
234 |
-
public function getCanWpRemoteGet() {
|
235 |
-
$aUrlsToTest = array(
|
236 |
-
'https://www.microsoft.com',
|
237 |
-
'https://www.google.com',
|
238 |
-
'https://www.facebook.com'
|
239 |
-
);
|
240 |
-
foreach( $aUrlsToTest as $sUrl ) {
|
241 |
-
if ( $this->getUrl( $sUrl ) !== false ) {
|
242 |
-
return true;
|
243 |
-
}
|
244 |
-
}
|
245 |
return false;
|
246 |
}
|
|
|
|
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
259 |
return false;
|
260 |
}
|
|
|
|
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
|
|
|
269 |
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
|
|
|
|
|
|
|
|
276 |
}
|
|
|
|
|
277 |
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
* @return int|null
|
282 |
-
*/
|
283 |
-
public function getTime( $sFilePath, $sProperty = 'modified' ) {
|
284 |
|
285 |
-
|
286 |
-
|
|
|
|
|
|
|
287 |
}
|
|
|
|
|
|
|
288 |
|
289 |
-
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
|
304 |
-
|
305 |
-
|
306 |
-
* @return NULL|boolean
|
307 |
-
*/
|
308 |
-
public function getCanReadWriteFile( $sFilePath ) {
|
309 |
-
if ( !file_exists( $sFilePath ) ) {
|
310 |
-
return null;
|
311 |
-
}
|
312 |
|
313 |
-
|
314 |
-
|
|
|
|
|
|
|
|
|
|
|
315 |
return null;
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
if ( empty( $sFileContent ) ) {
|
320 |
-
return false; //can't even read the file!
|
321 |
-
}
|
322 |
-
return $this->putFileContent( $sFilePath, $sFileContent );
|
323 |
-
}
|
324 |
-
|
325 |
-
/**
|
326 |
-
* @param string $sFilePath
|
327 |
-
* @return string|null
|
328 |
-
*/
|
329 |
-
public function getFileContent( $sFilePath ) {
|
330 |
-
$sContents = null;
|
331 |
-
$oFs = $this->getWpfs();
|
332 |
-
if ( $oFs ) {
|
333 |
-
$sContents = $oFs->get_contents( $sFilePath );
|
334 |
-
}
|
335 |
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
|
|
340 |
}
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
public function getFileSize( $sFilePath ) {
|
347 |
-
$oFs = $this->getWpfs();
|
348 |
-
if ( $oFs && ( $oFs->size( $sFilePath ) > 0 ) ) {
|
349 |
-
return $oFs->size( $sFilePath );
|
350 |
-
}
|
351 |
-
return @filesize( $sFilePath );
|
352 |
-
}
|
353 |
-
|
354 |
-
/**
|
355 |
-
* @param string|null $sBaseDir
|
356 |
-
* @param string $sPrefix
|
357 |
-
* @param string $outsRandomDir
|
358 |
-
* @return bool|string
|
359 |
-
*/
|
360 |
-
public function getTempDir( $sBaseDir = null, $sPrefix = '', &$outsRandomDir = '' ) {
|
361 |
-
$sTemp = rtrim( (is_null( $sBaseDir )? get_temp_dir(): $sBaseDir), DIRECTORY_SEPARATOR ).DIRECTORY_SEPARATOR;
|
362 |
-
|
363 |
-
$sCharset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789';
|
364 |
-
do {
|
365 |
-
$sDir = $sPrefix;
|
366 |
-
for ( $i = 0; $i < 8; $i++ ) {
|
367 |
-
$sDir .= $sCharset[(rand() % strlen( $sCharset ))];
|
368 |
-
}
|
369 |
-
}
|
370 |
-
while ( is_dir( $sTemp.$sDir ) );
|
371 |
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
373 |
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
379 |
}
|
380 |
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
public function putFileContent( $sFilePath, $sContents ) {
|
387 |
-
$oFs = $this->getWpfs();
|
388 |
-
if ( $oFs && $oFs->put_contents( $sFilePath, $sContents, FS_CHMOD_FILE ) ) {
|
389 |
-
return true;
|
390 |
-
}
|
391 |
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
|
|
|
|
|
|
|
|
396 |
}
|
|
|
|
|
397 |
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
|
|
408 |
}
|
409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
}
|
|
|
|
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
return function_exists( 'unlink' ) ? @unlink( $sFilePath ) : null;
|
422 |
}
|
423 |
|
424 |
-
|
425 |
-
|
426 |
-
* @param string $sFilePathDestination
|
427 |
-
* @return bool|null
|
428 |
-
*/
|
429 |
-
public function move( $sFilePathSource, $sFilePathDestination ) {
|
430 |
-
$oFs = $this->getWpfs();
|
431 |
-
if ( $oFs && $oFs->move( $sFilePathSource, $sFilePathDestination ) ) {
|
432 |
-
return true;
|
433 |
-
}
|
434 |
-
return function_exists( 'rename' ) ? @rename( $sFilePathSource, $sFilePathDestination ) : null;
|
435 |
}
|
|
|
|
|
436 |
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
}
|
|
|
|
|
448 |
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
}
|
|
|
|
|
456 |
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
}
|
|
|
|
|
469 |
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
/**
|
481 |
-
*/
|
482 |
-
private function initFileSystem() {
|
483 |
-
if ( is_null( $this->oWpfs ) ) {
|
484 |
-
$this->oWpfs = false;
|
485 |
-
require_once( ABSPATH . 'wp-admin'.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'file.php' );
|
486 |
-
if ( WP_Filesystem() ) {
|
487 |
-
global $wp_filesystem;
|
488 |
-
if ( isset( $wp_filesystem ) && is_object( $wp_filesystem ) ) {
|
489 |
-
$this->oWpfs = $wp_filesystem;
|
490 |
-
}
|
491 |
}
|
492 |
}
|
493 |
}
|
494 |
}
|
495 |
-
|
1 |
<?php
|
2 |
+
if ( class_exists( 'ICWP_WPSF_WpFilesystem', false ) ) {
|
3 |
+
return;
|
4 |
+
}
|
5 |
+
|
6 |
+
class ICWP_WPSF_WpFilesystem {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @var ICWP_WPSF_WpFilesystem
|
10 |
+
*/
|
11 |
+
protected static $oInstance = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var WP_Filesystem_Base
|
15 |
+
*/
|
16 |
+
protected $oWpfs = null;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
protected $sWpConfigPath = null;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @return ICWP_WPSF_WpFilesystem
|
25 |
+
*/
|
26 |
+
public static function GetInstance() {
|
27 |
+
if ( is_null( self::$oInstance ) ) {
|
28 |
+
self::$oInstance = new self();
|
29 |
+
}
|
30 |
+
return self::$oInstance;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param string $sBase
|
35 |
+
* @param string $sPath
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function pathJoin( $sBase, $sPath ) {
|
39 |
+
return rtrim( $sBase, DIRECTORY_SEPARATOR ).DIRECTORY_SEPARATOR.ltrim( $sPath, DIRECTORY_SEPARATOR );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @param $sFilePath
|
44 |
+
* @return boolean|null true/false whether file/directory exists
|
45 |
+
*/
|
46 |
+
public function exists( $sFilePath ) {
|
47 |
+
$oFs = $this->getWpfs();
|
48 |
+
if ( $oFs && $oFs->exists( $sFilePath ) ) {
|
49 |
+
return true;
|
50 |
}
|
51 |
+
return function_exists( 'file_exists' ) ? file_exists( $sFilePath ) : null;
|
52 |
+
}
|
53 |
|
54 |
+
/**
|
55 |
+
* @param string $sNeedle
|
56 |
+
* @param string $sDir
|
57 |
+
* @param boolean $bIncludeExtension
|
58 |
+
* @param boolean $bCaseSensitive
|
59 |
+
* @return bool|null
|
60 |
+
*/
|
61 |
+
public function fileExistsInDir( $sNeedle, $sDir, $bIncludeExtension = true, $bCaseSensitive = false ) {
|
62 |
+
if ( empty( $sNeedle ) || empty( $sDir ) ) {
|
63 |
+
return false;
|
64 |
}
|
65 |
|
66 |
+
if ( !$bCaseSensitive ) {
|
67 |
+
$sNeedle = strtolower( $sNeedle );
|
68 |
+
}
|
69 |
+
|
70 |
+
$oDirIt = null;
|
71 |
+
$bUseDirectoryIterator = class_exists( 'DirectoryIterator', false );
|
72 |
+
if ( $bUseDirectoryIterator ) {
|
73 |
+
try {
|
74 |
+
$oDirIt = new DirectoryIterator( $sDir );
|
75 |
}
|
76 |
+
catch ( Exception $oE ) { // UnexpectedValueException, RuntimeException, Exception
|
77 |
+
$bUseDirectoryIterator = false; // Path doesn't exist or don't have access to open
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
+
}
|
80 |
|
81 |
+
if ( $bUseDirectoryIterator && $oDirIt ) {
|
82 |
+
|
83 |
+
//if the file you're searching for doesn't have an extension, then we don't include extensions in search
|
84 |
+
$nDotPosition = strpos( $sNeedle, '.' );
|
85 |
+
$bHasExtension = $nDotPosition !== false;
|
86 |
+
$bIncludeExtension = $bIncludeExtension && $bHasExtension;
|
87 |
+
|
88 |
+
$sNeedlePreExtension = $bHasExtension ? substr( $sNeedle, 0, $nDotPosition ) : $sNeedle;
|
89 |
|
90 |
+
$bFound = false;
|
91 |
+
foreach ( $oDirIt as $oFileItem ) {
|
92 |
+
if ( !$oFileItem->isFile() ) {
|
93 |
+
continue;
|
|
|
94 |
}
|
95 |
+
$sFilename = $oFileItem->getFilename();
|
96 |
+
if ( !$bCaseSensitive ) {
|
97 |
+
$sFilename = strtolower( $sFilename );
|
98 |
}
|
|
|
99 |
|
100 |
+
if ( $bIncludeExtension ) {
|
101 |
+
$bFound = ( $sFilename == $sNeedle );
|
102 |
+
}
|
103 |
+
else {
|
104 |
+
// This is not entirely accurate as it only finds whether a file "starts" with needle, ignoring subsequent characters
|
105 |
+
$bFound = ( strpos( $sFilename, $sNeedlePreExtension ) === 0 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
+
if ( $bFound ) {
|
109 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
}
|
112 |
|
113 |
+
return $bFound;
|
114 |
}
|
115 |
|
116 |
+
if ( $bCaseSensitive ) {
|
117 |
+
return $this->exists( $this->pathJoin( $sDir, $sNeedle ) );
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
+
$sNeedle = strtolower( $sNeedle );
|
120 |
+
if ( $oHandle = opendir( $sDir ) ) {
|
121 |
|
122 |
+
while ( false !== ( $sFileEntry = readdir( $oHandle ) ) ) {
|
123 |
+
if ( !$this->isFile( $this->pathJoin( $sDir, $sFileEntry ) ) ) {
|
124 |
+
continue;
|
125 |
+
}
|
126 |
+
if ( $sNeedle == strtolower( $sFileEntry ) ) {
|
127 |
+
return true;
|
128 |
}
|
129 |
}
|
130 |
}
|
131 |
|
132 |
+
return false;
|
133 |
+
}
|
|
|
134 |
|
135 |
+
/**
|
136 |
+
* Returns a path where all backslashes "\" are converted to "/"
|
137 |
+
* @param string $sPath
|
138 |
+
* @return string
|
139 |
+
*/
|
140 |
+
public function normalizeFilePathDS( $sPath ) {
|
141 |
+
return ( DIRECTORY_SEPARATOR == '/' ) ? $sPath : str_replace( '\\', '/', $sPath );
|
142 |
+
}
|
143 |
|
144 |
+
protected function setWpConfigPath() {
|
145 |
+
$this->sWpConfigPath = ABSPATH.'wp-config.php';
|
146 |
+
if ( !$this->exists( $this->sWpConfigPath ) ) {
|
147 |
+
$this->sWpConfigPath = ABSPATH.'..'.DIRECTORY_SEPARATOR.'wp-config.php';
|
148 |
+
if ( !$this->exists( $this->sWpConfigPath ) ) {
|
149 |
+
$this->sWpConfigPath = false;
|
150 |
+
}
|
|
|
|
|
|
|
151 |
}
|
152 |
+
}
|
153 |
|
154 |
+
public function getContent_WpConfig() {
|
155 |
+
return $this->getFileContent( $this->sWpConfigPath );
|
156 |
+
}
|
|
|
|
|
|
|
157 |
|
158 |
+
/**
|
159 |
+
* @param string $sContent
|
160 |
+
* @return bool
|
161 |
+
*/
|
162 |
+
public function putContent_WpConfig( $sContent ) {
|
163 |
+
return $this->putFileContent( $this->sWpConfigPath, $sContent );
|
164 |
+
}
|
165 |
|
166 |
+
/**
|
167 |
+
* @param string $sUrl
|
168 |
+
* @param boolean $bSecure
|
169 |
+
* @return boolean
|
170 |
+
*/
|
171 |
+
public function getIsUrlValid( $sUrl, $bSecure = false ) {
|
172 |
+
$sSchema = $bSecure ? 'https://' : 'http://';
|
173 |
+
$sUrl = ( strpos( $sUrl, 'http' ) !== 0 ) ? $sSchema.$sUrl : $sUrl;
|
174 |
+
return ( $this->getUrl( $sUrl ) != false );
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* @return string
|
179 |
+
*/
|
180 |
+
public function getWpConfigPath() {
|
181 |
+
return $this->sWpConfigPath;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* @param string $sUrl
|
186 |
+
* @param array $aRequestArgs
|
187 |
+
* @return array|WP_Error|bool
|
188 |
+
*/
|
189 |
+
public function requestUrl( $sUrl, $aRequestArgs = array(), $bAlwaysRawResponse = false ) {
|
190 |
+
|
191 |
+
$mResult = wp_remote_request( $sUrl, $aRequestArgs );
|
192 |
+
if ( $bAlwaysRawResponse ) {
|
193 |
return $mResult;
|
194 |
}
|
195 |
+
if ( is_wp_error( $mResult ) || !isset( $mResult[ 'response' ][ 'code' ] ) || $mResult[ 'response' ][ 'code' ] != 200 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
return false;
|
197 |
}
|
198 |
+
return $mResult;
|
199 |
+
}
|
200 |
|
201 |
+
/**
|
202 |
+
* @param string $sUrl
|
203 |
+
* @param array $aRequestArgs
|
204 |
+
* @return array|bool
|
205 |
+
*/
|
206 |
+
public function getUrl( $sUrl, $aRequestArgs = array() ) {
|
207 |
+
$aRequestArgs[ 'method' ] = 'GET';
|
208 |
+
return $this->requestUrl( $sUrl, $aRequestArgs );
|
209 |
+
}
|
210 |
|
211 |
+
/**
|
212 |
+
* @param string $sUrl
|
213 |
+
* @param array $aRequestArgs
|
214 |
+
* @return false|string
|
215 |
+
*/
|
216 |
+
public function getUrlContent( $sUrl, $aRequestArgs = array() ) {
|
217 |
+
$aResponse = $this->getUrl( $sUrl, $aRequestArgs );
|
218 |
+
if ( !$aResponse || !isset( $aResponse[ 'body' ] ) ) {
|
219 |
return false;
|
220 |
}
|
221 |
+
return $aResponse[ 'body' ];
|
222 |
+
}
|
223 |
|
224 |
+
/**
|
225 |
+
* @param string $sUrl
|
226 |
+
* @param array $aRequestArgs
|
227 |
+
* @return array|false
|
228 |
+
*/
|
229 |
+
public function postUrl( $sUrl, $aRequestArgs = array() ) {
|
230 |
+
$aRequestArgs[ 'method' ] = 'POST';
|
231 |
+
return $this->requestUrl( $sUrl, $aRequestArgs );
|
232 |
+
}
|
233 |
|
234 |
+
public function getCanWpRemoteGet() {
|
235 |
+
$aUrlsToTest = array(
|
236 |
+
'https://www.microsoft.com',
|
237 |
+
'https://www.google.com',
|
238 |
+
'https://www.facebook.com'
|
239 |
+
);
|
240 |
+
foreach ( $aUrlsToTest as $sUrl ) {
|
241 |
+
if ( $this->getUrl( $sUrl ) !== false ) {
|
242 |
+
return true;
|
243 |
+
}
|
244 |
}
|
245 |
+
return false;
|
246 |
+
}
|
247 |
|
248 |
+
public function getCanDiskWrite() {
|
249 |
+
$sFilePath = dirname( __FILE__ ).'/testfile.'.rand().'txt';
|
250 |
+
$sContents = "Testing icwp file read and write.";
|
|
|
|
|
|
|
251 |
|
252 |
+
// Write, read, verify, delete.
|
253 |
+
if ( $this->putFileContent( $sFilePath, $sContents ) ) {
|
254 |
+
$sFileContents = $this->getFileContent( $sFilePath );
|
255 |
+
if ( !is_null( $sFileContents ) && $sFileContents === $sContents ) {
|
256 |
+
return $this->deleteFile( $sFilePath );
|
257 |
}
|
258 |
+
}
|
259 |
+
return false;
|
260 |
+
}
|
261 |
|
262 |
+
/**
|
263 |
+
* @param string $sFilePath
|
264 |
+
* @return int|null
|
265 |
+
*/
|
266 |
+
public function getModifiedTime( $sFilePath ) {
|
267 |
+
return $this->getTime( $sFilePath, 'modified' );
|
268 |
+
}
|
269 |
|
270 |
+
/**
|
271 |
+
* @param string $sFilePath
|
272 |
+
* @return int|null
|
273 |
+
*/
|
274 |
+
public function getAccessedTime( $sFilePath ) {
|
275 |
+
return $this->getTime( $sFilePath, 'accessed' );
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* @param string $sFilePath
|
280 |
+
* @param string $sProperty
|
281 |
+
* @return int|null
|
282 |
+
*/
|
283 |
+
public function getTime( $sFilePath, $sProperty = 'modified' ) {
|
284 |
+
|
285 |
+
if ( !$this->exists( $sFilePath ) ) {
|
286 |
+
return null;
|
287 |
}
|
288 |
|
289 |
+
$oFs = $this->getWpfs();
|
290 |
+
switch ( $sProperty ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
+
case 'modified' :
|
293 |
+
return $oFs ? $oFs->mtime( $sFilePath ) : filemtime( $sFilePath );
|
294 |
+
break;
|
295 |
+
case 'accessed' :
|
296 |
+
return $oFs ? $oFs->atime( $sFilePath ) : fileatime( $sFilePath );
|
297 |
+
break;
|
298 |
+
default:
|
299 |
return null;
|
300 |
+
break;
|
301 |
+
}
|
302 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
+
/**
|
305 |
+
* @param string $sFilePath
|
306 |
+
* @return NULL|boolean
|
307 |
+
*/
|
308 |
+
public function getCanReadWriteFile( $sFilePath ) {
|
309 |
+
if ( !file_exists( $sFilePath ) ) {
|
310 |
+
return null;
|
311 |
}
|
312 |
|
313 |
+
$nFileSize = filesize( $sFilePath );
|
314 |
+
if ( $nFileSize === 0 ) {
|
315 |
+
return null;
|
316 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
|
318 |
+
$sFileContent = $this->getFileContent( $sFilePath );
|
319 |
+
if ( empty( $sFileContent ) ) {
|
320 |
+
return false; //can't even read the file!
|
321 |
+
}
|
322 |
+
return $this->putFileContent( $sFilePath, $sFileContent );
|
323 |
+
}
|
324 |
|
325 |
+
/**
|
326 |
+
* @param string $sFilePath
|
327 |
+
* @return string|null
|
328 |
+
*/
|
329 |
+
public function getFileContent( $sFilePath ) {
|
330 |
+
$sContents = null;
|
331 |
+
$oFs = $this->getWpfs();
|
332 |
+
if ( $oFs ) {
|
333 |
+
$sContents = $oFs->get_contents( $sFilePath );
|
334 |
}
|
335 |
|
336 |
+
if ( empty( $sContents ) && function_exists( 'file_get_contents' ) ) {
|
337 |
+
$sContents = file_get_contents( $sFilePath );
|
338 |
+
}
|
339 |
+
return $sContents;
|
340 |
+
}
|
|
|
|
|
|
|
|
|
|
|
341 |
|
342 |
+
/**
|
343 |
+
* @param $sFilePath
|
344 |
+
* @return bool
|
345 |
+
*/
|
346 |
+
public function getFileSize( $sFilePath ) {
|
347 |
+
$oFs = $this->getWpfs();
|
348 |
+
if ( $oFs && ( $oFs->size( $sFilePath ) > 0 ) ) {
|
349 |
+
return $oFs->size( $sFilePath );
|
350 |
}
|
351 |
+
return @filesize( $sFilePath );
|
352 |
+
}
|
353 |
|
354 |
+
/**
|
355 |
+
* @param string|null $sBaseDir
|
356 |
+
* @param string $sPrefix
|
357 |
+
* @param string $outsRandomDir
|
358 |
+
* @return bool|string
|
359 |
+
*/
|
360 |
+
public function getTempDir( $sBaseDir = null, $sPrefix = '', &$outsRandomDir = '' ) {
|
361 |
+
$sTemp = rtrim( ( is_null( $sBaseDir ) ? get_temp_dir() : $sBaseDir ), DIRECTORY_SEPARATOR ).DIRECTORY_SEPARATOR;
|
362 |
+
|
363 |
+
$sCharset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789';
|
364 |
+
do {
|
365 |
+
$sDir = $sPrefix;
|
366 |
+
for ( $i = 0 ; $i < 8 ; $i++ ) {
|
367 |
+
$sDir .= $sCharset[ ( rand()%strlen( $sCharset ) ) ];
|
368 |
}
|
369 |
+
} while ( is_dir( $sTemp.$sDir ) );
|
370 |
+
|
371 |
+
$outsRandomDir = $sDir;
|
372 |
+
|
373 |
+
$bSuccess = true;
|
374 |
+
if ( !@mkdir( $sTemp.$sDir, 0755, true ) ) {
|
375 |
+
$bSuccess = false;
|
376 |
}
|
377 |
+
return ( $bSuccess ? $sTemp.$sDir : false );
|
378 |
+
}
|
379 |
|
380 |
+
/**
|
381 |
+
* @param string $sFilePath
|
382 |
+
* @param string $sContents
|
383 |
+
* @return boolean
|
384 |
+
*/
|
385 |
+
public function putFileContent( $sFilePath, $sContents ) {
|
386 |
+
$oFs = $this->getWpfs();
|
387 |
+
if ( $oFs && $oFs->put_contents( $sFilePath, $sContents, FS_CHMOD_FILE ) ) {
|
388 |
+
return true;
|
|
|
389 |
}
|
390 |
|
391 |
+
if ( function_exists( 'file_put_contents' ) ) {
|
392 |
+
return file_put_contents( $sFilePath, $sContents ) !== false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
}
|
394 |
+
return false;
|
395 |
+
}
|
396 |
|
397 |
+
/**
|
398 |
+
* Recursive delete
|
399 |
+
* @param string $sDir
|
400 |
+
* @return bool
|
401 |
+
*/
|
402 |
+
public function deleteDir( $sDir ) {
|
403 |
+
$oFs = $this->getWpfs();
|
404 |
+
if ( $oFs && $oFs->rmdir( $sDir, true ) ) {
|
405 |
+
return true;
|
406 |
+
}
|
407 |
+
return @rmdir( $sDir );
|
408 |
+
}
|
409 |
+
|
410 |
+
/**
|
411 |
+
* @param string $sFilePath
|
412 |
+
* @return boolean|null
|
413 |
+
*/
|
414 |
+
public function deleteFile( $sFilePath ) {
|
415 |
+
$oFs = $this->getWpfs();
|
416 |
+
if ( $oFs && $oFs->delete( $sFilePath ) ) {
|
417 |
+
return true;
|
418 |
}
|
419 |
+
return function_exists( 'unlink' ) ? @unlink( $sFilePath ) : null;
|
420 |
+
}
|
421 |
|
422 |
+
/**
|
423 |
+
* @param string $sFilePathSource
|
424 |
+
* @param string $sFilePathDestination
|
425 |
+
* @return bool|null
|
426 |
+
*/
|
427 |
+
public function move( $sFilePathSource, $sFilePathDestination ) {
|
428 |
+
$oFs = $this->getWpfs();
|
429 |
+
if ( $oFs && $oFs->move( $sFilePathSource, $sFilePathDestination ) ) {
|
430 |
+
return true;
|
431 |
+
}
|
432 |
+
return function_exists( 'rename' ) ? @rename( $sFilePathSource, $sFilePathDestination ) : null;
|
433 |
+
}
|
434 |
+
|
435 |
+
/**
|
436 |
+
* @param $sFilePath
|
437 |
+
* @return bool|mixed
|
438 |
+
*/
|
439 |
+
public function isFile( $sFilePath ) {
|
440 |
+
$oFs = $this->getWpfs();
|
441 |
+
if ( $oFs && $oFs->is_file( $sFilePath ) ) {
|
442 |
+
return true;
|
443 |
}
|
444 |
+
return function_exists( 'is_file' ) ? is_file( $sFilePath ) : null;
|
445 |
+
}
|
446 |
|
447 |
+
/**
|
448 |
+
* @param $sDirPath
|
449 |
+
* @return bool
|
450 |
+
*/
|
451 |
+
public function mkdir( $sDirPath ) {
|
452 |
+
return wp_mkdir_p( $sDirPath );
|
453 |
+
}
|
454 |
+
|
455 |
+
/**
|
456 |
+
* @param string $sFilePath
|
457 |
+
* @param int $nTime
|
458 |
+
* @return bool|mixed
|
459 |
+
*/
|
460 |
+
public function touch( $sFilePath, $nTime = null ) {
|
461 |
+
$oFs = $this->getWpfs();
|
462 |
+
if ( $oFs && $oFs->touch( $sFilePath, $nTime ) ) {
|
463 |
+
return true;
|
464 |
+
}
|
465 |
+
return function_exists( 'touch' ) ? @touch( $sFilePath, $nTime ) : null;
|
466 |
+
}
|
467 |
+
|
468 |
+
/**
|
469 |
+
* @return WP_Filesystem_Base
|
470 |
+
*/
|
471 |
+
protected function getWpfs() {
|
472 |
+
if ( is_null( $this->oWpfs ) ) {
|
473 |
+
$this->initFileSystem();
|
474 |
}
|
475 |
+
return $this->oWpfs;
|
476 |
+
}
|
477 |
|
478 |
+
/**
|
479 |
+
*/
|
480 |
+
private function initFileSystem() {
|
481 |
+
if ( is_null( $this->oWpfs ) ) {
|
482 |
+
$this->oWpfs = false;
|
483 |
+
require_once( ABSPATH.'wp-admin'.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'file.php' );
|
484 |
+
if ( WP_Filesystem() ) {
|
485 |
+
global $wp_filesystem;
|
486 |
+
if ( isset( $wp_filesystem ) && is_object( $wp_filesystem ) ) {
|
487 |
+
$this->oWpfs = $wp_filesystem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
}
|
489 |
}
|
490 |
}
|
491 |
}
|
492 |
+
}
|
src/common/icwp-wpfunctions.php
CHANGED
@@ -512,6 +512,7 @@ class ICWP_WPSF_WpFunctions extends ICWP_WPSF_Foundation {
|
|
512 |
}
|
513 |
|
514 |
/**
|
|
|
515 |
* @return bool
|
516 |
*/
|
517 |
public function isLoginUrl( $sUrlPath ) {
|
512 |
}
|
513 |
|
514 |
/**
|
515 |
+
* @param string $sUrlPath
|
516 |
* @return bool
|
517 |
*/
|
518 |
public function isLoginUrl( $sUrlPath ) {
|
src/common/lib/composer.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "shield requirement",
|
3 |
+
"description": "shield requirement",
|
4 |
+
"authors": [
|
5 |
+
{
|
6 |
+
"name": "Paul Goodchild",
|
7 |
+
"email": "paul@paulgoodchild.me",
|
8 |
+
"homepage": "https://paulgoodchild.me"
|
9 |
+
}
|
10 |
+
],
|
11 |
+
"license": "MIT",
|
12 |
+
"keywords": [
|
13 |
+
],
|
14 |
+
"repositories": [
|
15 |
+
],
|
16 |
+
"require": {
|
17 |
+
"php": ">=5.3.3",
|
18 |
+
"fernleafsystems/utilities": "^1.0",
|
19 |
+
"nesbot/carbon": "^1.22.0",
|
20 |
+
"twig/twig": "^1.0"
|
21 |
+
},
|
22 |
+
"require-dev": {
|
23 |
+
},
|
24 |
+
"autoload": {
|
25 |
+
"psr-4": {
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
src/common/lib/composer.lock
ADDED
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "2689fdaca716a455a807827f8266ed2e",
|
8 |
+
"packages": [
|
9 |
+
{
|
10 |
+
"name": "fernleafsystems/utilities",
|
11 |
+
"version": "1.1.0",
|
12 |
+
"source": {
|
13 |
+
"type": "git",
|
14 |
+
"url": "https://github.com/FernleafSystems/Utilities.git",
|
15 |
+
"reference": "0195f7ff690cc5163174f033d6bc92b3eac20c03"
|
16 |
+
},
|
17 |
+
"dist": {
|
18 |
+
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/FernleafSystems/Utilities/zipball/0195f7ff690cc5163174f033d6bc92b3eac20c03",
|
20 |
+
"reference": "0195f7ff690cc5163174f033d6bc92b3eac20c03",
|
21 |
+
"shasum": ""
|
22 |
+
},
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.4"
|
25 |
+
},
|
26 |
+
"type": "library",
|
27 |
+
"autoload": {
|
28 |
+
"psr-4": {
|
29 |
+
"FernleafSystems\\Utilities\\": "src"
|
30 |
+
}
|
31 |
+
},
|
32 |
+
"notification-url": "https://packagist.org/downloads/",
|
33 |
+
"authors": [
|
34 |
+
{
|
35 |
+
"name": "Paul Goodchild",
|
36 |
+
"email": "paul@paulgoodchild.me",
|
37 |
+
"homepage": "https://paulgoodchild.me"
|
38 |
+
}
|
39 |
+
],
|
40 |
+
"description": "Collection of simple utilities and traits",
|
41 |
+
"time": "2017-12-09T13:31:16+00:00"
|
42 |
+
},
|
43 |
+
{
|
44 |
+
"name": "nesbot/carbon",
|
45 |
+
"version": "1.22.1",
|
46 |
+
"source": {
|
47 |
+
"type": "git",
|
48 |
+
"url": "https://github.com/briannesbitt/Carbon.git",
|
49 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc"
|
50 |
+
},
|
51 |
+
"dist": {
|
52 |
+
"type": "zip",
|
53 |
+
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
54 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
55 |
+
"shasum": ""
|
56 |
+
},
|
57 |
+
"require": {
|
58 |
+
"php": ">=5.3.0",
|
59 |
+
"symfony/translation": "~2.6 || ~3.0"
|
60 |
+
},
|
61 |
+
"require-dev": {
|
62 |
+
"friendsofphp/php-cs-fixer": "~2",
|
63 |
+
"phpunit/phpunit": "~4.0 || ~5.0"
|
64 |
+
},
|
65 |
+
"type": "library",
|
66 |
+
"extra": {
|
67 |
+
"branch-alias": {
|
68 |
+
"dev-master": "1.23-dev"
|
69 |
+
}
|
70 |
+
},
|
71 |
+
"autoload": {
|
72 |
+
"psr-4": {
|
73 |
+
"Carbon\\": "src/Carbon/"
|
74 |
+
}
|
75 |
+
},
|
76 |
+
"notification-url": "https://packagist.org/downloads/",
|
77 |
+
"license": [
|
78 |
+
"MIT"
|
79 |
+
],
|
80 |
+
"authors": [
|
81 |
+
{
|
82 |
+
"name": "Brian Nesbitt",
|
83 |
+
"email": "brian@nesbot.com",
|
84 |
+
"homepage": "http://nesbot.com"
|
85 |
+
}
|
86 |
+
],
|
87 |
+
"description": "A simple API extension for DateTime.",
|
88 |
+
"homepage": "http://carbon.nesbot.com",
|
89 |
+
"keywords": [
|
90 |
+
"date",
|
91 |
+
"datetime",
|
92 |
+
"time"
|
93 |
+
],
|
94 |
+
"time": "2017-01-16T07:55:07+00:00"
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"name": "symfony/polyfill-mbstring",
|
98 |
+
"version": "v1.6.0",
|
99 |
+
"source": {
|
100 |
+
"type": "git",
|
101 |
+
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
102 |
+
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296"
|
103 |
+
},
|
104 |
+
"dist": {
|
105 |
+
"type": "zip",
|
106 |
+
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
|
107 |
+
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
|
108 |
+
"shasum": ""
|
109 |
+
},
|
110 |
+
"require": {
|
111 |
+
"php": ">=5.3.3"
|
112 |
+
},
|
113 |
+
"suggest": {
|
114 |
+
"ext-mbstring": "For best performance"
|
115 |
+
},
|
116 |
+
"type": "library",
|
117 |
+
"extra": {
|
118 |
+
"branch-alias": {
|
119 |
+
"dev-master": "1.6-dev"
|
120 |
+
}
|
121 |
+
},
|
122 |
+
"autoload": {
|
123 |
+
"psr-4": {
|
124 |
+
"Symfony\\Polyfill\\Mbstring\\": ""
|
125 |
+
},
|
126 |
+
"files": [
|
127 |
+
"bootstrap.php"
|
128 |
+
]
|
129 |
+
},
|
130 |
+
"notification-url": "https://packagist.org/downloads/",
|
131 |
+
"license": [
|
132 |
+
"MIT"
|
133 |
+
],
|
134 |
+
"authors": [
|
135 |
+
{
|
136 |
+
"name": "Nicolas Grekas",
|
137 |
+
"email": "p@tchwork.com"
|
138 |
+
},
|
139 |
+
{
|
140 |
+
"name": "Symfony Community",
|
141 |
+
"homepage": "https://symfony.com/contributors"
|
142 |
+
}
|
143 |
+
],
|
144 |
+
"description": "Symfony polyfill for the Mbstring extension",
|
145 |
+
"homepage": "https://symfony.com",
|
146 |
+
"keywords": [
|
147 |
+
"compatibility",
|
148 |
+
"mbstring",
|
149 |
+
"polyfill",
|
150 |
+
"portable",
|
151 |
+
"shim"
|
152 |
+
],
|
153 |
+
"time": "2017-10-11T12:05:26+00:00"
|
154 |
+
},
|
155 |
+
{
|
156 |
+
"name": "symfony/translation",
|
157 |
+
"version": "v3.4.2",
|
158 |
+
"source": {
|
159 |
+
"type": "git",
|
160 |
+
"url": "https://github.com/symfony/translation.git",
|
161 |
+
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6"
|
162 |
+
},
|
163 |
+
"dist": {
|
164 |
+
"type": "zip",
|
165 |
+
"url": "https://api.github.com/repos/symfony/translation/zipball/4c5d5582baf2829751a5207659329c1f52eedeb6",
|
166 |
+
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6",
|
167 |
+
"shasum": ""
|
168 |
+
},
|
169 |
+
"require": {
|
170 |
+
"php": "^5.5.9|>=7.0.8",
|
171 |
+
"symfony/polyfill-mbstring": "~1.0"
|
172 |
+
},
|
173 |
+
"conflict": {
|
174 |
+
"symfony/config": "<2.8",
|
175 |
+
"symfony/dependency-injection": "<3.4",
|
176 |
+
"symfony/yaml": "<3.4"
|
177 |
+
},
|
178 |
+
"require-dev": {
|
179 |
+
"psr/log": "~1.0",
|
180 |
+
"symfony/config": "~2.8|~3.0|~4.0",
|
181 |
+
"symfony/dependency-injection": "~3.4|~4.0",
|
182 |
+
"symfony/finder": "~2.8|~3.0|~4.0",
|
183 |
+
"symfony/intl": "^2.8.18|^3.2.5|~4.0",
|
184 |
+
"symfony/yaml": "~3.4|~4.0"
|
185 |
+
},
|
186 |
+
"suggest": {
|
187 |
+
"psr/log": "To use logging capability in translator",
|
188 |
+
"symfony/config": "",
|
189 |
+
"symfony/yaml": ""
|
190 |
+
},
|
191 |
+
"type": "library",
|
192 |
+
"extra": {
|
193 |
+
"branch-alias": {
|
194 |
+
"dev-master": "3.4-dev"
|
195 |
+
}
|
196 |
+
},
|
197 |
+
"autoload": {
|
198 |
+
"psr-4": {
|
199 |
+
"Symfony\\Component\\Translation\\": ""
|
200 |
+
},
|
201 |
+
"exclude-from-classmap": [
|
202 |
+
"/Tests/"
|
203 |
+
]
|
204 |
+
},
|
205 |
+
"notification-url": "https://packagist.org/downloads/",
|
206 |
+
"license": [
|
207 |
+
"MIT"
|
208 |
+
],
|
209 |
+
"authors": [
|
210 |
+
{
|
211 |
+
"name": "Fabien Potencier",
|
212 |
+
"email": "fabien@symfony.com"
|
213 |
+
},
|
214 |
+
{
|
215 |
+
"name": "Symfony Community",
|
216 |
+
"homepage": "https://symfony.com/contributors"
|
217 |
+
}
|
218 |
+
],
|
219 |
+
"description": "Symfony Translation Component",
|
220 |
+
"homepage": "https://symfony.com",
|
221 |
+
"time": "2017-12-12T08:27:14+00:00"
|
222 |
+
},
|
223 |
+
{
|
224 |
+
"name": "twig/twig",
|
225 |
+
"version": "v1.35.0",
|
226 |
+
"source": {
|
227 |
+
"type": "git",
|
228 |
+
"url": "https://github.com/twigphp/Twig.git",
|
229 |
+
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f"
|
230 |
+
},
|
231 |
+
"dist": {
|
232 |
+
"type": "zip",
|
233 |
+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f",
|
234 |
+
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f",
|
235 |
+
"shasum": ""
|
236 |
+
},
|
237 |
+
"require": {
|
238 |
+
"php": ">=5.3.3"
|
239 |
+
},
|
240 |
+
"require-dev": {
|
241 |
+
"psr/container": "^1.0",
|
242 |
+
"symfony/debug": "~2.7",
|
243 |
+
"symfony/phpunit-bridge": "~3.3@dev"
|
244 |
+
},
|
245 |
+
"type": "library",
|
246 |
+
"extra": {
|
247 |
+
"branch-alias": {
|
248 |
+
"dev-master": "1.35-dev"
|
249 |
+
}
|
250 |
+
},
|
251 |
+
"autoload": {
|
252 |
+
"psr-0": {
|
253 |
+
"Twig_": "lib/"
|
254 |
+
},
|
255 |
+
"psr-4": {
|
256 |
+
"Twig\\": "src/"
|
257 |
+
}
|
258 |
+
},
|
259 |
+
"notification-url": "https://packagist.org/downloads/",
|
260 |
+
"license": [
|
261 |
+
"BSD-3-Clause"
|
262 |
+
],
|
263 |
+
"authors": [
|
264 |
+
{
|
265 |
+
"name": "Fabien Potencier",
|
266 |
+
"email": "fabien@symfony.com",
|
267 |
+
"homepage": "http://fabien.potencier.org",
|
268 |
+
"role": "Lead Developer"
|
269 |
+
},
|
270 |
+
{
|
271 |
+
"name": "Armin Ronacher",
|
272 |
+
"email": "armin.ronacher@active-4.com",
|
273 |
+
"role": "Project Founder"
|
274 |
+
},
|
275 |
+
{
|
276 |
+
"name": "Twig Team",
|
277 |
+
"homepage": "http://twig.sensiolabs.org/contributors",
|
278 |
+
"role": "Contributors"
|
279 |
+
}
|
280 |
+
],
|
281 |
+
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
282 |
+
"homepage": "http://twig.sensiolabs.org",
|
283 |
+
"keywords": [
|
284 |
+
"templating"
|
285 |
+
],
|
286 |
+
"time": "2017-09-27T18:06:46+00:00"
|
287 |
+
}
|
288 |
+
],
|
289 |
+
"packages-dev": [],
|
290 |
+
"aliases": [],
|
291 |
+
"minimum-stability": "stable",
|
292 |
+
"stability-flags": [],
|
293 |
+
"prefer-stable": false,
|
294 |
+
"prefer-lowest": false,
|
295 |
+
"platform": {
|
296 |
+
"php": ">=5.3.3"
|
297 |
+
},
|
298 |
+
"platform-dev": []
|
299 |
+
}
|
src/common/lib/vendor/autoload.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload.php @generated by Composer
|
4 |
+
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
+
|
7 |
+
return ComposerAutoloaderInit18a31866e67f0a0bfffdc031786ecae1::getLoader();
|
src/common/lib/vendor/composer/ClassLoader.php
ADDED
@@ -0,0 +1,445 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer\Autoload;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
17 |
+
*
|
18 |
+
* $loader = new \Composer\Autoload\ClassLoader();
|
19 |
+
*
|
20 |
+
* // register classes with namespaces
|
21 |
+
* $loader->add('Symfony\Component', __DIR__.'/component');
|
22 |
+
* $loader->add('Symfony', __DIR__.'/framework');
|
23 |
+
*
|
24 |
+
* // activate the autoloader
|
25 |
+
* $loader->register();
|
26 |
+
*
|
27 |
+
* // to enable searching the include path (eg. for PEAR packages)
|
28 |
+
* $loader->setUseIncludePath(true);
|
29 |
+
*
|
30 |
+
* In this example, if you try to use a class in the Symfony\Component
|
31 |
+
* namespace or one of its children (Symfony\Component\Console for instance),
|
32 |
+
* the autoloader will first look for the class under the component/
|
33 |
+
* directory, and it will then fallback to the framework/ directory if not
|
34 |
+
* found before giving up.
|
35 |
+
*
|
36 |
+
* This class is loosely based on the Symfony UniversalClassLoader.
|
37 |
+
*
|
38 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see http://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see http://www.php-fig.org/psr/psr-4/
|
42 |
+
*/
|
43 |
+
class ClassLoader
|
44 |
+
{
|
45 |
+
// PSR-4
|
46 |
+
private $prefixLengthsPsr4 = array();
|
47 |
+
private $prefixDirsPsr4 = array();
|
48 |
+
private $fallbackDirsPsr4 = array();
|
49 |
+
|
50 |
+
// PSR-0
|
51 |
+
private $prefixesPsr0 = array();
|
52 |
+
private $fallbackDirsPsr0 = array();
|
53 |
+
|
54 |
+
private $useIncludePath = false;
|
55 |
+
private $classMap = array();
|
56 |
+
private $classMapAuthoritative = false;
|
57 |
+
private $missingClasses = array();
|
58 |
+
private $apcuPrefix;
|
59 |
+
|
60 |
+
public function getPrefixes()
|
61 |
+
{
|
62 |
+
if (!empty($this->prefixesPsr0)) {
|
63 |
+
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
64 |
+
}
|
65 |
+
|
66 |
+
return array();
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getPrefixesPsr4()
|
70 |
+
{
|
71 |
+
return $this->prefixDirsPsr4;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getFallbackDirs()
|
75 |
+
{
|
76 |
+
return $this->fallbackDirsPsr0;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getFallbackDirsPsr4()
|
80 |
+
{
|
81 |
+
return $this->fallbackDirsPsr4;
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getClassMap()
|
85 |
+
{
|
86 |
+
return $this->classMap;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* @param array $classMap Class to filename map
|
91 |
+
*/
|
92 |
+
public function addClassMap(array $classMap)
|
93 |
+
{
|
94 |
+
if ($this->classMap) {
|
95 |
+
$this->classMap = array_merge($this->classMap, $classMap);
|
96 |
+
} else {
|
97 |
+
$this->classMap = $classMap;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Registers a set of PSR-0 directories for a given prefix, either
|
103 |
+
* appending or prepending to the ones previously set for this prefix.
|
104 |
+
*
|
105 |
+
* @param string $prefix The prefix
|
106 |
+
* @param array|string $paths The PSR-0 root directories
|
107 |
+
* @param bool $prepend Whether to prepend the directories
|
108 |
+
*/
|
109 |
+
public function add($prefix, $paths, $prepend = false)
|
110 |
+
{
|
111 |
+
if (!$prefix) {
|
112 |
+
if ($prepend) {
|
113 |
+
$this->fallbackDirsPsr0 = array_merge(
|
114 |
+
(array) $paths,
|
115 |
+
$this->fallbackDirsPsr0
|
116 |
+
);
|
117 |
+
} else {
|
118 |
+
$this->fallbackDirsPsr0 = array_merge(
|
119 |
+
$this->fallbackDirsPsr0,
|
120 |
+
(array) $paths
|
121 |
+
);
|
122 |
+
}
|
123 |
+
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
$first = $prefix[0];
|
128 |
+
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
129 |
+
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
130 |
+
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
if ($prepend) {
|
134 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
135 |
+
(array) $paths,
|
136 |
+
$this->prefixesPsr0[$first][$prefix]
|
137 |
+
);
|
138 |
+
} else {
|
139 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
140 |
+
$this->prefixesPsr0[$first][$prefix],
|
141 |
+
(array) $paths
|
142 |
+
);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Registers a set of PSR-4 directories for a given namespace, either
|
148 |
+
* appending or prepending to the ones previously set for this namespace.
|
149 |
+
*
|
150 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
151 |
+
* @param array|string $paths The PSR-4 base directories
|
152 |
+
* @param bool $prepend Whether to prepend the directories
|
153 |
+
*
|
154 |
+
* @throws \InvalidArgumentException
|
155 |
+
*/
|
156 |
+
public function addPsr4($prefix, $paths, $prepend = false)
|
157 |
+
{
|
158 |
+
if (!$prefix) {
|
159 |
+
// Register directories for the root namespace.
|
160 |
+
if ($prepend) {
|
161 |
+
$this->fallbackDirsPsr4 = array_merge(
|
162 |
+
(array) $paths,
|
163 |
+
$this->fallbackDirsPsr4
|
164 |
+
);
|
165 |
+
} else {
|
166 |
+
$this->fallbackDirsPsr4 = array_merge(
|
167 |
+
$this->fallbackDirsPsr4,
|
168 |
+
(array) $paths
|
169 |
+
);
|
170 |
+
}
|
171 |
+
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
172 |
+
// Register directories for a new namespace.
|
173 |
+
$length = strlen($prefix);
|
174 |
+
if ('\\' !== $prefix[$length - 1]) {
|
175 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
176 |
+
}
|
177 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
178 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
179 |
+
} elseif ($prepend) {
|
180 |
+
// Prepend directories for an already registered namespace.
|
181 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
182 |
+
(array) $paths,
|
183 |
+
$this->prefixDirsPsr4[$prefix]
|
184 |
+
);
|
185 |
+
} else {
|
186 |
+
// Append directories for an already registered namespace.
|
187 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
188 |
+
$this->prefixDirsPsr4[$prefix],
|
189 |
+
(array) $paths
|
190 |
+
);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Registers a set of PSR-0 directories for a given prefix,
|
196 |
+
* replacing any others previously set for this prefix.
|
197 |
+
*
|
198 |
+
* @param string $prefix The prefix
|
199 |
+
* @param array|string $paths The PSR-0 base directories
|
200 |
+
*/
|
201 |
+
public function set($prefix, $paths)
|
202 |
+
{
|
203 |
+
if (!$prefix) {
|
204 |
+
$this->fallbackDirsPsr0 = (array) $paths;
|
205 |
+
} else {
|
206 |
+
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Registers a set of PSR-4 directories for a given namespace,
|
212 |
+
* replacing any others previously set for this namespace.
|
213 |
+
*
|
214 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
215 |
+
* @param array|string $paths The PSR-4 base directories
|
216 |
+
*
|
217 |
+
* @throws \InvalidArgumentException
|
218 |
+
*/
|
219 |
+
public function setPsr4($prefix, $paths)
|
220 |
+
{
|
221 |
+
if (!$prefix) {
|
222 |
+
$this->fallbackDirsPsr4 = (array) $paths;
|
223 |
+
} else {
|
224 |
+
$length = strlen($prefix);
|
225 |
+
if ('\\' !== $prefix[$length - 1]) {
|
226 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
227 |
+
}
|
228 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
229 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Turns on searching the include path for class files.
|
235 |
+
*
|
236 |
+
* @param bool $useIncludePath
|
237 |
+
*/
|
238 |
+
public function setUseIncludePath($useIncludePath)
|
239 |
+
{
|
240 |
+
$this->useIncludePath = $useIncludePath;
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Can be used to check if the autoloader uses the include path to check
|
245 |
+
* for classes.
|
246 |
+
*
|
247 |
+
* @return bool
|
248 |
+
*/
|
249 |
+
public function getUseIncludePath()
|
250 |
+
{
|
251 |
+
return $this->useIncludePath;
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Turns off searching the prefix and fallback directories for classes
|
256 |
+
* that have not been registered with the class map.
|
257 |
+
*
|
258 |
+
* @param bool $classMapAuthoritative
|
259 |
+
*/
|
260 |
+
public function setClassMapAuthoritative($classMapAuthoritative)
|
261 |
+
{
|
262 |
+
$this->classMapAuthoritative = $classMapAuthoritative;
|
263 |
+
}
|
264 |
+
|
265 |
+
/**
|
266 |
+
* Should class lookup fail if not found in the current class map?
|
267 |
+
*
|
268 |
+
* @return bool
|
269 |
+
*/
|
270 |
+
public function isClassMapAuthoritative()
|
271 |
+
{
|
272 |
+
return $this->classMapAuthoritative;
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
277 |
+
*
|
278 |
+
* @param string|null $apcuPrefix
|
279 |
+
*/
|
280 |
+
public function setApcuPrefix($apcuPrefix)
|
281 |
+
{
|
282 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* The APCu prefix in use, or null if APCu caching is not enabled.
|
287 |
+
*
|
288 |
+
* @return string|null
|
289 |
+
*/
|
290 |
+
public function getApcuPrefix()
|
291 |
+
{
|
292 |
+
return $this->apcuPrefix;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Registers this instance as an autoloader.
|
297 |
+
*
|
298 |
+
* @param bool $prepend Whether to prepend the autoloader or not
|
299 |
+
*/
|
300 |
+
public function register($prepend = false)
|
301 |
+
{
|
302 |
+
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Unregisters this instance as an autoloader.
|
307 |
+
*/
|
308 |
+
public function unregister()
|
309 |
+
{
|
310 |
+
spl_autoload_unregister(array($this, 'loadClass'));
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Loads the given class or interface.
|
315 |
+
*
|
316 |
+
* @param string $class The name of the class
|
317 |
+
* @return bool|null True if loaded, null otherwise
|
318 |
+
*/
|
319 |
+
public function loadClass($class)
|
320 |
+
{
|
321 |
+
if ($file = $this->findFile($class)) {
|
322 |
+
includeFile($file);
|
323 |
+
|
324 |
+
return true;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Finds the path to the file where the class is defined.
|
330 |
+
*
|
331 |
+
* @param string $class The name of the class
|
332 |
+
*
|
333 |
+
* @return string|false The path if found, false otherwise
|
334 |
+
*/
|
335 |
+
public function findFile($class)
|
336 |
+
{
|
337 |
+
// class map lookup
|
338 |
+
if (isset($this->classMap[$class])) {
|
339 |
+
return $this->classMap[$class];
|
340 |
+
}
|
341 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
342 |
+
return false;
|
343 |
+
}
|
344 |
+
if (null !== $this->apcuPrefix) {
|
345 |
+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
346 |
+
if ($hit) {
|
347 |
+
return $file;
|
348 |
+
}
|
349 |
+
}
|
350 |
+
|
351 |
+
$file = $this->findFileWithExtension($class, '.php');
|
352 |
+
|
353 |
+
// Search for Hack files if we are running on HHVM
|
354 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
355 |
+
$file = $this->findFileWithExtension($class, '.hh');
|
356 |
+
}
|
357 |
+
|
358 |
+
if (null !== $this->apcuPrefix) {
|
359 |
+
apcu_add($this->apcuPrefix.$class, $file);
|
360 |
+
}
|
361 |
+
|
362 |
+
if (false === $file) {
|
363 |
+
// Remember that this class does not exist.
|
364 |
+
$this->missingClasses[$class] = true;
|
365 |
+
}
|
366 |
+
|
367 |
+
return $file;
|
368 |
+
}
|
369 |
+
|
370 |
+
private function findFileWithExtension($class, $ext)
|
371 |
+
{
|
372 |
+
// PSR-4 lookup
|
373 |
+
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
374 |
+
|
375 |
+
$first = $class[0];
|
376 |
+
if (isset($this->prefixLengthsPsr4[$first])) {
|
377 |
+
$subPath = $class;
|
378 |
+
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
379 |
+
$subPath = substr($subPath, 0, $lastPos);
|
380 |
+
$search = $subPath.'\\';
|
381 |
+
if (isset($this->prefixDirsPsr4[$search])) {
|
382 |
+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
383 |
+
$length = $this->prefixLengthsPsr4[$first][$search];
|
384 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
385 |
+
return $file;
|
386 |
+
}
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
// PSR-4 fallback dirs
|
393 |
+
foreach ($this->fallbackDirsPsr4 as $dir) {
|
394 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
395 |
+
return $file;
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
// PSR-0 lookup
|
400 |
+
if (false !== $pos = strrpos($class, '\\')) {
|
401 |
+
// namespaced class name
|
402 |
+
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
403 |
+
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
404 |
+
} else {
|
405 |
+
// PEAR-like class name
|
406 |
+
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
407 |
+
}
|
408 |
+
|
409 |
+
if (isset($this->prefixesPsr0[$first])) {
|
410 |
+
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
411 |
+
if (0 === strpos($class, $prefix)) {
|
412 |
+
foreach ($dirs as $dir) {
|
413 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
414 |
+
return $file;
|
415 |
+
}
|
416 |
+
}
|
417 |
+
}
|
418 |
+
}
|
419 |
+
}
|
420 |
+
|
421 |
+
// PSR-0 fallback dirs
|
422 |
+
foreach ($this->fallbackDirsPsr0 as $dir) {
|
423 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
424 |
+
return $file;
|
425 |
+
}
|
426 |
+
}
|
427 |
+
|
428 |
+
// PSR-0 include paths.
|
429 |
+
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
430 |
+
return $file;
|
431 |
+
}
|
432 |
+
|
433 |
+
return false;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
/**
|
438 |
+
* Scope isolated include.
|
439 |
+
*
|
440 |
+
* Prevents access to $this/self from included files.
|
441 |
+
*/
|
442 |
+
function includeFile($file)
|
443 |
+
{
|
444 |
+
include $file;
|
445 |
+
}
|
src/common/lib/vendor/composer/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Copyright (c) Nils Adermann, Jordi Boggiano
|
3 |
+
|
4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
+
of this software and associated documentation files (the "Software"), to deal
|
6 |
+
in the Software without restriction, including without limitation the rights
|
7 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
9 |
+
to do so, subject to the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be included in all
|
12 |
+
copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
+
THE SOFTWARE.
|
21 |
+
|
src/common/lib/vendor/composer/autoload_classmap.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_classmap.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
);
|
src/common/lib/vendor/composer/autoload_files.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_files.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
10 |
+
);
|
src/common/lib/vendor/composer/autoload_namespaces.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_namespaces.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
10 |
+
);
|
src/common/lib/vendor/composer/autoload_psr4.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_psr4.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Twig\\' => array($vendorDir . '/twig/twig/src'),
|
10 |
+
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
11 |
+
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
|
12 |
+
'FernleafSystems\\Utilities\\' => array($vendorDir . '/fernleafsystems/utilities/src'),
|
13 |
+
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
|
14 |
+
);
|
src/common/lib/vendor/composer/autoload_real.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_real.php @generated by Composer
|
4 |
+
|
5 |
+
class ComposerAutoloaderInit18a31866e67f0a0bfffdc031786ecae1
|
6 |
+
{
|
7 |
+
private static $loader;
|
8 |
+
|
9 |
+
public static function loadClassLoader($class)
|
10 |
+
{
|
11 |
+
if ('Composer\Autoload\ClassLoader' === $class) {
|
12 |
+
require __DIR__ . '/ClassLoader.php';
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
public static function getLoader()
|
17 |
+
{
|
18 |
+
if (null !== self::$loader) {
|
19 |
+
return self::$loader;
|
20 |
+
}
|
21 |
+
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit18a31866e67f0a0bfffdc031786ecae1', 'loadClassLoader'), true, true);
|
23 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit18a31866e67f0a0bfffdc031786ecae1', 'loadClassLoader'));
|
25 |
+
|
26 |
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
+
if ($useStaticLoader) {
|
28 |
+
require_once __DIR__ . '/autoload_static.php';
|
29 |
+
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1::getInitializer($loader));
|
31 |
+
} else {
|
32 |
+
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
+
foreach ($map as $namespace => $path) {
|
34 |
+
$loader->set($namespace, $path);
|
35 |
+
}
|
36 |
+
|
37 |
+
$map = require __DIR__ . '/autoload_psr4.php';
|
38 |
+
foreach ($map as $namespace => $path) {
|
39 |
+
$loader->setPsr4($namespace, $path);
|
40 |
+
}
|
41 |
+
|
42 |
+
$classMap = require __DIR__ . '/autoload_classmap.php';
|
43 |
+
if ($classMap) {
|
44 |
+
$loader->addClassMap($classMap);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
$loader->register(true);
|
49 |
+
|
50 |
+
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1::$files;
|
52 |
+
} else {
|
53 |
+
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
+
}
|
55 |
+
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire18a31866e67f0a0bfffdc031786ecae1($fileIdentifier, $file);
|
57 |
+
}
|
58 |
+
|
59 |
+
return $loader;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
function composerRequire18a31866e67f0a0bfffdc031786ecae1($fileIdentifier, $file)
|
64 |
+
{
|
65 |
+
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
+
require $file;
|
67 |
+
|
68 |
+
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
69 |
+
}
|
70 |
+
}
|
src/common/lib/vendor/composer/autoload_static.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_static.php @generated by Composer
|
4 |
+
|
5 |
+
namespace Composer\Autoload;
|
6 |
+
|
7 |
+
class ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1
|
8 |
+
{
|
9 |
+
public static $files = array (
|
10 |
+
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
11 |
+
);
|
12 |
+
|
13 |
+
public static $prefixLengthsPsr4 = array (
|
14 |
+
'T' =>
|
15 |
+
array (
|
16 |
+
'Twig\\' => 5,
|
17 |
+
),
|
18 |
+
'S' =>
|
19 |
+
array (
|
20 |
+
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
21 |
+
'Symfony\\Component\\Translation\\' => 30,
|
22 |
+
),
|
23 |
+
'F' =>
|
24 |
+
array (
|
25 |
+
'FernleafSystems\\Utilities\\' => 26,
|
26 |
+
),
|
27 |
+
'C' =>
|
28 |
+
array (
|
29 |
+
'Carbon\\' => 7,
|
30 |
+
),
|
31 |
+
);
|
32 |
+
|
33 |
+
public static $prefixDirsPsr4 = array (
|
34 |
+
'Twig\\' =>
|
35 |
+
array (
|
36 |
+
0 => __DIR__ . '/..' . '/twig/twig/src',
|
37 |
+
),
|
38 |
+
'Symfony\\Polyfill\\Mbstring\\' =>
|
39 |
+
array (
|
40 |
+
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
41 |
+
),
|
42 |
+
'Symfony\\Component\\Translation\\' =>
|
43 |
+
array (
|
44 |
+
0 => __DIR__ . '/..' . '/symfony/translation',
|
45 |
+
),
|
46 |
+
'FernleafSystems\\Utilities\\' =>
|
47 |
+
array (
|
48 |
+
0 => __DIR__ . '/..' . '/fernleafsystems/utilities/src',
|
49 |
+
),
|
50 |
+
'Carbon\\' =>
|
51 |
+
array (
|
52 |
+
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
|
53 |
+
),
|
54 |
+
);
|
55 |
+
|
56 |
+
public static $prefixesPsr0 = array (
|
57 |
+
'T' =>
|
58 |
+
array (
|
59 |
+
'Twig_' =>
|
60 |
+
array (
|
61 |
+
0 => __DIR__ . '/..' . '/twig/twig/lib',
|
62 |
+
),
|
63 |
+
),
|
64 |
+
);
|
65 |
+
|
66 |
+
public static function getInitializer(ClassLoader $loader)
|
67 |
+
{
|
68 |
+
return \Closure::bind(function () use ($loader) {
|
69 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1::$prefixLengthsPsr4;
|
70 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1::$prefixDirsPsr4;
|
71 |
+
$loader->prefixesPsr0 = ComposerStaticInit18a31866e67f0a0bfffdc031786ecae1::$prefixesPsr0;
|
72 |
+
|
73 |
+
}, null, ClassLoader::class);
|
74 |
+
}
|
75 |
+
}
|
src/common/lib/vendor/composer/installed.json
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[
|
2 |
+
{
|
3 |
+
"name": "symfony/polyfill-mbstring",
|
4 |
+
"version": "v1.6.0",
|
5 |
+
"version_normalized": "1.6.0.0",
|
6 |
+
"source": {
|
7 |
+
"type": "git",
|
8 |
+
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
9 |
+
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296"
|
10 |
+
},
|
11 |
+
"dist": {
|
12 |
+
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
|
14 |
+
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
|
15 |
+
"shasum": ""
|
16 |
+
},
|
17 |
+
"require": {
|
18 |
+
"php": ">=5.3.3"
|
19 |
+
},
|
20 |
+
"suggest": {
|
21 |
+
"ext-mbstring": "For best performance"
|
22 |
+
},
|
23 |
+
"time": "2017-10-11T12:05:26+00:00",
|
24 |
+
"type": "library",
|
25 |
+
"extra": {
|
26 |
+
"branch-alias": {
|
27 |
+
"dev-master": "1.6-dev"
|
28 |
+
}
|
29 |
+
},
|
30 |
+
"installation-source": "dist",
|
31 |
+
"autoload": {
|
32 |
+
"psr-4": {
|
33 |
+
"Symfony\\Polyfill\\Mbstring\\": ""
|
34 |
+
},
|
35 |
+
"files": [
|
36 |
+
"bootstrap.php"
|
37 |
+
]
|
38 |
+
},
|
39 |
+
"notification-url": "https://packagist.org/downloads/",
|
40 |
+
"license": [
|
41 |
+
"MIT"
|
42 |
+
],
|
43 |
+
"authors": [
|
44 |
+
{
|
45 |
+
"name": "Nicolas Grekas",
|
46 |
+
"email": "p@tchwork.com"
|
47 |
+
},
|
48 |
+
{
|
49 |
+
"name": "Symfony Community",
|
50 |
+
"homepage": "https://symfony.com/contributors"
|
51 |
+
}
|
52 |
+
],
|
53 |
+
"description": "Symfony polyfill for the Mbstring extension",
|
54 |
+
"homepage": "https://symfony.com",
|
55 |
+
"keywords": [
|
56 |
+
"compatibility",
|
57 |
+
"mbstring",
|
58 |
+
"polyfill",
|
59 |
+
"portable",
|
60 |
+
"shim"
|
61 |
+
]
|
62 |
+
},
|
63 |
+
{
|
64 |
+
"name": "nesbot/carbon",
|
65 |
+
"version": "1.22.1",
|
66 |
+
"version_normalized": "1.22.1.0",
|
67 |
+
"source": {
|
68 |
+
"type": "git",
|
69 |
+
"url": "https://github.com/briannesbitt/Carbon.git",
|
70 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc"
|
71 |
+
},
|
72 |
+
"dist": {
|
73 |
+
"type": "zip",
|
74 |
+
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
75 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
76 |
+
"shasum": ""
|
77 |
+
},
|
78 |
+
"require": {
|
79 |
+
"php": ">=5.3.0",
|
80 |
+
"symfony/translation": "~2.6 || ~3.0"
|
81 |
+
},
|
82 |
+
"require-dev": {
|
83 |
+
"friendsofphp/php-cs-fixer": "~2",
|
84 |
+
"phpunit/phpunit": "~4.0 || ~5.0"
|
85 |
+
},
|
86 |
+
"time": "2017-01-16T07:55:07+00:00",
|
87 |
+
"type": "library",
|
88 |
+
"extra": {
|
89 |
+
"branch-alias": {
|
90 |
+
"dev-master": "1.23-dev"
|
91 |
+
}
|
92 |
+
},
|
93 |
+
"installation-source": "dist",
|
94 |
+
"autoload": {
|
95 |
+
"psr-4": {
|
96 |
+
"Carbon\\": "src/Carbon/"
|
97 |
+
}
|
98 |
+
},
|
99 |
+
"notification-url": "https://packagist.org/downloads/",
|
100 |
+
"license": [
|
101 |
+
"MIT"
|
102 |
+
],
|
103 |
+
"authors": [
|
104 |
+
{
|
105 |
+
"name": "Brian Nesbitt",
|
106 |
+
"email": "brian@nesbot.com",
|
107 |
+
"homepage": "http://nesbot.com"
|
108 |
+
}
|
109 |
+
],
|
110 |
+
"description": "A simple API extension for DateTime.",
|
111 |
+
"homepage": "http://carbon.nesbot.com",
|
112 |
+
"keywords": [
|
113 |
+
"date",
|
114 |
+
"datetime",
|
115 |
+
"time"
|
116 |
+
]
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"name": "fernleafsystems/utilities",
|
120 |
+
"version": "1.1.0",
|
121 |
+
"version_normalized": "1.1.0.0",
|
122 |
+
"source": {
|
123 |
+
"type": "git",
|
124 |
+
"url": "https://github.com/FernleafSystems/Utilities.git",
|
125 |
+
"reference": "0195f7ff690cc5163174f033d6bc92b3eac20c03"
|
126 |
+
},
|
127 |
+
"dist": {
|
128 |
+
"type": "zip",
|
129 |
+
"url": "https://api.github.com/repos/FernleafSystems/Utilities/zipball/0195f7ff690cc5163174f033d6bc92b3eac20c03",
|
130 |
+
"reference": "0195f7ff690cc5163174f033d6bc92b3eac20c03",
|
131 |
+
"shasum": ""
|
132 |
+
},
|
133 |
+
"require": {
|
134 |
+
"php": ">=5.4"
|
135 |
+
},
|
136 |
+
"time": "2017-12-09T13:31:16+00:00",
|
137 |
+
"type": "library",
|
138 |
+
"installation-source": "dist",
|
139 |
+
"autoload": {
|
140 |
+
"psr-4": {
|
141 |
+
"FernleafSystems\\Utilities\\": "src"
|
142 |
+
}
|
143 |
+
},
|
144 |
+
"notification-url": "https://packagist.org/downloads/",
|
145 |
+
"authors": [
|
146 |
+
{
|
147 |
+
"name": "Paul Goodchild",
|
148 |
+
"email": "paul@paulgoodchild.me",
|
149 |
+
"homepage": "https://paulgoodchild.me"
|
150 |
+
}
|
151 |
+
],
|
152 |
+
"description": "Collection of simple utilities and traits"
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"name": "symfony/translation",
|
156 |
+
"version": "v3.4.2",
|
157 |
+
"version_normalized": "3.4.2.0",
|
158 |
+
"source": {
|
159 |
+
"type": "git",
|
160 |
+
"url": "https://github.com/symfony/translation.git",
|
161 |
+
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6"
|
162 |
+
},
|
163 |
+
"dist": {
|
164 |
+
"type": "zip",
|
165 |
+
"url": "https://api.github.com/repos/symfony/translation/zipball/4c5d5582baf2829751a5207659329c1f52eedeb6",
|
166 |
+
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6",
|
167 |
+
"shasum": ""
|
168 |
+
},
|
169 |
+
"require": {
|
170 |
+
"php": "^5.5.9|>=7.0.8",
|
171 |
+
"symfony/polyfill-mbstring": "~1.0"
|
172 |
+
},
|
173 |
+
"conflict": {
|
174 |
+
"symfony/config": "<2.8",
|
175 |
+
"symfony/dependency-injection": "<3.4",
|
176 |
+
"symfony/yaml": "<3.4"
|
177 |
+
},
|
178 |
+
"require-dev": {
|
179 |
+
"psr/log": "~1.0",
|
180 |
+
"symfony/config": "~2.8|~3.0|~4.0",
|
181 |
+
"symfony/dependency-injection": "~3.4|~4.0",
|
182 |
+
"symfony/finder": "~2.8|~3.0|~4.0",
|
183 |
+
"symfony/intl": "^2.8.18|^3.2.5|~4.0",
|
184 |
+
"symfony/yaml": "~3.4|~4.0"
|
185 |
+
},
|
186 |
+
"suggest": {
|
187 |
+
"psr/log": "To use logging capability in translator",
|
188 |
+
"symfony/config": "",
|
189 |
+
"symfony/yaml": ""
|
190 |
+
},
|
191 |
+
"time": "2017-12-12T08:27:14+00:00",
|
192 |
+
"type": "library",
|
193 |
+
"extra": {
|
194 |
+
"branch-alias": {
|
195 |
+
"dev-master": "3.4-dev"
|
196 |
+
}
|
197 |
+
},
|
198 |
+
"installation-source": "dist",
|
199 |
+
"autoload": {
|
200 |
+
"psr-4": {
|
201 |
+
"Symfony\\Component\\Translation\\": ""
|
202 |
+
},
|
203 |
+
"exclude-from-classmap": [
|
204 |
+
"/Tests/"
|
205 |
+
]
|
206 |
+
},
|
207 |
+
"notification-url": "https://packagist.org/downloads/",
|
208 |
+
"license": [
|
209 |
+
"MIT"
|
210 |
+
],
|
211 |
+
"authors": [
|
212 |
+
{
|
213 |
+
"name": "Fabien Potencier",
|
214 |
+
"email": "fabien@symfony.com"
|
215 |
+
},
|
216 |
+
{
|
217 |
+
"name": "Symfony Community",
|
218 |
+
"homepage": "https://symfony.com/contributors"
|
219 |
+
}
|
220 |
+
],
|
221 |
+
"description": "Symfony Translation Component",
|
222 |
+
"homepage": "https://symfony.com"
|
223 |
+
},
|
224 |
+
{
|
225 |
+
"name": "twig/twig",
|
226 |
+
"version": "v1.35.0",
|
227 |
+
"version_normalized": "1.35.0.0",
|
228 |
+
"source": {
|
229 |
+
"type": "git",
|
230 |
+
"url": "https://github.com/twigphp/Twig.git",
|
231 |
+
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f"
|
232 |
+
},
|
233 |
+
"dist": {
|
234 |
+
"type": "zip",
|
235 |
+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f",
|
236 |
+
"reference": "daa657073e55b0a78cce8fdd22682fddecc6385f",
|
237 |
+
"shasum": ""
|
238 |
+
},
|
239 |
+
"require": {
|
240 |
+
"php": ">=5.3.3"
|
241 |
+
},
|
242 |
+
"require-dev": {
|
243 |
+
"psr/container": "^1.0",
|
244 |
+
"symfony/debug": "~2.7",
|
245 |
+
"symfony/phpunit-bridge": "~3.3@dev"
|
246 |
+
},
|
247 |
+
"time": "2017-09-27T18:06:46+00:00",
|
248 |
+
"type": "library",
|
249 |
+
"extra": {
|
250 |
+
"branch-alias": {
|
251 |
+
"dev-master": "1.35-dev"
|
252 |
+
}
|
253 |
+
},
|
254 |
+
"installation-source": "dist",
|
255 |
+
"autoload": {
|
256 |
+
"psr-0": {
|
257 |
+
"Twig_": "lib/"
|
258 |
+
},
|
259 |
+
"psr-4": {
|
260 |
+
"Twig\\": "src/"
|
261 |
+
}
|
262 |
+
},
|
263 |
+
"notification-url": "https://packagist.org/downloads/",
|
264 |
+
"license": [
|
265 |
+
"BSD-3-Clause"
|
266 |
+
],
|
267 |
+
"authors": [
|
268 |
+
{
|
269 |
+
"name": "Fabien Potencier",
|
270 |
+
"email": "fabien@symfony.com",
|
271 |
+
"homepage": "http://fabien.potencier.org",
|
272 |
+
"role": "Lead Developer"
|
273 |
+
},
|
274 |
+
{
|
275 |
+
"name": "Armin Ronacher",
|
276 |
+
"email": "armin.ronacher@active-4.com",
|
277 |
+
"role": "Project Founder"
|
278 |
+
},
|
279 |
+
{
|
280 |
+
"name": "Twig Team",
|
281 |
+
"homepage": "http://twig.sensiolabs.org/contributors",
|
282 |
+
"role": "Contributors"
|
283 |
+
}
|
284 |
+
],
|
285 |
+
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
286 |
+
"homepage": "http://twig.sensiolabs.org",
|
287 |
+
"keywords": [
|
288 |
+
"templating"
|
289 |
+
]
|
290 |
+
}
|
291 |
+
]
|
src/common/lib/vendor/fernleafsystems/utilities/src/Data/Adapter/StdClassAdapter.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FernleafSystems\Utilities\Data\Adapter;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Trait StdClassAdapter
|
7 |
+
* @package FernleafSystems\Utilities\Data\Adapter
|
8 |
+
*/
|
9 |
+
trait StdClassAdapter {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var \stdClass
|
13 |
+
*/
|
14 |
+
private $oRaw;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param string $sProperty
|
18 |
+
* @return mixed
|
19 |
+
*/
|
20 |
+
public function __get( $sProperty ) {
|
21 |
+
return $this->getParam( $sProperty );
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @param string $sProperty
|
26 |
+
* @param mixed $mValue
|
27 |
+
* @return $this
|
28 |
+
*/
|
29 |
+
public function __set( $sProperty, $mValue ) {
|
30 |
+
return $this->setParam( $sProperty, $mValue );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param array $aDataValues associative with parameter keys and values
|
35 |
+
* @param array $aRestrictedKeys
|
36 |
+
* @return $this
|
37 |
+
*/
|
38 |
+
public function applyFromArray( $aDataValues, $aRestrictedKeys = array() ) {
|
39 |
+
if ( !empty( $aRestrictedKeys ) ) {
|
40 |
+
$aDataValues = array_intersect_key( $aDataValues, array_flip( $aRestrictedKeys ) );
|
41 |
+
}
|
42 |
+
$this->reset();
|
43 |
+
foreach ( $aDataValues as $sKey => $mValue ) {
|
44 |
+
$this->setParam( $sKey, $mValue );
|
45 |
+
}
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @return $this
|
51 |
+
*/
|
52 |
+
public function reset() {
|
53 |
+
$this->oRaw = new \stdClass();
|
54 |
+
return $this;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param bool $bClone
|
59 |
+
* @return \stdClass
|
60 |
+
*/
|
61 |
+
public function getRawData( $bClone = false ) {
|
62 |
+
if ( !is_object( $this->oRaw ) ) {
|
63 |
+
$this->oRaw = new \stdClass();
|
64 |
+
}
|
65 |
+
return $bClone ? clone $this->oRaw : $this->oRaw;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @return array
|
70 |
+
*/
|
71 |
+
public function getRawDataAsArray() {
|
72 |
+
return (array)$this->getRawData();
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @param string $sKey
|
77 |
+
* @param mixed $mComparison
|
78 |
+
* @return bool
|
79 |
+
*/
|
80 |
+
public function isParam( $sKey, $mComparison ) {
|
81 |
+
return ( $this->getParam( $sKey ) == $mComparison );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* @param string $sKey
|
86 |
+
* @param array $nDefault
|
87 |
+
* @return array
|
88 |
+
*/
|
89 |
+
public function getArrayParam( $sKey, $nDefault = array() ) {
|
90 |
+
$aVal = $this->getParam( $sKey, $nDefault );
|
91 |
+
return ( !is_null( $aVal ) && is_array( $aVal ) ) ? $aVal : $nDefault;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* @param string $sKey
|
96 |
+
* @param int $nDefault
|
97 |
+
* @return int|float|null
|
98 |
+
*/
|
99 |
+
public function getNumericParam( $sKey, $nDefault = null ) {
|
100 |
+
$nVal = $this->getParam( $sKey, $nDefault );
|
101 |
+
return ( !is_null( $nVal ) && is_numeric( $nVal ) ) ? $nVal : $nDefault;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @param string $sKey
|
106 |
+
* @param mixed $mDefault
|
107 |
+
* @return mixed
|
108 |
+
*/
|
109 |
+
public function getParam( $sKey, $mDefault = null ) {
|
110 |
+
return isset( $this->getRawData()->{$sKey} ) ? $this->getRawData()->{$sKey} : $mDefault;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @param string $sKey
|
115 |
+
* @param string $mDefault
|
116 |
+
* @return string
|
117 |
+
*/
|
118 |
+
public function getStringParam( $sKey, $mDefault = '' ) {
|
119 |
+
$sVal = $this->getParam( $sKey, $mDefault );
|
120 |
+
return ( !is_null( $sVal ) && is_string( $sVal ) ) ? trim( $sVal ) : $mDefault;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* @param object $oRaw
|
125 |
+
* @return $this
|
126 |
+
*/
|
127 |
+
public function setRawData( $oRaw ) {
|
128 |
+
$this->oRaw = $oRaw;
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @param string $sKey
|
134 |
+
* @param mixed $mValue
|
135 |
+
* @return $this
|
136 |
+
*/
|
137 |
+
public function setParam( $sKey, $mValue ) {
|
138 |
+
$this->getRawData()->{$sKey} = $mValue;
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* @alias TODO remove
|
144 |
+
* @param string $sKey
|
145 |
+
* @param mixed $mValue
|
146 |
+
* @return $this
|
147 |
+
*/
|
148 |
+
public function setRawDataItem( $sKey, $mValue ) {
|
149 |
+
return $this->setParam( $sKey, $mValue );
|
150 |
+
}
|
151 |
+
}
|
src/common/lib/vendor/fernleafsystems/utilities/src/Response.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FernleafSystems\Utilities;
|
4 |
+
|
5 |
+
use FernleafSystems\Utilities\Data\Adapter\StdClassAdapter;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class Response
|
9 |
+
* @package FernleafSystems\Utilities
|
10 |
+
*/
|
11 |
+
class Response {
|
12 |
+
|
13 |
+
use StdClassAdapter;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
private $sErrorCode = null;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
private $sErrorText = null;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var string
|
27 |
+
*/
|
28 |
+
private $sMessageText = null;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var boolean
|
32 |
+
*/
|
33 |
+
private $bSuccessful = null;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
private $aDebug = array();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @return array
|
42 |
+
*/
|
43 |
+
public function getData() {
|
44 |
+
return $this->getRawDataAsArray();
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @param string $sKey
|
49 |
+
* @return mixed|null
|
50 |
+
*/
|
51 |
+
public function getDataValue( $sKey ) {
|
52 |
+
return $this->getParam( $sKey );
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @return array
|
57 |
+
*/
|
58 |
+
public function getDebug() {
|
59 |
+
return $this->aDebug;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
public function getErrorCode() {
|
66 |
+
return $this->sErrorCode;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public function getErrorText() {
|
73 |
+
return $this->sErrorText;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function getMessageText() {
|
80 |
+
return $this->sMessageText;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @param array $aData
|
85 |
+
* @return $this
|
86 |
+
*/
|
87 |
+
public function setData( $aData ) {
|
88 |
+
return $this->applyFromArray( $aData );
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @param array $aDebug
|
93 |
+
* @return $this
|
94 |
+
*/
|
95 |
+
public function setDebug( $aDebug ) {
|
96 |
+
$this->aDebug = $aDebug;
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @param string $sCode
|
102 |
+
* @return $this
|
103 |
+
*/
|
104 |
+
public function setErrorCode( $sCode ) {
|
105 |
+
$this->sErrorCode = $sCode;
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @param string $sText
|
111 |
+
* @return $this
|
112 |
+
*/
|
113 |
+
public function setErrorText( $sText ) {
|
114 |
+
$this->sErrorText = $sText;
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* @param string $sText
|
120 |
+
* @return $this
|
121 |
+
*/
|
122 |
+
public function setMessageText( $sText ) {
|
123 |
+
$this->sMessageText = $sText;
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @param boolean $bSuccess
|
129 |
+
* @return $this
|
130 |
+
*/
|
131 |
+
public function setSuccessful( $bSuccess ) {
|
132 |
+
$this->bSuccessful = $bSuccess;
|
133 |
+
return $this;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* @param string $sMessage
|
138 |
+
* @return $this
|
139 |
+
*/
|
140 |
+
public function addDebug( $sMessage ) {
|
141 |
+
$this->aDebug[] = $sMessage;
|
142 |
+
return $this;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* @return boolean
|
147 |
+
*/
|
148 |
+
public function failed() {
|
149 |
+
return !$this->successful();
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* @return boolean
|
154 |
+
*/
|
155 |
+
public function successful() {
|
156 |
+
return $this->bSuccessful;
|
157 |
+
}
|
158 |
+
}
|
src/common/lib/vendor/nesbot/carbon/.php_cs.dist
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use PhpCsFixer\Config;
|
4 |
+
use PhpCsFixer\Finder;
|
5 |
+
|
6 |
+
$rules = [
|
7 |
+
'@PSR2' => true,
|
8 |
+
'array_syntax' => [
|
9 |
+
'syntax' => 'long',
|
10 |
+
],
|
11 |
+
'binary_operator_spaces' => [
|
12 |
+
'align_double_arrow' => false,
|
13 |
+
'align_equals' => false,
|
14 |
+
],
|
15 |
+
'blank_line_before_return' => true,
|
16 |
+
'cast_spaces' => true,
|
17 |
+
'concat_space' => [
|
18 |
+
'spacing' => 'none',
|
19 |
+
],
|
20 |
+
'ereg_to_preg' => true,
|
21 |
+
'method_separation' => true,
|
22 |
+
'no_blank_lines_after_phpdoc' => true,
|
23 |
+
'no_extra_consecutive_blank_lines' => true,
|
24 |
+
'no_short_bool_cast' => true,
|
25 |
+
'no_unneeded_control_parentheses' => true,
|
26 |
+
'no_unused_imports' => true,
|
27 |
+
'no_whitespace_in_blank_line' => true,
|
28 |
+
'ordered_imports' => true,
|
29 |
+
'phpdoc_align' => true,
|
30 |
+
'phpdoc_indent' => true,
|
31 |
+
'phpdoc_inline_tag' => true,
|
32 |
+
'phpdoc_no_access' => true,
|
33 |
+
'phpdoc_no_alias_tag' => [
|
34 |
+
'type' => 'var',
|
35 |
+
],
|
36 |
+
'phpdoc_no_package' => true,
|
37 |
+
'phpdoc_order' => true,
|
38 |
+
'phpdoc_scalar' => true,
|
39 |
+
'phpdoc_separation' => true,
|
40 |
+
'phpdoc_to_comment' => true,
|
41 |
+
'phpdoc_trim' => true,
|
42 |
+
'phpdoc_types' => true,
|
43 |
+
'phpdoc_var_without_name' => true,
|
44 |
+
'self_accessor' => true,
|
45 |
+
'single_quote' => true,
|
46 |
+
'space_after_semicolon' => true,
|
47 |
+
'standardize_not_equals' => true,
|
48 |
+
'ternary_operator_spaces' => true,
|
49 |
+
'trailing_comma_in_multiline_array' => true,
|
50 |
+
'trim_array_spaces' => true,
|
51 |
+
'unary_operator_spaces' => true,
|
52 |
+
];
|
53 |
+
|
54 |
+
return Config::create()->setRules($rules)
|
55 |
+
->setFinder(Finder::create()->in(__DIR__))
|
56 |
+
->setUsingCache(true)
|
57 |
+
->setRiskyAllowed(true);
|
src/common/lib/vendor/nesbot/carbon/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (C) Brian Nesbitt
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
8 |
+
to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in all
|
11 |
+
copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
src/common/lib/vendor/nesbot/carbon/readme.md
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Carbon
|
2 |
+
|
3 |
+
[![Latest Stable Version](https://poser.pugx.org/nesbot/carbon/v/stable.png)](https://packagist.org/packages/nesbot/carbon)
|
4 |
+
[![Total Downloads](https://poser.pugx.org/nesbot/carbon/downloads.png)](https://packagist.org/packages/nesbot/carbon)
|
5 |
+
[![Build Status](https://travis-ci.org/briannesbitt/Carbon.svg?branch=master)](https://travis-ci.org/briannesbitt/Carbon)
|
6 |
+
[![StyleCI](https://styleci.io/repos/5724990/shield?style=flat)](https://styleci.io/repos/5724990)
|
7 |
+
[![codecov.io](https://codecov.io/github/briannesbitt/Carbon/coverage.svg?branch=master)](https://codecov.io/github/briannesbitt/Carbon?branch=master)
|
8 |
+
[![PHP-Eye](https://php-eye.com/badge/nesbot/carbon/tested.svg?style=flat)](https://php-eye.com/package/nesbot/carbon)
|
9 |
+
|
10 |
+
A simple PHP API extension for DateTime. [http://carbon.nesbot.com](http://carbon.nesbot.com)
|
11 |
+
|
12 |
+
```php
|
13 |
+
use Carbon\Carbon;
|
14 |
+
|
15 |
+
printf("Right now is %s", Carbon::now()->toDateTimeString());
|
16 |
+
printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString()
|
17 |
+
$tomorrow = Carbon::now()->addDay();
|
18 |
+
$lastWeek = Carbon::now()->subWeek();
|
19 |
+
$nextSummerOlympics = Carbon::createFromDate(2012)->addYears(4);
|
20 |
+
|
21 |
+
$officialDate = Carbon::now()->toRfc2822String();
|
22 |
+
|
23 |
+
$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age;
|
24 |
+
|
25 |
+
$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London');
|
26 |
+
|
27 |
+
$worldWillEnd = Carbon::createFromDate(2012, 12, 21, 'GMT');
|
28 |
+
|
29 |
+
// Don't really want to die so mock now
|
30 |
+
Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1));
|
31 |
+
|
32 |
+
// comparisons are always done in UTC
|
33 |
+
if (Carbon::now()->gte($worldWillEnd)) {
|
34 |
+
die();
|
35 |
+
}
|
36 |
+
|
37 |
+
// Phew! Return to normal behaviour
|
38 |
+
Carbon::setTestNow();
|
39 |
+
|
40 |
+
if (Carbon::now()->isWeekend()) {
|
41 |
+
echo 'Party!';
|
42 |
+
}
|
43 |
+
echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago'
|
44 |
+
|
45 |
+
// ... but also does 'from now', 'after' and 'before'
|
46 |
+
// rolling up to seconds, minutes, hours, days, months, years
|
47 |
+
|
48 |
+
$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays();
|
49 |
+
```
|
50 |
+
|
51 |
+
## Installation
|
52 |
+
|
53 |
+
### With Composer
|
54 |
+
|
55 |
+
```
|
56 |
+
$ composer require nesbot/carbon
|
57 |
+
```
|
58 |
+
|
59 |
+
```json
|
60 |
+
{
|
61 |
+
"require": {
|
62 |
+
"nesbot/carbon": "~1.21"
|
63 |
+
}
|
64 |
+
}
|
65 |
+
```
|
66 |
+
|
67 |
+
```php
|
68 |
+
<?php
|
69 |
+
require 'vendor/autoload.php';
|
70 |
+
|
71 |
+
use Carbon\Carbon;
|
72 |
+
|
73 |
+
printf("Now: %s", Carbon::now());
|
74 |
+
```
|
75 |
+
|
76 |
+
<a name="install-nocomposer"/>
|
77 |
+
### Without Composer
|
78 |
+
|
79 |
+
Why are you not using [composer](http://getcomposer.org/)? Download [Carbon.php](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php) from the repo and save the file into your project path somewhere.
|
80 |
+
|
81 |
+
```php
|
82 |
+
<?php
|
83 |
+
require 'path/to/Carbon.php';
|
84 |
+
|
85 |
+
use Carbon\Carbon;
|
86 |
+
|
87 |
+
printf("Now: %s", Carbon::now());
|
88 |
+
```
|
89 |
+
|
90 |
+
## Docs
|
91 |
+
|
92 |
+
[http://carbon.nesbot.com/docs](http://carbon.nesbot.com/docs)
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Carbon.php
RENAMED
@@ -1,3355 +1,3355 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Carbon;
|
13 |
-
|
14 |
-
use Carbon\Exceptions\InvalidDateException;
|
15 |
-
use Closure;
|
16 |
-
use DatePeriod;
|
17 |
-
use DateTime;
|
18 |
-
use DateTimeZone;
|
19 |
-
use InvalidArgumentException;
|
20 |
-
use Symfony\Component\Translation\Loader\ArrayLoader;
|
21 |
-
use Symfony\Component\Translation\Translator;
|
22 |
-
use Symfony\Component\Translation\TranslatorInterface;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* A simple API extension for DateTime
|
26 |
-
*
|
27 |
-
* @property int $year
|
28 |
-
* @property int $yearIso
|
29 |
-
* @property int $month
|
30 |
-
* @property int $day
|
31 |
-
* @property int $hour
|
32 |
-
* @property int $minute
|
33 |
-
* @property int $second
|
34 |
-
* @property int $timestamp seconds since the Unix Epoch
|
35 |
-
* @property \DateTimeZone $timezone the current timezone
|
36 |
-
* @property \DateTimeZone $tz alias of timezone
|
37 |
-
* @property-read int $micro
|
38 |
-
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
39 |
-
* @property-read int $dayOfYear 0 through 365
|
40 |
-
* @property-read int $weekOfMonth 1 through 5
|
41 |
-
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
42 |
-
* @property-read int $daysInMonth number of days in the given month
|
43 |
-
* @property-read int $age does a diffInYears() with default parameters
|
44 |
-
* @property-read int $quarter the quarter of this instance, 1 - 4
|
45 |
-
* @property-read int $offset the timezone offset in seconds from UTC
|
46 |
-
* @property-read int $offsetHours the timezone offset in hours from UTC
|
47 |
-
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
48 |
-
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
49 |
-
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
50 |
-
* @property-read string $timezoneName
|
51 |
-
* @property-read string $tzName
|
52 |
-
*/
|
53 |
-
class Carbon extends DateTime
|
54 |
-
{
|
55 |
-
/**
|
56 |
-
* The day constants.
|
57 |
-
*/
|
58 |
-
const SUNDAY = 0;
|
59 |
-
const MONDAY = 1;
|
60 |
-
const TUESDAY = 2;
|
61 |
-
const WEDNESDAY = 3;
|
62 |
-
const THURSDAY = 4;
|
63 |
-
const FRIDAY = 5;
|
64 |
-
const SATURDAY = 6;
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Names of days of the week.
|
68 |
-
*
|
69 |
-
* @var array
|
70 |
-
*/
|
71 |
-
protected static $days = array(
|
72 |
-
self::SUNDAY => 'Sunday',
|
73 |
-
self::MONDAY => 'Monday',
|
74 |
-
self::TUESDAY => 'Tuesday',
|
75 |
-
self::WEDNESDAY => 'Wednesday',
|
76 |
-
self::THURSDAY => 'Thursday',
|
77 |
-
self::FRIDAY => 'Friday',
|
78 |
-
self::SATURDAY => 'Saturday',
|
79 |
-
);
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Terms used to detect if a time passed is a relative date.
|
83 |
-
*
|
84 |
-
* This is here for testing purposes.
|
85 |
-
*
|
86 |
-
* @var array
|
87 |
-
*/
|
88 |
-
protected static $relativeKeywords = array(
|
89 |
-
'+',
|
90 |
-
'-',
|
91 |
-
'ago',
|
92 |
-
'first',
|
93 |
-
'last',
|
94 |
-
'next',
|
95 |
-
'this',
|
96 |
-
'today',
|
97 |
-
'tomorrow',
|
98 |
-
'yesterday',
|
99 |
-
);
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Number of X in Y.
|
103 |
-
*/
|
104 |
-
const YEARS_PER_CENTURY = 100;
|
105 |
-
const YEARS_PER_DECADE = 10;
|
106 |
-
const MONTHS_PER_YEAR = 12;
|
107 |
-
const MONTHS_PER_QUARTER = 3;
|
108 |
-
const WEEKS_PER_YEAR = 52;
|
109 |
-
const DAYS_PER_WEEK = 7;
|
110 |
-
const HOURS_PER_DAY = 24;
|
111 |
-
const MINUTES_PER_HOUR = 60;
|
112 |
-
const SECONDS_PER_MINUTE = 60;
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Default format to use for __toString method when type juggling occurs.
|
116 |
-
*
|
117 |
-
* @var string
|
118 |
-
*/
|
119 |
-
const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Format to use for __toString method when type juggling occurs.
|
123 |
-
*
|
124 |
-
* @var string
|
125 |
-
*/
|
126 |
-
protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT;
|
127 |
-
|
128 |
-
/**
|
129 |
-
* First day of week.
|
130 |
-
*
|
131 |
-
* @var int
|
132 |
-
*/
|
133 |
-
protected static $weekStartsAt = self::MONDAY;
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Last day of week.
|
137 |
-
*
|
138 |
-
* @var int
|
139 |
-
*/
|
140 |
-
protected static $weekEndsAt = self::SUNDAY;
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Days of weekend.
|
144 |
-
*
|
145 |
-
* @var array
|
146 |
-
*/
|
147 |
-
protected static $weekendDays = array(
|
148 |
-
self::SATURDAY,
|
149 |
-
self::SUNDAY,
|
150 |
-
);
|
151 |
-
|
152 |
-
/**
|
153 |
-
* A test Carbon instance to be returned when now instances are created.
|
154 |
-
*
|
155 |
-
* @var \Carbon\Carbon
|
156 |
-
*/
|
157 |
-
protected static $testNow;
|
158 |
-
|
159 |
-
/**
|
160 |
-
* A translator to ... er ... translate stuff.
|
161 |
-
*
|
162 |
-
* @var \Symfony\Component\Translation\TranslatorInterface
|
163 |
-
*/
|
164 |
-
protected static $translator;
|
165 |
-
|
166 |
-
/**
|
167 |
-
* The errors that can occur.
|
168 |
-
*
|
169 |
-
* @var array
|
170 |
-
*/
|
171 |
-
protected static $lastErrors;
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Will UTF8 encoding be used to print localized date/time ?
|
175 |
-
*
|
176 |
-
* @var bool
|
177 |
-
*/
|
178 |
-
protected static $utf8 = false;
|
179 |
-
|
180 |
-
/*
|
181 |
-
* Indicates if months should be calculated with overflow.
|
182 |
-
*
|
183 |
-
* @var bool
|
184 |
-
*/
|
185 |
-
protected static $monthsOverflow = true;
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Indicates if months should be calculated with overflow.
|
189 |
-
*
|
190 |
-
* @param bool $monthsOverflow
|
191 |
-
*
|
192 |
-
* @return void
|
193 |
-
*/
|
194 |
-
public static function useMonthsOverflow($monthsOverflow = true)
|
195 |
-
{
|
196 |
-
static::$monthsOverflow = $monthsOverflow;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Reset the month overflow behavior.
|
201 |
-
*
|
202 |
-
* @return void
|
203 |
-
*/
|
204 |
-
public static function resetMonthsOverflow()
|
205 |
-
{
|
206 |
-
static::$monthsOverflow = true;
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Get the month overflow behavior.
|
211 |
-
*
|
212 |
-
* @return bool
|
213 |
-
*/
|
214 |
-
public static function shouldOverflowMonths()
|
215 |
-
{
|
216 |
-
return static::$monthsOverflow;
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Creates a DateTimeZone from a string, DateTimeZone or integer offset.
|
221 |
-
*
|
222 |
-
* @param \DateTimeZone|string|int|null $object
|
223 |
-
*
|
224 |
-
* @throws \InvalidArgumentException
|
225 |
-
*
|
226 |
-
* @return \DateTimeZone
|
227 |
-
*/
|
228 |
-
protected static function safeCreateDateTimeZone($object)
|
229 |
-
{
|
230 |
-
if ($object === null) {
|
231 |
-
// Don't return null... avoid Bug #52063 in PHP <5.3.6
|
232 |
-
return new DateTimeZone(date_default_timezone_get());
|
233 |
-
}
|
234 |
-
|
235 |
-
if ($object instanceof DateTimeZone) {
|
236 |
-
return $object;
|
237 |
-
}
|
238 |
-
|
239 |
-
if (is_numeric($object)) {
|
240 |
-
$tzName = timezone_name_from_abbr(null, $object * 3600, true);
|
241 |
-
|
242 |
-
if ($tzName === false) {
|
243 |
-
throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')');
|
244 |
-
}
|
245 |
-
|
246 |
-
$object = $tzName;
|
247 |
-
}
|
248 |
-
|
249 |
-
$tz = @timezone_open((string) $object);
|
250 |
-
|
251 |
-
if ($tz === false) {
|
252 |
-
throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')');
|
253 |
-
}
|
254 |
-
|
255 |
-
return $tz;
|
256 |
-
}
|
257 |
-
|
258 |
-
///////////////////////////////////////////////////////////////////
|
259 |
-
//////////////////////////// CONSTRUCTORS /////////////////////////
|
260 |
-
///////////////////////////////////////////////////////////////////
|
261 |
-
|
262 |
-
/**
|
263 |
-
* Create a new Carbon instance.
|
264 |
-
*
|
265 |
-
* Please see the testing aids section (specifically static::setTestNow())
|
266 |
-
* for more on the possibility of this constructor returning a test instance.
|
267 |
-
*
|
268 |
-
* @param string|null $time
|
269 |
-
* @param \DateTimeZone|string|null $tz
|
270 |
-
*/
|
271 |
-
public function __construct($time = null, $tz = null)
|
272 |
-
{
|
273 |
-
// If the class has a test now set and we are trying to create a now()
|
274 |
-
// instance then override as required
|
275 |
-
if (static::hasTestNow() && (empty($time) || $time === 'now' || static::hasRelativeKeywords($time))) {
|
276 |
-
$testInstance = clone static::getTestNow();
|
277 |
-
if (static::hasRelativeKeywords($time)) {
|
278 |
-
$testInstance->modify($time);
|
279 |
-
}
|
280 |
-
|
281 |
-
//shift the time according to the given time zone
|
282 |
-
if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) {
|
283 |
-
$testInstance->setTimezone($tz);
|
284 |
-
} else {
|
285 |
-
$tz = $testInstance->getTimezone();
|
286 |
-
}
|
287 |
-
|
288 |
-
$time = $testInstance->toDateTimeString();
|
289 |
-
}
|
290 |
-
|
291 |
-
parent::__construct($time, static::safeCreateDateTimeZone($tz));
|
292 |
-
}
|
293 |
-
|
294 |
-
/**
|
295 |
-
* Create a Carbon instance from a DateTime one.
|
296 |
-
*
|
297 |
-
* @param \DateTime $dt
|
298 |
-
*
|
299 |
-
* @return static
|
300 |
-
*/
|
301 |
-
public static function instance(DateTime $dt)
|
302 |
-
{
|
303 |
-
if ($dt instanceof static) {
|
304 |
-
return clone $dt;
|
305 |
-
}
|
306 |
-
|
307 |
-
return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimezone());
|
308 |
-
}
|
309 |
-
|
310 |
-
/**
|
311 |
-
* Create a carbon instance from a string.
|
312 |
-
*
|
313 |
-
* This is an alias for the constructor that allows better fluent syntax
|
314 |
-
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
|
315 |
-
* than (new Carbon('Monday next week'))->fn().
|
316 |
-
*
|
317 |
-
* @param string|null $time
|
318 |
-
* @param \DateTimeZone|string|null $tz
|
319 |
-
*
|
320 |
-
* @return static
|
321 |
-
*/
|
322 |
-
public static function parse($time = null, $tz = null)
|
323 |
-
{
|
324 |
-
return new static($time, $tz);
|
325 |
-
}
|
326 |
-
|
327 |
-
/**
|
328 |
-
* Get a Carbon instance for the current date and time.
|
329 |
-
*
|
330 |
-
* @param \DateTimeZone|string|null $tz
|
331 |
-
*
|
332 |
-
* @return static
|
333 |
-
*/
|
334 |
-
public static function now($tz = null)
|
335 |
-
{
|
336 |
-
return new static(null, $tz);
|
337 |
-
}
|
338 |
-
|
339 |
-
/**
|
340 |
-
* Create a Carbon instance for today.
|
341 |
-
*
|
342 |
-
* @param \DateTimeZone|string|null $tz
|
343 |
-
*
|
344 |
-
* @return static
|
345 |
-
*/
|
346 |
-
public static function today($tz = null)
|
347 |
-
{
|
348 |
-
return static::now($tz)->startOfDay();
|
349 |
-
}
|
350 |
-
|
351 |
-
/**
|
352 |
-
* Create a Carbon instance for tomorrow.
|
353 |
-
*
|
354 |
-
* @param \DateTimeZone|string|null $tz
|
355 |
-
*
|
356 |
-
* @return static
|
357 |
-
*/
|
358 |
-
public static function tomorrow($tz = null)
|
359 |
-
{
|
360 |
-
return static::today($tz)->addDay();
|
361 |
-
}
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Create a Carbon instance for yesterday.
|
365 |
-
*
|
366 |
-
* @param \DateTimeZone|string|null $tz
|
367 |
-
*
|
368 |
-
* @return static
|
369 |
-
*/
|
370 |
-
public static function yesterday($tz = null)
|
371 |
-
{
|
372 |
-
return static::today($tz)->subDay();
|
373 |
-
}
|
374 |
-
|
375 |
-
/**
|
376 |
-
* Create a Carbon instance for the greatest supported date.
|
377 |
-
*
|
378 |
-
* @return static
|
379 |
-
*/
|
380 |
-
public static function maxValue()
|
381 |
-
{
|
382 |
-
if (PHP_INT_SIZE === 4) {
|
383 |
-
// 32 bit (and additionally Windows 64 bit)
|
384 |
-
return static::createFromTimestamp(PHP_INT_MAX);
|
385 |
-
}
|
386 |
-
|
387 |
-
// 64 bit
|
388 |
-
return static::create(9999, 12, 31, 23, 59, 59);
|
389 |
-
}
|
390 |
-
|
391 |
-
/**
|
392 |
-
* Create a Carbon instance for the lowest supported date.
|
393 |
-
*
|
394 |
-
* @return static
|
395 |
-
*/
|
396 |
-
public static function minValue()
|
397 |
-
{
|
398 |
-
if (PHP_INT_SIZE === 4) {
|
399 |
-
// 32 bit (and additionally Windows 64 bit)
|
400 |
-
return static::createFromTimestamp(~PHP_INT_MAX);
|
401 |
-
}
|
402 |
-
|
403 |
-
// 64 bit
|
404 |
-
return static::create(1, 1, 1, 0, 0, 0);
|
405 |
-
}
|
406 |
-
|
407 |
-
/**
|
408 |
-
* Create a new Carbon instance from a specific date and time.
|
409 |
-
*
|
410 |
-
* If any of $year, $month or $day are set to null their now() values will
|
411 |
-
* be used.
|
412 |
-
*
|
413 |
-
* If $hour is null it will be set to its now() value and the default
|
414 |
-
* values for $minute and $second will be their now() values.
|
415 |
-
*
|
416 |
-
* If $hour is not null then the default values for $minute and $second
|
417 |
-
* will be 0.
|
418 |
-
*
|
419 |
-
* @param int|null $year
|
420 |
-
* @param int|null $month
|
421 |
-
* @param int|null $day
|
422 |
-
* @param int|null $hour
|
423 |
-
* @param int|null $minute
|
424 |
-
* @param int|null $second
|
425 |
-
* @param \DateTimeZone|string|null $tz
|
426 |
-
*
|
427 |
-
* @return static
|
428 |
-
*/
|
429 |
-
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
430 |
-
{
|
431 |
-
$now = static::hasTestNow() ? static::getTestNow()->getTimestamp() : time();
|
432 |
-
|
433 |
-
$defaults = array_combine(array(
|
434 |
-
'year',
|
435 |
-
'month',
|
436 |
-
'day',
|
437 |
-
'hour',
|
438 |
-
'minute',
|
439 |
-
'second',
|
440 |
-
), explode('-', date('Y-n-j-G-i-s', $now)));
|
441 |
-
|
442 |
-
$year = $year === null ? $defaults['year'] : $year;
|
443 |
-
$month = $month === null ? $defaults['month'] : $month;
|
444 |
-
$day = $day === null ? $defaults['day'] : $day;
|
445 |
-
|
446 |
-
if ($hour === null) {
|
447 |
-
$hour = $defaults['hour'];
|
448 |
-
$minute = $minute === null ? $defaults['minute'] : $minute;
|
449 |
-
$second = $second === null ? $defaults['second'] : $second;
|
450 |
-
} else {
|
451 |
-
$minute = $minute === null ? 0 : $minute;
|
452 |
-
$second = $second === null ? 0 : $second;
|
453 |
-
}
|
454 |
-
|
455 |
-
$fixYear = null;
|
456 |
-
|
457 |
-
if ($year < 0) {
|
458 |
-
$fixYear = $year;
|
459 |
-
$year = 0;
|
460 |
-
} elseif ($year > 9999) {
|
461 |
-
$fixYear = $year - 9999;
|
462 |
-
$year = 9999;
|
463 |
-
}
|
464 |
-
|
465 |
-
$instance = static::createFromFormat('Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz);
|
466 |
-
|
467 |
-
if ($fixYear !== null) {
|
468 |
-
$instance->addYears($fixYear);
|
469 |
-
}
|
470 |
-
|
471 |
-
return $instance;
|
472 |
-
}
|
473 |
-
|
474 |
-
/**
|
475 |
-
* Create a new safe Carbon instance from a specific date and time.
|
476 |
-
*
|
477 |
-
* If any of $year, $month or $day are set to null their now() values will
|
478 |
-
* be used.
|
479 |
-
*
|
480 |
-
* If $hour is null it will be set to its now() value and the default
|
481 |
-
* values for $minute and $second will be their now() values.
|
482 |
-
*
|
483 |
-
* If $hour is not null then the default values for $minute and $second
|
484 |
-
* will be 0.
|
485 |
-
*
|
486 |
-
* If one of the set values is not valid, an \InvalidArgumentException
|
487 |
-
* will be thrown.
|
488 |
-
*
|
489 |
-
* @param int|null $year
|
490 |
-
* @param int|null $month
|
491 |
-
* @param int|null $day
|
492 |
-
* @param int|null $hour
|
493 |
-
* @param int|null $minute
|
494 |
-
* @param int|null $second
|
495 |
-
* @param \DateTimeZone|string|null $tz
|
496 |
-
*
|
497 |
-
* @throws \Carbon\Exceptions\InvalidDateException
|
498 |
-
*
|
499 |
-
* @return static
|
500 |
-
*/
|
501 |
-
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
502 |
-
{
|
503 |
-
$fields = array(
|
504 |
-
'year' => array(0, 9999),
|
505 |
-
'month' => array(0, 12),
|
506 |
-
'day' => array(0, 31),
|
507 |
-
'hour' => array(0, 24),
|
508 |
-
'minute' => array(0, 59),
|
509 |
-
'second' => array(0, 59),
|
510 |
-
);
|
511 |
-
|
512 |
-
foreach ($fields as $field => $range) {
|
513 |
-
if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) {
|
514 |
-
throw new InvalidDateException($field, $$field);
|
515 |
-
}
|
516 |
-
}
|
517 |
-
|
518 |
-
$instance = static::create($year, $month, 1, $hour, $minute, $second, $tz);
|
519 |
-
|
520 |
-
if ($day !== null && $day > $instance->daysInMonth) {
|
521 |
-
throw new InvalidDateException('day', $day);
|
522 |
-
}
|
523 |
-
|
524 |
-
return $instance->day($day);
|
525 |
-
}
|
526 |
-
|
527 |
-
/**
|
528 |
-
* Create a Carbon instance from just a date. The time portion is set to now.
|
529 |
-
*
|
530 |
-
* @param int|null $year
|
531 |
-
* @param int|null $month
|
532 |
-
* @param int|null $day
|
533 |
-
* @param \DateTimeZone|string|null $tz
|
534 |
-
*
|
535 |
-
* @return static
|
536 |
-
*/
|
537 |
-
public static function createFromDate($year = null, $month = null, $day = null, $tz = null)
|
538 |
-
{
|
539 |
-
return static::create($year, $month, $day, null, null, null, $tz);
|
540 |
-
}
|
541 |
-
|
542 |
-
/**
|
543 |
-
* Create a Carbon instance from just a time. The date portion is set to today.
|
544 |
-
*
|
545 |
-
* @param int|null $hour
|
546 |
-
* @param int|null $minute
|
547 |
-
* @param int|null $second
|
548 |
-
* @param \DateTimeZone|string|null $tz
|
549 |
-
*
|
550 |
-
* @return static
|
551 |
-
*/
|
552 |
-
public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null)
|
553 |
-
{
|
554 |
-
return static::create(null, null, null, $hour, $minute, $second, $tz);
|
555 |
-
}
|
556 |
-
|
557 |
-
/**
|
558 |
-
* Create a Carbon instance from a specific format.
|
559 |
-
*
|
560 |
-
* @param string $format
|
561 |
-
* @param string $time
|
562 |
-
* @param \DateTimeZone|string|null $tz
|
563 |
-
*
|
564 |
-
* @throws \InvalidArgumentException
|
565 |
-
*
|
566 |
-
* @return static
|
567 |
-
*/
|
568 |
-
public static function createFromFormat($format, $time, $tz = null)
|
569 |
-
{
|
570 |
-
if ($tz !== null) {
|
571 |
-
$dt = parent::createFromFormat($format, $time, static::safeCreateDateTimeZone($tz));
|
572 |
-
} else {
|
573 |
-
$dt = parent::createFromFormat($format, $time);
|
574 |
-
}
|
575 |
-
|
576 |
-
static::setLastErrors($lastErrors = parent::getLastErrors());
|
577 |
-
|
578 |
-
if ($dt instanceof DateTime) {
|
579 |
-
return static::instance($dt);
|
580 |
-
}
|
581 |
-
|
582 |
-
throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors']));
|
583 |
-
}
|
584 |
-
|
585 |
-
/**
|
586 |
-
* Set last errors.
|
587 |
-
*
|
588 |
-
* @param array $lastErrors
|
589 |
-
*
|
590 |
-
* @return void
|
591 |
-
*/
|
592 |
-
private static function setLastErrors(array $lastErrors)
|
593 |
-
{
|
594 |
-
static::$lastErrors = $lastErrors;
|
595 |
-
}
|
596 |
-
|
597 |
-
/**
|
598 |
-
* {@inheritdoc}
|
599 |
-
*/
|
600 |
-
public static function getLastErrors()
|
601 |
-
{
|
602 |
-
return static::$lastErrors;
|
603 |
-
}
|
604 |
-
|
605 |
-
/**
|
606 |
-
* Create a Carbon instance from a timestamp.
|
607 |
-
*
|
608 |
-
* @param int $timestamp
|
609 |
-
* @param \DateTimeZone|string|null $tz
|
610 |
-
*
|
611 |
-
* @return static
|
612 |
-
*/
|
613 |
-
public static function createFromTimestamp($timestamp, $tz = null)
|
614 |
-
{
|
615 |
-
return static::now($tz)->setTimestamp($timestamp);
|
616 |
-
}
|
617 |
-
|
618 |
-
/**
|
619 |
-
* Create a Carbon instance from an UTC timestamp.
|
620 |
-
*
|
621 |
-
* @param int $timestamp
|
622 |
-
*
|
623 |
-
* @return static
|
624 |
-
*/
|
625 |
-
public static function createFromTimestampUTC($timestamp)
|
626 |
-
{
|
627 |
-
return new static('@'.$timestamp);
|
628 |
-
}
|
629 |
-
|
630 |
-
/**
|
631 |
-
* Get a copy of the instance.
|
632 |
-
*
|
633 |
-
* @return static
|
634 |
-
*/
|
635 |
-
public function copy()
|
636 |
-
{
|
637 |
-
return clone $this;
|
638 |
-
}
|
639 |
-
|
640 |
-
///////////////////////////////////////////////////////////////////
|
641 |
-
///////////////////////// GETTERS AND SETTERS /////////////////////
|
642 |
-
///////////////////////////////////////////////////////////////////
|
643 |
-
|
644 |
-
/**
|
645 |
-
* Get a part of the Carbon object
|
646 |
-
*
|
647 |
-
* @param string $name
|
648 |
-
*
|
649 |
-
* @throws \InvalidArgumentException
|
650 |
-
*
|
651 |
-
* @return string|int|\DateTimeZone
|
652 |
-
*/
|
653 |
-
public function __get($name)
|
654 |
-
{
|
655 |
-
switch (true) {
|
656 |
-
case array_key_exists($name, $formats = array(
|
657 |
-
'year' => 'Y',
|
658 |
-
'yearIso' => 'o',
|
659 |
-
'month' => 'n',
|
660 |
-
'day' => 'j',
|
661 |
-
'hour' => 'G',
|
662 |
-
'minute' => 'i',
|
663 |
-
'second' => 's',
|
664 |
-
'micro' => 'u',
|
665 |
-
'dayOfWeek' => 'w',
|
666 |
-
'dayOfYear' => 'z',
|
667 |
-
'weekOfYear' => 'W',
|
668 |
-
'daysInMonth' => 't',
|
669 |
-
'timestamp' => 'U',
|
670 |
-
)):
|
671 |
-
return (int) $this->format($formats[$name]);
|
672 |
-
|
673 |
-
case $name === 'weekOfMonth':
|
674 |
-
return (int) ceil($this->day / static::DAYS_PER_WEEK);
|
675 |
-
|
676 |
-
case $name === 'age':
|
677 |
-
return $this->diffInYears();
|
678 |
-
|
679 |
-
case $name === 'quarter':
|
680 |
-
return (int) ceil($this->month / static::MONTHS_PER_QUARTER);
|
681 |
-
|
682 |
-
case $name === 'offset':
|
683 |
-
return $this->getOffset();
|
684 |
-
|
685 |
-
case $name === 'offsetHours':
|
686 |
-
return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR;
|
687 |
-
|
688 |
-
case $name === 'dst':
|
689 |
-
return $this->format('I') === '1';
|
690 |
-
|
691 |
-
case $name === 'local':
|
692 |
-
return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset();
|
693 |
-
|
694 |
-
case $name === 'utc':
|
695 |
-
return $this->getOffset() === 0;
|
696 |
-
|
697 |
-
case $name === 'timezone' || $name === 'tz':
|
698 |
-
return $this->getTimezone();
|
699 |
-
|
700 |
-
case $name === 'timezoneName' || $name === 'tzName':
|
701 |
-
return $this->getTimezone()->getName();
|
702 |
-
|
703 |
-
default:
|
704 |
-
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
|
705 |
-
}
|
706 |
-
}
|
707 |
-
|
708 |
-
/**
|
709 |
-
* Check if an attribute exists on the object
|
710 |
-
*
|
711 |
-
* @param string $name
|
712 |
-
*
|
713 |
-
* @return bool
|
714 |
-
*/
|
715 |
-
public function __isset($name)
|
716 |
-
{
|
717 |
-
try {
|
718 |
-
$this->__get($name);
|
719 |
-
} catch (InvalidArgumentException $e) {
|
720 |
-
return false;
|
721 |
-
}
|
722 |
-
|
723 |
-
return true;
|
724 |
-
}
|
725 |
-
|
726 |
-
/**
|
727 |
-
* Set a part of the Carbon object
|
728 |
-
*
|
729 |
-
* @param string $name
|
730 |
-
* @param string|int|\DateTimeZone $value
|
731 |
-
*
|
732 |
-
* @throws \InvalidArgumentException
|
733 |
-
*/
|
734 |
-
public function __set($name, $value)
|
735 |
-
{
|
736 |
-
switch ($name) {
|
737 |
-
case 'year':
|
738 |
-
case 'month':
|
739 |
-
case 'day':
|
740 |
-
case 'hour':
|
741 |
-
case 'minute':
|
742 |
-
case 'second':
|
743 |
-
list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s'));
|
744 |
-
$$name = $value;
|
745 |
-
$this->setDateTime($year, $month, $day, $hour, $minute, $second);
|
746 |
-
break;
|
747 |
-
|
748 |
-
case 'timestamp':
|
749 |
-
parent::setTimestamp($value);
|
750 |
-
break;
|
751 |
-
|
752 |
-
case 'timezone':
|
753 |
-
case 'tz':
|
754 |
-
$this->setTimezone($value);
|
755 |
-
break;
|
756 |
-
|
757 |
-
default:
|
758 |
-
throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name));
|
759 |
-
}
|
760 |
-
}
|
761 |
-
|
762 |
-
/**
|
763 |
-
* Set the instance's year
|
764 |
-
*
|
765 |
-
* @param int $value
|
766 |
-
*
|
767 |
-
* @return static
|
768 |
-
*/
|
769 |
-
public function year($value)
|
770 |
-
{
|
771 |
-
$this->year = $value;
|
772 |
-
|
773 |
-
return $this;
|
774 |
-
}
|
775 |
-
|
776 |
-
/**
|
777 |
-
* Set the instance's month
|
778 |
-
*
|
779 |
-
* @param int $value
|
780 |
-
*
|
781 |
-
* @return static
|
782 |
-
*/
|
783 |
-
public function month($value)
|
784 |
-
{
|
785 |
-
$this->month = $value;
|
786 |
-
|
787 |
-
return $this;
|
788 |
-
}
|
789 |
-
|
790 |
-
/**
|
791 |
-
* Set the instance's day
|
792 |
-
*
|
793 |
-
* @param int $value
|
794 |
-
*
|
795 |
-
* @return static
|
796 |
-
*/
|
797 |
-
public function day($value)
|
798 |
-
{
|
799 |
-
$this->day = $value;
|
800 |
-
|
801 |
-
return $this;
|
802 |
-
}
|
803 |
-
|
804 |
-
/**
|
805 |
-
* Set the instance's hour
|
806 |
-
*
|
807 |
-
* @param int $value
|
808 |
-
*
|
809 |
-
* @return static
|
810 |
-
*/
|
811 |
-
public function hour($value)
|
812 |
-
{
|
813 |
-
$this->hour = $value;
|
814 |
-
|
815 |
-
return $this;
|
816 |
-
}
|
817 |
-
|
818 |
-
/**
|
819 |
-
* Set the instance's minute
|
820 |
-
*
|
821 |
-
* @param int $value
|
822 |
-
*
|
823 |
-
* @return static
|
824 |
-
*/
|
825 |
-
public function minute($value)
|
826 |
-
{
|
827 |
-
$this->minute = $value;
|
828 |
-
|
829 |
-
return $this;
|
830 |
-
}
|
831 |
-
|
832 |
-
/**
|
833 |
-
* Set the instance's second
|
834 |
-
*
|
835 |
-
* @param int $value
|
836 |
-
*
|
837 |
-
* @return static
|
838 |
-
*/
|
839 |
-
public function second($value)
|
840 |
-
{
|
841 |
-
$this->second = $value;
|
842 |
-
|
843 |
-
return $this;
|
844 |
-
}
|
845 |
-
|
846 |
-
/**
|
847 |
-
* Sets the current date of the DateTime object to a different date.
|
848 |
-
* Calls modify as a workaround for a php bug
|
849 |
-
*
|
850 |
-
* @param int $year
|
851 |
-
* @param int $month
|
852 |
-
* @param int $day
|
853 |
-
*
|
854 |
-
* @return static
|
855 |
-
*
|
856 |
-
* @see https://github.com/briannesbitt/Carbon/issues/539
|
857 |
-
* @see https://bugs.php.net/bug.php?id=63863
|
858 |
-
*/
|
859 |
-
public function setDate($year, $month, $day)
|
860 |
-
{
|
861 |
-
$this->modify('+0 day');
|
862 |
-
|
863 |
-
return parent::setDate($year, $month, $day);
|
864 |
-
}
|
865 |
-
|
866 |
-
/**
|
867 |
-
* Set the date and time all together
|
868 |
-
*
|
869 |
-
* @param int $year
|
870 |
-
* @param int $month
|
871 |
-
* @param int $day
|
872 |
-
* @param int $hour
|
873 |
-
* @param int $minute
|
874 |
-
* @param int $second
|
875 |
-
*
|
876 |
-
* @return static
|
877 |
-
*/
|
878 |
-
public function setDateTime($year, $month, $day, $hour, $minute, $second = 0)
|
879 |
-
{
|
880 |
-
return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second);
|
881 |
-
}
|
882 |
-
|
883 |
-
/**
|
884 |
-
* Set the time by time string
|
885 |
-
*
|
886 |
-
* @param string $time
|
887 |
-
*
|
888 |
-
* @return static
|
889 |
-
*/
|
890 |
-
public function setTimeFromTimeString($time)
|
891 |
-
{
|
892 |
-
$time = explode(':', $time);
|
893 |
-
|
894 |
-
$hour = $time[0];
|
895 |
-
$minute = isset($time[1]) ? $time[1] : 0;
|
896 |
-
$second = isset($time[2]) ? $time[2] : 0;
|
897 |
-
|
898 |
-
return $this->setTime($hour, $minute, $second);
|
899 |
-
}
|
900 |
-
|
901 |
-
/**
|
902 |
-
* Set the instance's timestamp
|
903 |
-
*
|
904 |
-
* @param int $value
|
905 |
-
*
|
906 |
-
* @return static
|
907 |
-
*/
|
908 |
-
public function timestamp($value)
|
909 |
-
{
|
910 |
-
return $this->setTimestamp($value);
|
911 |
-
}
|
912 |
-
|
913 |
-
/**
|
914 |
-
* Alias for setTimezone()
|
915 |
-
*
|
916 |
-
* @param \DateTimeZone|string $value
|
917 |
-
*
|
918 |
-
* @return static
|
919 |
-
*/
|
920 |
-
public function timezone($value)
|
921 |
-
{
|
922 |
-
return $this->setTimezone($value);
|
923 |
-
}
|
924 |
-
|
925 |
-
/**
|
926 |
-
* Alias for setTimezone()
|
927 |
-
*
|
928 |
-
* @param \DateTimeZone|string $value
|
929 |
-
*
|
930 |
-
* @return static
|
931 |
-
*/
|
932 |
-
public function tz($value)
|
933 |
-
{
|
934 |
-
return $this->setTimezone($value);
|
935 |
-
}
|
936 |
-
|
937 |
-
/**
|
938 |
-
* Set the instance's timezone from a string or object
|
939 |
-
*
|
940 |
-
* @param \DateTimeZone|string $value
|
941 |
-
*
|
942 |
-
* @return static
|
943 |
-
*/
|
944 |
-
public function setTimezone($value)
|
945 |
-
{
|
946 |
-
return parent::setTimezone(static::safeCreateDateTimeZone($value));
|
947 |
-
}
|
948 |
-
|
949 |
-
///////////////////////////////////////////////////////////////////
|
950 |
-
/////////////////////// WEEK SPECIAL DAYS /////////////////////////
|
951 |
-
///////////////////////////////////////////////////////////////////
|
952 |
-
|
953 |
-
/**
|
954 |
-
* Get the first day of week
|
955 |
-
*
|
956 |
-
* @return int
|
957 |
-
*/
|
958 |
-
public static function getWeekStartsAt()
|
959 |
-
{
|
960 |
-
return static::$weekStartsAt;
|
961 |
-
}
|
962 |
-
|
963 |
-
/**
|
964 |
-
* Set the first day of week
|
965 |
-
*
|
966 |
-
* @param int
|
967 |
-
*/
|
968 |
-
public static function setWeekStartsAt($day)
|
969 |
-
{
|
970 |
-
static::$weekStartsAt = $day;
|
971 |
-
}
|
972 |
-
|
973 |
-
/**
|
974 |
-
* Get the last day of week
|
975 |
-
*
|
976 |
-
* @return int
|
977 |
-
*/
|
978 |
-
public static function getWeekEndsAt()
|
979 |
-
{
|
980 |
-
return static::$weekEndsAt;
|
981 |
-
}
|
982 |
-
|
983 |
-
/**
|
984 |
-
* Set the last day of week
|
985 |
-
*
|
986 |
-
* @param int
|
987 |
-
*/
|
988 |
-
public static function setWeekEndsAt($day)
|
989 |
-
{
|
990 |
-
static::$weekEndsAt = $day;
|
991 |
-
}
|
992 |
-
|
993 |
-
/**
|
994 |
-
* Get weekend days
|
995 |
-
*
|
996 |
-
* @return array
|
997 |
-
*/
|
998 |
-
public static function getWeekendDays()
|
999 |
-
{
|
1000 |
-
return static::$weekendDays;
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
/**
|
1004 |
-
* Set weekend days
|
1005 |
-
*
|
1006 |
-
* @param array
|
1007 |
-
*/
|
1008 |
-
public static function setWeekendDays($days)
|
1009 |
-
{
|
1010 |
-
static::$weekendDays = $days;
|
1011 |
-
}
|
1012 |
-
|
1013 |
-
///////////////////////////////////////////////////////////////////
|
1014 |
-
///////////////////////// TESTING AIDS ////////////////////////////
|
1015 |
-
///////////////////////////////////////////////////////////////////
|
1016 |
-
|
1017 |
-
/**
|
1018 |
-
* Set a Carbon instance (real or mock) to be returned when a "now"
|
1019 |
-
* instance is created. The provided instance will be returned
|
1020 |
-
* specifically under the following conditions:
|
1021 |
-
* - A call to the static now() method, ex. Carbon::now()
|
1022 |
-
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
|
1023 |
-
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
|
1024 |
-
* - When a string containing the desired time is passed to Carbon::parse().
|
1025 |
-
*
|
1026 |
-
* Note the timezone parameter was left out of the examples above and
|
1027 |
-
* has no affect as the mock value will be returned regardless of its value.
|
1028 |
-
*
|
1029 |
-
* To clear the test instance call this method using the default
|
1030 |
-
* parameter of null.
|
1031 |
-
*
|
1032 |
-
* @param \Carbon\Carbon|string|null $testNow
|
1033 |
-
*/
|
1034 |
-
public static function setTestNow($testNow = null)
|
1035 |
-
{
|
1036 |
-
static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow;
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
/**
|
1040 |
-
* Get the Carbon instance (real or mock) to be returned when a "now"
|
1041 |
-
* instance is created.
|
1042 |
-
*
|
1043 |
-
* @return static the current instance used for testing
|
1044 |
-
*/
|
1045 |
-
public static function getTestNow()
|
1046 |
-
{
|
1047 |
-
return static::$testNow;
|
1048 |
-
}
|
1049 |
-
|
1050 |
-
/**
|
1051 |
-
* Determine if there is a valid test instance set. A valid test instance
|
1052 |
-
* is anything that is not null.
|
1053 |
-
*
|
1054 |
-
* @return bool true if there is a test instance, otherwise false
|
1055 |
-
*/
|
1056 |
-
public static function hasTestNow()
|
1057 |
-
{
|
1058 |
-
return static::getTestNow() !== null;
|
1059 |
-
}
|
1060 |
-
|
1061 |
-
/**
|
1062 |
-
* Determine if there is a relative keyword in the time string, this is to
|
1063 |
-
* create dates relative to now for test instances. e.g.: next tuesday
|
1064 |
-
*
|
1065 |
-
* @param string $time
|
1066 |
-
*
|
1067 |
-
* @return bool true if there is a keyword, otherwise false
|
1068 |
-
*/
|
1069 |
-
public static function hasRelativeKeywords($time)
|
1070 |
-
{
|
1071 |
-
// skip common format with a '-' in it
|
1072 |
-
if (preg_match('/\d{4}-\d{1,2}-\d{1,2}/', $time) !== 1) {
|
1073 |
-
foreach (static::$relativeKeywords as $keyword) {
|
1074 |
-
if (stripos($time, $keyword) !== false) {
|
1075 |
-
return true;
|
1076 |
-
}
|
1077 |
-
}
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
return false;
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
///////////////////////////////////////////////////////////////////
|
1084 |
-
/////////////////////// LOCALIZATION //////////////////////////////
|
1085 |
-
///////////////////////////////////////////////////////////////////
|
1086 |
-
|
1087 |
-
/**
|
1088 |
-
* Initialize the translator instance if necessary.
|
1089 |
-
*
|
1090 |
-
* @return \Symfony\Component\Translation\TranslatorInterface
|
1091 |
-
*/
|
1092 |
-
protected static function translator()
|
1093 |
-
{
|
1094 |
-
if (static::$translator === null) {
|
1095 |
-
static::$translator = new Translator('en');
|
1096 |
-
static::$translator->addLoader('array', new ArrayLoader());
|
1097 |
-
static::setLocale('en');
|
1098 |
-
}
|
1099 |
-
|
1100 |
-
return static::$translator;
|
1101 |
-
}
|
1102 |
-
|
1103 |
-
/**
|
1104 |
-
* Get the translator instance in use
|
1105 |
-
*
|
1106 |
-
* @return \Symfony\Component\Translation\TranslatorInterface
|
1107 |
-
*/
|
1108 |
-
public static function getTranslator()
|
1109 |
-
{
|
1110 |
-
return static::translator();
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
/**
|
1114 |
-
* Set the translator instance to use
|
1115 |
-
*
|
1116 |
-
* @param \Symfony\Component\Translation\TranslatorInterface $translator
|
1117 |
-
*/
|
1118 |
-
public static function setTranslator(TranslatorInterface $translator)
|
1119 |
-
{
|
1120 |
-
static::$translator = $translator;
|
1121 |
-
}
|
1122 |
-
|
1123 |
-
/**
|
1124 |
-
* Get the current translator locale
|
1125 |
-
*
|
1126 |
-
* @return string
|
1127 |
-
*/
|
1128 |
-
public static function getLocale()
|
1129 |
-
{
|
1130 |
-
return static::translator()->getLocale();
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
/**
|
1134 |
-
* Set the current translator locale and indicate if the source locale file exists
|
1135 |
-
*
|
1136 |
-
* @param string $locale
|
1137 |
-
*
|
1138 |
-
* @return bool
|
1139 |
-
*/
|
1140 |
-
public static function setLocale($locale)
|
1141 |
-
{
|
1142 |
-
$locale = preg_replace_callback('/\b([a-z]{2})[-_](?:([a-z]{4})[-_])?([a-z]{2})\b/', function ($matches) {
|
1143 |
-
return $matches[1].'_'.(!empty($matches[2]) ? ucfirst($matches[2]).'_' : '').strtoupper($matches[3]);
|
1144 |
-
}, strtolower($locale));
|
1145 |
-
|
1146 |
-
if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) {
|
1147 |
-
static::translator()->setLocale($locale);
|
1148 |
-
// Ensure the locale has been loaded.
|
1149 |
-
static::translator()->addResource('array', require $filename, $locale);
|
1150 |
-
|
1151 |
-
return true;
|
1152 |
-
}
|
1153 |
-
|
1154 |
-
return false;
|
1155 |
-
}
|
1156 |
-
|
1157 |
-
///////////////////////////////////////////////////////////////////
|
1158 |
-
/////////////////////// STRING FORMATTING /////////////////////////
|
1159 |
-
///////////////////////////////////////////////////////////////////
|
1160 |
-
|
1161 |
-
/**
|
1162 |
-
* Set if UTF8 will be used for localized date/time
|
1163 |
-
*
|
1164 |
-
* @param bool $utf8
|
1165 |
-
*/
|
1166 |
-
public static function setUtf8($utf8)
|
1167 |
-
{
|
1168 |
-
static::$utf8 = $utf8;
|
1169 |
-
}
|
1170 |
-
|
1171 |
-
/**
|
1172 |
-
* Format the instance with the current locale. You can set the current
|
1173 |
-
* locale using setlocale() http://php.net/setlocale.
|
1174 |
-
*
|
1175 |
-
* @param string $format
|
1176 |
-
*
|
1177 |
-
* @return string
|
1178 |
-
*/
|
1179 |
-
public function formatLocalized($format)
|
1180 |
-
{
|
1181 |
-
// Check for Windows to find and replace the %e
|
1182 |
-
// modifier correctly
|
1183 |
-
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
1184 |
-
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
$formatted = strftime($format, strtotime($this));
|
1188 |
-
|
1189 |
-
return static::$utf8 ? utf8_encode($formatted) : $formatted;
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
/**
|
1193 |
-
* Reset the format used to the default when type juggling a Carbon instance to a string
|
1194 |
-
*/
|
1195 |
-
public static function resetToStringFormat()
|
1196 |
-
{
|
1197 |
-
static::setToStringFormat(static::DEFAULT_TO_STRING_FORMAT);
|
1198 |
-
}
|
1199 |
-
|
1200 |
-
/**
|
1201 |
-
* Set the default format used when type juggling a Carbon instance to a string
|
1202 |
-
*
|
1203 |
-
* @param string $format
|
1204 |
-
*/
|
1205 |
-
public static function setToStringFormat($format)
|
1206 |
-
{
|
1207 |
-
static::$toStringFormat = $format;
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
/**
|
1211 |
-
* Format the instance as a string using the set format
|
1212 |
-
*
|
1213 |
-
* @return string
|
1214 |
-
*/
|
1215 |
-
public function __toString()
|
1216 |
-
{
|
1217 |
-
return $this->format(static::$toStringFormat);
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
/**
|
1221 |
-
* Format the instance as date
|
1222 |
-
*
|
1223 |
-
* @return string
|
1224 |
-
*/
|
1225 |
-
public function toDateString()
|
1226 |
-
{
|
1227 |
-
return $this->format('Y-m-d');
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
/**
|
1231 |
-
* Format the instance as a readable date
|
1232 |
-
*
|
1233 |
-
* @return string
|
1234 |
-
*/
|
1235 |
-
public function toFormattedDateString()
|
1236 |
-
{
|
1237 |
-
return $this->format('M j, Y');
|
1238 |
-
}
|
1239 |
-
|
1240 |
-
/**
|
1241 |
-
* Format the instance as time
|
1242 |
-
*
|
1243 |
-
* @return string
|
1244 |
-
*/
|
1245 |
-
public function toTimeString()
|
1246 |
-
{
|
1247 |
-
return $this->format('H:i:s');
|
1248 |
-
}
|
1249 |
-
|
1250 |
-
/**
|
1251 |
-
* Format the instance as date and time
|
1252 |
-
*
|
1253 |
-
* @return string
|
1254 |
-
*/
|
1255 |
-
public function toDateTimeString()
|
1256 |
-
{
|
1257 |
-
return $this->format('Y-m-d H:i:s');
|
1258 |
-
}
|
1259 |
-
|
1260 |
-
/**
|
1261 |
-
* Format the instance with day, date and time
|
1262 |
-
*
|
1263 |
-
* @return string
|
1264 |
-
*/
|
1265 |
-
public function toDayDateTimeString()
|
1266 |
-
{
|
1267 |
-
return $this->format('D, M j, Y g:i A');
|
1268 |
-
}
|
1269 |
-
|
1270 |
-
/**
|
1271 |
-
* Format the instance as ATOM
|
1272 |
-
*
|
1273 |
-
* @return string
|
1274 |
-
*/
|
1275 |
-
public function toAtomString()
|
1276 |
-
{
|
1277 |
-
return $this->format(static::ATOM);
|
1278 |
-
}
|
1279 |
-
|
1280 |
-
/**
|
1281 |
-
* Format the instance as COOKIE
|
1282 |
-
*
|
1283 |
-
* @return string
|
1284 |
-
*/
|
1285 |
-
public function toCookieString()
|
1286 |
-
{
|
1287 |
-
return $this->format(static::COOKIE);
|
1288 |
-
}
|
1289 |
-
|
1290 |
-
/**
|
1291 |
-
* Format the instance as ISO8601
|
1292 |
-
*
|
1293 |
-
* @return string
|
1294 |
-
*/
|
1295 |
-
public function toIso8601String()
|
1296 |
-
{
|
1297 |
-
return $this->toAtomString();
|
1298 |
-
}
|
1299 |
-
|
1300 |
-
/**
|
1301 |
-
* Format the instance as RFC822
|
1302 |
-
*
|
1303 |
-
* @return string
|
1304 |
-
*/
|
1305 |
-
public function toRfc822String()
|
1306 |
-
{
|
1307 |
-
return $this->format(static::RFC822);
|
1308 |
-
}
|
1309 |
-
|
1310 |
-
/**
|
1311 |
-
* Format the instance as RFC850
|
1312 |
-
*
|
1313 |
-
* @return string
|
1314 |
-
*/
|
1315 |
-
public function toRfc850String()
|
1316 |
-
{
|
1317 |
-
return $this->format(static::RFC850);
|
1318 |
-
}
|
1319 |
-
|
1320 |
-
/**
|
1321 |
-
* Format the instance as RFC1036
|
1322 |
-
*
|
1323 |
-
* @return string
|
1324 |
-
*/
|
1325 |
-
public function toRfc1036String()
|
1326 |
-
{
|
1327 |
-
return $this->format(static::RFC1036);
|
1328 |
-
}
|
1329 |
-
|
1330 |
-
/**
|
1331 |
-
* Format the instance as RFC1123
|
1332 |
-
*
|
1333 |
-
* @return string
|
1334 |
-
*/
|
1335 |
-
public function toRfc1123String()
|
1336 |
-
{
|
1337 |
-
return $this->format(static::RFC1123);
|
1338 |
-
}
|
1339 |
-
|
1340 |
-
/**
|
1341 |
-
* Format the instance as RFC2822
|
1342 |
-
*
|
1343 |
-
* @return string
|
1344 |
-
*/
|
1345 |
-
public function toRfc2822String()
|
1346 |
-
{
|
1347 |
-
return $this->format(static::RFC2822);
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
/**
|
1351 |
-
* Format the instance as RFC3339
|
1352 |
-
*
|
1353 |
-
* @return string
|
1354 |
-
*/
|
1355 |
-
public function toRfc3339String()
|
1356 |
-
{
|
1357 |
-
return $this->format(static::RFC3339);
|
1358 |
-
}
|
1359 |
-
|
1360 |
-
/**
|
1361 |
-
* Format the instance as RSS
|
1362 |
-
*
|
1363 |
-
* @return string
|
1364 |
-
*/
|
1365 |
-
public function toRssString()
|
1366 |
-
{
|
1367 |
-
return $this->format(static::RSS);
|
1368 |
-
}
|
1369 |
-
|
1370 |
-
/**
|
1371 |
-
* Format the instance as W3C
|
1372 |
-
*
|
1373 |
-
* @return string
|
1374 |
-
*/
|
1375 |
-
public function toW3cString()
|
1376 |
-
{
|
1377 |
-
return $this->format(static::W3C);
|
1378 |
-
}
|
1379 |
-
|
1380 |
-
///////////////////////////////////////////////////////////////////
|
1381 |
-
////////////////////////// COMPARISONS ////////////////////////////
|
1382 |
-
///////////////////////////////////////////////////////////////////
|
1383 |
-
|
1384 |
-
/**
|
1385 |
-
* Determines if the instance is equal to another
|
1386 |
-
*
|
1387 |
-
* @param Carbon $dt
|
1388 |
-
*
|
1389 |
-
* @return bool
|
1390 |
-
*/
|
1391 |
-
public function eq(Carbon $dt)
|
1392 |
-
{
|
1393 |
-
return $this == $dt;
|
1394 |
-
}
|
1395 |
-
|
1396 |
-
/**
|
1397 |
-
* Determines if the instance is equal to another
|
1398 |
-
*
|
1399 |
-
* @param Carbon $dt
|
1400 |
-
*
|
1401 |
-
* @see eq()
|
1402 |
-
*
|
1403 |
-
* @return bool
|
1404 |
-
*/
|
1405 |
-
public function equalTo(Carbon $dt)
|
1406 |
-
{
|
1407 |
-
return $this->eq($dt);
|
1408 |
-
}
|
1409 |
-
|
1410 |
-
/**
|
1411 |
-
* Determines if the instance is not equal to another
|
1412 |
-
*
|
1413 |
-
* @param Carbon $dt
|
1414 |
-
*
|
1415 |
-
* @return bool
|
1416 |
-
*/
|
1417 |
-
public function ne(Carbon $dt)
|
1418 |
-
{
|
1419 |
-
return !$this->eq($dt);
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
/**
|
1423 |
-
* Determines if the instance is not equal to another
|
1424 |
-
*
|
1425 |
-
* @param Carbon $dt
|
1426 |
-
*
|
1427 |
-
* @see ne()
|
1428 |
-
*
|
1429 |
-
* @return bool
|
1430 |
-
*/
|
1431 |
-
public function notEqualTo(Carbon $dt)
|
1432 |
-
{
|
1433 |
-
return $this->ne($dt);
|
1434 |
-
}
|
1435 |
-
|
1436 |
-
/**
|
1437 |
-
* Determines if the instance is greater (after) than another
|
1438 |
-
*
|
1439 |
-
* @param Carbon $dt
|
1440 |
-
*
|
1441 |
-
* @return bool
|
1442 |
-
*/
|
1443 |
-
public function gt(Carbon $dt)
|
1444 |
-
{
|
1445 |
-
return $this > $dt;
|
1446 |
-
}
|
1447 |
-
|
1448 |
-
/**
|
1449 |
-
* Determines if the instance is greater (after) than another
|
1450 |
-
*
|
1451 |
-
* @param Carbon $dt
|
1452 |
-
*
|
1453 |
-
* @see gt()
|
1454 |
-
*
|
1455 |
-
* @return bool
|
1456 |
-
*/
|
1457 |
-
public function greaterThan(Carbon $dt)
|
1458 |
-
{
|
1459 |
-
return $this->gt($dt);
|
1460 |
-
}
|
1461 |
-
|
1462 |
-
/**
|
1463 |
-
* Determines if the instance is greater (after) than or equal to another
|
1464 |
-
*
|
1465 |
-
* @param Carbon $dt
|
1466 |
-
*
|
1467 |
-
* @return bool
|
1468 |
-
*/
|
1469 |
-
public function gte(Carbon $dt)
|
1470 |
-
{
|
1471 |
-
return $this >= $dt;
|
1472 |
-
}
|
1473 |
-
|
1474 |
-
/**
|
1475 |
-
* Determines if the instance is greater (after) than or equal to another
|
1476 |
-
*
|
1477 |
-
* @param Carbon $dt
|
1478 |
-
*
|
1479 |
-
* @see gte()
|
1480 |
-
*
|
1481 |
-
* @return bool
|
1482 |
-
*/
|
1483 |
-
public function greaterThanOrEqualTo(Carbon $dt)
|
1484 |
-
{
|
1485 |
-
return $this->gte($dt);
|
1486 |
-
}
|
1487 |
-
|
1488 |
-
/**
|
1489 |
-
* Determines if the instance is less (before) than another
|
1490 |
-
*
|
1491 |
-
* @param Carbon $dt
|
1492 |
-
*
|
1493 |
-
* @return bool
|
1494 |
-
*/
|
1495 |
-
public function lt(Carbon $dt)
|
1496 |
-
{
|
1497 |
-
return $this < $dt;
|
1498 |
-
}
|
1499 |
-
|
1500 |
-
/**
|
1501 |
-
* Determines if the instance is less (before) than another
|
1502 |
-
*
|
1503 |
-
* @param Carbon $dt
|
1504 |
-
*
|
1505 |
-
* @see lt()
|
1506 |
-
*
|
1507 |
-
* @return bool
|
1508 |
-
*/
|
1509 |
-
public function lessThan(Carbon $dt)
|
1510 |
-
{
|
1511 |
-
return $this->lt($dt);
|
1512 |
-
}
|
1513 |
-
|
1514 |
-
/**
|
1515 |
-
* Determines if the instance is less (before) or equal to another
|
1516 |
-
*
|
1517 |
-
* @param Carbon $dt
|
1518 |
-
*
|
1519 |
-
* @return bool
|
1520 |
-
*/
|
1521 |
-
public function lte(Carbon $dt)
|
1522 |
-
{
|
1523 |
-
return $this <= $dt;
|
1524 |
-
}
|
1525 |
-
|
1526 |
-
/**
|
1527 |
-
* Determines if the instance is less (before) or equal to another
|
1528 |
-
*
|
1529 |
-
* @param Carbon $dt
|
1530 |
-
*
|
1531 |
-
* @see lte()
|
1532 |
-
*
|
1533 |
-
* @return bool
|
1534 |
-
*/
|
1535 |
-
public function lessThanOrEqualTo(Carbon $dt)
|
1536 |
-
{
|
1537 |
-
return $this->lte($dt);
|
1538 |
-
}
|
1539 |
-
|
1540 |
-
/**
|
1541 |
-
* Determines if the instance is between two others
|
1542 |
-
*
|
1543 |
-
* @param Carbon $dt1
|
1544 |
-
* @param Carbon $dt2
|
1545 |
-
* @param bool $equal Indicates if a > and < comparison should be used or <= or >=
|
1546 |
-
*
|
1547 |
-
* @return bool
|
1548 |
-
*/
|
1549 |
-
public function between(Carbon $dt1, Carbon $dt2, $equal = true)
|
1550 |
-
{
|
1551 |
-
if ($dt1->gt($dt2)) {
|
1552 |
-
$temp = $dt1;
|
1553 |
-
$dt1 = $dt2;
|
1554 |
-
$dt2 = $temp;
|
1555 |
-
}
|
1556 |
-
|
1557 |
-
if ($equal) {
|
1558 |
-
return $this->gte($dt1) && $this->lte($dt2);
|
1559 |
-
}
|
1560 |
-
|
1561 |
-
return $this->gt($dt1) && $this->lt($dt2);
|
1562 |
-
}
|
1563 |
-
|
1564 |
-
/**
|
1565 |
-
* Get the closest date from the instance.
|
1566 |
-
*
|
1567 |
-
* @param Carbon $dt1
|
1568 |
-
* @param Carbon $dt2
|
1569 |
-
*
|
1570 |
-
* @return static
|
1571 |
-
*/
|
1572 |
-
public function closest(Carbon $dt1, Carbon $dt2)
|
1573 |
-
{
|
1574 |
-
return $this->diffInSeconds($dt1) < $this->diffInSeconds($dt2) ? $dt1 : $dt2;
|
1575 |
-
}
|
1576 |
-
|
1577 |
-
/**
|
1578 |
-
* Get the farthest date from the instance.
|
1579 |
-
*
|
1580 |
-
* @param Carbon $dt1
|
1581 |
-
* @param Carbon $dt2
|
1582 |
-
*
|
1583 |
-
* @return static
|
1584 |
-
*/
|
1585 |
-
public function farthest(Carbon $dt1, Carbon $dt2)
|
1586 |
-
{
|
1587 |
-
return $this->diffInSeconds($dt1) > $this->diffInSeconds($dt2) ? $dt1 : $dt2;
|
1588 |
-
}
|
1589 |
-
|
1590 |
-
/**
|
1591 |
-
* Get the minimum instance between a given instance (default now) and the current instance.
|
1592 |
-
*
|
1593 |
-
* @param \Carbon\Carbon|null $dt
|
1594 |
-
*
|
1595 |
-
* @return static
|
1596 |
-
*/
|
1597 |
-
public function min(Carbon $dt = null)
|
1598 |
-
{
|
1599 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
1600 |
-
|
1601 |
-
return $this->lt($dt) ? $this : $dt;
|
1602 |
-
}
|
1603 |
-
|
1604 |
-
/**
|
1605 |
-
* Get the minimum instance between a given instance (default now) and the current instance.
|
1606 |
-
*
|
1607 |
-
* @param \Carbon\Carbon|null $dt
|
1608 |
-
*
|
1609 |
-
* @see min()
|
1610 |
-
*
|
1611 |
-
* @return static
|
1612 |
-
*/
|
1613 |
-
public function minimum(Carbon $dt = null)
|
1614 |
-
{
|
1615 |
-
return $this->min($dt);
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
/**
|
1619 |
-
* Get the maximum instance between a given instance (default now) and the current instance.
|
1620 |
-
*
|
1621 |
-
* @param \Carbon\Carbon|null $dt
|
1622 |
-
*
|
1623 |
-
* @return static
|
1624 |
-
*/
|
1625 |
-
public function max(Carbon $dt = null)
|
1626 |
-
{
|
1627 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
1628 |
-
|
1629 |
-
return $this->gt($dt) ? $this : $dt;
|
1630 |
-
}
|
1631 |
-
|
1632 |
-
/**
|
1633 |
-
* Get the maximum instance between a given instance (default now) and the current instance.
|
1634 |
-
*
|
1635 |
-
* @param \Carbon\Carbon|null $dt
|
1636 |
-
*
|
1637 |
-
* @see max()
|
1638 |
-
*
|
1639 |
-
* @return static
|
1640 |
-
*/
|
1641 |
-
public function maximum(Carbon $dt = null)
|
1642 |
-
{
|
1643 |
-
return $this->max($dt);
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
/**
|
1647 |
-
* Determines if the instance is a weekday
|
1648 |
-
*
|
1649 |
-
* @return bool
|
1650 |
-
*/
|
1651 |
-
public function isWeekday()
|
1652 |
-
{
|
1653 |
-
return !$this->isWeekend();
|
1654 |
-
}
|
1655 |
-
|
1656 |
-
/**
|
1657 |
-
* Determines if the instance is a weekend day
|
1658 |
-
*
|
1659 |
-
* @return bool
|
1660 |
-
*/
|
1661 |
-
public function isWeekend()
|
1662 |
-
{
|
1663 |
-
return in_array($this->dayOfWeek, static::$weekendDays);
|
1664 |
-
}
|
1665 |
-
|
1666 |
-
/**
|
1667 |
-
* Determines if the instance is yesterday
|
1668 |
-
*
|
1669 |
-
* @return bool
|
1670 |
-
*/
|
1671 |
-
public function isYesterday()
|
1672 |
-
{
|
1673 |
-
return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString();
|
1674 |
-
}
|
1675 |
-
|
1676 |
-
/**
|
1677 |
-
* Determines if the instance is today
|
1678 |
-
*
|
1679 |
-
* @return bool
|
1680 |
-
*/
|
1681 |
-
public function isToday()
|
1682 |
-
{
|
1683 |
-
return $this->toDateString() === static::now($this->getTimezone())->toDateString();
|
1684 |
-
}
|
1685 |
-
|
1686 |
-
/**
|
1687 |
-
* Determines if the instance is tomorrow
|
1688 |
-
*
|
1689 |
-
* @return bool
|
1690 |
-
*/
|
1691 |
-
public function isTomorrow()
|
1692 |
-
{
|
1693 |
-
return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString();
|
1694 |
-
}
|
1695 |
-
|
1696 |
-
/**
|
1697 |
-
* Determines if the instance is within the next week
|
1698 |
-
*
|
1699 |
-
* @return bool
|
1700 |
-
*/
|
1701 |
-
public function isNextWeek()
|
1702 |
-
{
|
1703 |
-
return $this->weekOfYear === static::now($this->getTimezone())->addWeek()->weekOfYear;
|
1704 |
-
}
|
1705 |
-
|
1706 |
-
/**
|
1707 |
-
* Determines if the instance is within the last week
|
1708 |
-
*
|
1709 |
-
* @return bool
|
1710 |
-
*/
|
1711 |
-
public function isLastWeek()
|
1712 |
-
{
|
1713 |
-
return $this->weekOfYear === static::now($this->getTimezone())->subWeek()->weekOfYear;
|
1714 |
-
}
|
1715 |
-
|
1716 |
-
/**
|
1717 |
-
* Determines if the instance is within the next month
|
1718 |
-
*
|
1719 |
-
* @return bool
|
1720 |
-
*/
|
1721 |
-
public function isNextMonth()
|
1722 |
-
{
|
1723 |
-
return $this->month === static::now($this->getTimezone())->addMonthNoOverflow()->month;
|
1724 |
-
}
|
1725 |
-
|
1726 |
-
/**
|
1727 |
-
* Determines if the instance is within the last month
|
1728 |
-
*
|
1729 |
-
* @return bool
|
1730 |
-
*/
|
1731 |
-
public function isLastMonth()
|
1732 |
-
{
|
1733 |
-
return $this->month === static::now($this->getTimezone())->subMonthNoOverflow()->month;
|
1734 |
-
}
|
1735 |
-
|
1736 |
-
/**
|
1737 |
-
* Determines if the instance is within next year
|
1738 |
-
*
|
1739 |
-
* @return bool
|
1740 |
-
*/
|
1741 |
-
public function isNextYear()
|
1742 |
-
{
|
1743 |
-
return $this->year === static::now($this->getTimezone())->addYear()->year;
|
1744 |
-
}
|
1745 |
-
|
1746 |
-
/**
|
1747 |
-
* Determines if the instance is within the previous year
|
1748 |
-
*
|
1749 |
-
* @return bool
|
1750 |
-
*/
|
1751 |
-
public function isLastYear()
|
1752 |
-
{
|
1753 |
-
return $this->year === static::now($this->getTimezone())->subYear()->year;
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
/**
|
1757 |
-
* Determines if the instance is in the future, ie. greater (after) than now
|
1758 |
-
*
|
1759 |
-
* @return bool
|
1760 |
-
*/
|
1761 |
-
public function isFuture()
|
1762 |
-
{
|
1763 |
-
return $this->gt(static::now($this->getTimezone()));
|
1764 |
-
}
|
1765 |
-
|
1766 |
-
/**
|
1767 |
-
* Determines if the instance is in the past, ie. less (before) than now
|
1768 |
-
*
|
1769 |
-
* @return bool
|
1770 |
-
*/
|
1771 |
-
public function isPast()
|
1772 |
-
{
|
1773 |
-
return $this->lt(static::now($this->getTimezone()));
|
1774 |
-
}
|
1775 |
-
|
1776 |
-
/**
|
1777 |
-
* Determines if the instance is a leap year
|
1778 |
-
*
|
1779 |
-
* @return bool
|
1780 |
-
*/
|
1781 |
-
public function isLeapYear()
|
1782 |
-
{
|
1783 |
-
return $this->format('L') === '1';
|
1784 |
-
}
|
1785 |
-
|
1786 |
-
/**
|
1787 |
-
* Determines if the instance is a long year
|
1788 |
-
*
|
1789 |
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
1790 |
-
*
|
1791 |
-
* @return bool
|
1792 |
-
*/
|
1793 |
-
public function isLongYear()
|
1794 |
-
{
|
1795 |
-
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
|
1796 |
-
}
|
1797 |
-
|
1798 |
-
/*
|
1799 |
-
* Compares the formatted values of the two dates.
|
1800 |
-
*
|
1801 |
-
* @param string $format The date formats to compare.
|
1802 |
-
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1803 |
-
*
|
1804 |
-
* @return bool
|
1805 |
-
*/
|
1806 |
-
public function isSameAs($format, Carbon $dt = null)
|
1807 |
-
{
|
1808 |
-
$dt = $dt ?: static::now($this->tz);
|
1809 |
-
|
1810 |
-
return $this->format($format) === $dt->format($format);
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
/**
|
1814 |
-
* Determines if the instance is in the current year
|
1815 |
-
*
|
1816 |
-
* @return bool
|
1817 |
-
*/
|
1818 |
-
public function isCurrentYear()
|
1819 |
-
{
|
1820 |
-
return $this->isSameYear();
|
1821 |
-
}
|
1822 |
-
|
1823 |
-
/**
|
1824 |
-
* Checks if the passed in date is in the same year as the instance year.
|
1825 |
-
*
|
1826 |
-
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1827 |
-
*
|
1828 |
-
* @return bool
|
1829 |
-
*/
|
1830 |
-
public function isSameYear(Carbon $dt = null)
|
1831 |
-
{
|
1832 |
-
return $this->isSameAs('Y', $dt);
|
1833 |
-
}
|
1834 |
-
|
1835 |
-
/**
|
1836 |
-
* Determines if the instance is in the current month
|
1837 |
-
*
|
1838 |
-
* @return bool
|
1839 |
-
*/
|
1840 |
-
public function isCurrentMonth()
|
1841 |
-
{
|
1842 |
-
return $this->isSameMonth();
|
1843 |
-
}
|
1844 |
-
|
1845 |
-
/**
|
1846 |
-
* Checks if the passed in date is in the same month as the instance month (and year if needed).
|
1847 |
-
*
|
1848 |
-
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1849 |
-
* @param bool $ofSameYear Check if it is the same month in the same year.
|
1850 |
-
*
|
1851 |
-
* @return bool
|
1852 |
-
*/
|
1853 |
-
public function isSameMonth(Carbon $dt = null, $ofSameYear = false)
|
1854 |
-
{
|
1855 |
-
$format = $ofSameYear ? 'Y-m' : 'm';
|
1856 |
-
|
1857 |
-
return $this->isSameAs($format, $dt);
|
1858 |
-
}
|
1859 |
-
|
1860 |
-
/**
|
1861 |
-
* Checks if the passed in date is the same day as the instance current day.
|
1862 |
-
*
|
1863 |
-
* @param \Carbon\Carbon $dt
|
1864 |
-
*
|
1865 |
-
* @return bool
|
1866 |
-
*/
|
1867 |
-
public function isSameDay(Carbon $dt)
|
1868 |
-
{
|
1869 |
-
return $this->toDateString() === $dt->toDateString();
|
1870 |
-
}
|
1871 |
-
|
1872 |
-
/**
|
1873 |
-
* Checks if this day is a Sunday.
|
1874 |
-
*
|
1875 |
-
* @return bool
|
1876 |
-
*/
|
1877 |
-
public function isSunday()
|
1878 |
-
{
|
1879 |
-
return $this->dayOfWeek === static::SUNDAY;
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
/**
|
1883 |
-
* Checks if this day is a Monday.
|
1884 |
-
*
|
1885 |
-
* @return bool
|
1886 |
-
*/
|
1887 |
-
public function isMonday()
|
1888 |
-
{
|
1889 |
-
return $this->dayOfWeek === static::MONDAY;
|
1890 |
-
}
|
1891 |
-
|
1892 |
-
/**
|
1893 |
-
* Checks if this day is a Tuesday.
|
1894 |
-
*
|
1895 |
-
* @return bool
|
1896 |
-
*/
|
1897 |
-
public function isTuesday()
|
1898 |
-
{
|
1899 |
-
return $this->dayOfWeek === static::TUESDAY;
|
1900 |
-
}
|
1901 |
-
|
1902 |
-
/**
|
1903 |
-
* Checks if this day is a Wednesday.
|
1904 |
-
*
|
1905 |
-
* @return bool
|
1906 |
-
*/
|
1907 |
-
public function isWednesday()
|
1908 |
-
{
|
1909 |
-
return $this->dayOfWeek === static::WEDNESDAY;
|
1910 |
-
}
|
1911 |
-
|
1912 |
-
/**
|
1913 |
-
* Checks if this day is a Thursday.
|
1914 |
-
*
|
1915 |
-
* @return bool
|
1916 |
-
*/
|
1917 |
-
public function isThursday()
|
1918 |
-
{
|
1919 |
-
return $this->dayOfWeek === static::THURSDAY;
|
1920 |
-
}
|
1921 |
-
|
1922 |
-
/**
|
1923 |
-
* Checks if this day is a Friday.
|
1924 |
-
*
|
1925 |
-
* @return bool
|
1926 |
-
*/
|
1927 |
-
public function isFriday()
|
1928 |
-
{
|
1929 |
-
return $this->dayOfWeek === static::FRIDAY;
|
1930 |
-
}
|
1931 |
-
|
1932 |
-
/**
|
1933 |
-
* Checks if this day is a Saturday.
|
1934 |
-
*
|
1935 |
-
* @return bool
|
1936 |
-
*/
|
1937 |
-
public function isSaturday()
|
1938 |
-
{
|
1939 |
-
return $this->dayOfWeek === static::SATURDAY;
|
1940 |
-
}
|
1941 |
-
|
1942 |
-
///////////////////////////////////////////////////////////////////
|
1943 |
-
/////////////////// ADDITIONS AND SUBTRACTIONS ////////////////////
|
1944 |
-
///////////////////////////////////////////////////////////////////
|
1945 |
-
|
1946 |
-
/**
|
1947 |
-
* Add years to the instance. Positive $value travel forward while
|
1948 |
-
* negative $value travel into the past.
|
1949 |
-
*
|
1950 |
-
* @param int $value
|
1951 |
-
*
|
1952 |
-
* @return static
|
1953 |
-
*/
|
1954 |
-
public function addYears($value)
|
1955 |
-
{
|
1956 |
-
return $this->modify((int) $value.' year');
|
1957 |
-
}
|
1958 |
-
|
1959 |
-
/**
|
1960 |
-
* Add a year to the instance
|
1961 |
-
*
|
1962 |
-
* @param int $value
|
1963 |
-
*
|
1964 |
-
* @return static
|
1965 |
-
*/
|
1966 |
-
public function addYear($value = 1)
|
1967 |
-
{
|
1968 |
-
return $this->addYears($value);
|
1969 |
-
}
|
1970 |
-
|
1971 |
-
/**
|
1972 |
-
* Remove a year from the instance
|
1973 |
-
*
|
1974 |
-
* @param int $value
|
1975 |
-
*
|
1976 |
-
* @return static
|
1977 |
-
*/
|
1978 |
-
public function subYear($value = 1)
|
1979 |
-
{
|
1980 |
-
return $this->subYears($value);
|
1981 |
-
}
|
1982 |
-
|
1983 |
-
/**
|
1984 |
-
* Remove years from the instance.
|
1985 |
-
*
|
1986 |
-
* @param int $value
|
1987 |
-
*
|
1988 |
-
* @return static
|
1989 |
-
*/
|
1990 |
-
public function subYears($value)
|
1991 |
-
{
|
1992 |
-
return $this->addYears(-1 * $value);
|
1993 |
-
}
|
1994 |
-
|
1995 |
-
/**
|
1996 |
-
* Add quarters to the instance. Positive $value travels forward while
|
1997 |
-
* negative $value travels into the past.
|
1998 |
-
*
|
1999 |
-
* @param int $value
|
2000 |
-
*
|
2001 |
-
* @return static
|
2002 |
-
*/
|
2003 |
-
public function addQuarters($value)
|
2004 |
-
{
|
2005 |
-
return $this->addMonths(static::MONTHS_PER_QUARTER * $value);
|
2006 |
-
}
|
2007 |
-
|
2008 |
-
/**
|
2009 |
-
* Add a quarter to the instance
|
2010 |
-
*
|
2011 |
-
* @param int $value
|
2012 |
-
*
|
2013 |
-
* @return static
|
2014 |
-
*/
|
2015 |
-
public function addQuarter($value = 1)
|
2016 |
-
{
|
2017 |
-
return $this->addQuarters($value);
|
2018 |
-
}
|
2019 |
-
|
2020 |
-
/**
|
2021 |
-
* Remove a quarter from the instance
|
2022 |
-
*
|
2023 |
-
* @param int $value
|
2024 |
-
*
|
2025 |
-
* @return static
|
2026 |
-
*/
|
2027 |
-
public function subQuarter($value = 1)
|
2028 |
-
{
|
2029 |
-
return $this->subQuarters($value);
|
2030 |
-
}
|
2031 |
-
|
2032 |
-
/**
|
2033 |
-
* Remove quarters from the instance
|
2034 |
-
*
|
2035 |
-
* @param int $value
|
2036 |
-
*
|
2037 |
-
* @return static
|
2038 |
-
*/
|
2039 |
-
public function subQuarters($value)
|
2040 |
-
{
|
2041 |
-
return $this->addQuarters(-1 * $value);
|
2042 |
-
}
|
2043 |
-
|
2044 |
-
/**
|
2045 |
-
* Add centuries to the instance. Positive $value travels forward while
|
2046 |
-
* negative $value travels into the past.
|
2047 |
-
*
|
2048 |
-
* @param int $value
|
2049 |
-
*
|
2050 |
-
* @return static
|
2051 |
-
*/
|
2052 |
-
public function addCenturies($value)
|
2053 |
-
{
|
2054 |
-
return $this->addYears(static::YEARS_PER_CENTURY * $value);
|
2055 |
-
}
|
2056 |
-
|
2057 |
-
/**
|
2058 |
-
* Add a century to the instance
|
2059 |
-
*
|
2060 |
-
* @param int $value
|
2061 |
-
*
|
2062 |
-
* @return static
|
2063 |
-
*/
|
2064 |
-
public function addCentury($value = 1)
|
2065 |
-
{
|
2066 |
-
return $this->addCenturies($value);
|
2067 |
-
}
|
2068 |
-
|
2069 |
-
/**
|
2070 |
-
* Remove a century from the instance
|
2071 |
-
*
|
2072 |
-
* @param int $value
|
2073 |
-
*
|
2074 |
-
* @return static
|
2075 |
-
*/
|
2076 |
-
public function subCentury($value = 1)
|
2077 |
-
{
|
2078 |
-
return $this->subCenturies($value);
|
2079 |
-
}
|
2080 |
-
|
2081 |
-
/**
|
2082 |
-
* Remove centuries from the instance
|
2083 |
-
*
|
2084 |
-
* @param int $value
|
2085 |
-
*
|
2086 |
-
* @return static
|
2087 |
-
*/
|
2088 |
-
public function subCenturies($value)
|
2089 |
-
{
|
2090 |
-
return $this->addCenturies(-1 * $value);
|
2091 |
-
}
|
2092 |
-
|
2093 |
-
/**
|
2094 |
-
* Add months to the instance. Positive $value travels forward while
|
2095 |
-
* negative $value travels into the past.
|
2096 |
-
*
|
2097 |
-
* @param int $value
|
2098 |
-
*
|
2099 |
-
* @return static
|
2100 |
-
*/
|
2101 |
-
public function addMonths($value)
|
2102 |
-
{
|
2103 |
-
if (static::shouldOverflowMonths()) {
|
2104 |
-
return $this->addMonthsWithOverflow($value);
|
2105 |
-
}
|
2106 |
-
|
2107 |
-
return $this->addMonthsNoOverflow($value);
|
2108 |
-
}
|
2109 |
-
|
2110 |
-
/**
|
2111 |
-
* Add a month to the instance
|
2112 |
-
*
|
2113 |
-
* @param int $value
|
2114 |
-
*
|
2115 |
-
* @return static
|
2116 |
-
*/
|
2117 |
-
public function addMonth($value = 1)
|
2118 |
-
{
|
2119 |
-
return $this->addMonths($value);
|
2120 |
-
}
|
2121 |
-
|
2122 |
-
/**
|
2123 |
-
* Remove a month from the instance
|
2124 |
-
*
|
2125 |
-
* @param int $value
|
2126 |
-
*
|
2127 |
-
* @return static
|
2128 |
-
*/
|
2129 |
-
public function subMonth($value = 1)
|
2130 |
-
{
|
2131 |
-
return $this->subMonths($value);
|
2132 |
-
}
|
2133 |
-
|
2134 |
-
/**
|
2135 |
-
* Remove months from the instance
|
2136 |
-
*
|
2137 |
-
* @param int $value
|
2138 |
-
*
|
2139 |
-
* @return static
|
2140 |
-
*/
|
2141 |
-
public function subMonths($value)
|
2142 |
-
{
|
2143 |
-
return $this->addMonths(-1 * $value);
|
2144 |
-
}
|
2145 |
-
|
2146 |
-
/**
|
2147 |
-
* Add months to the instance. Positive $value travels forward while
|
2148 |
-
* negative $value travels into the past.
|
2149 |
-
*
|
2150 |
-
* @param int $value
|
2151 |
-
*
|
2152 |
-
* @return static
|
2153 |
-
*/
|
2154 |
-
public function addMonthsWithOverflow($value)
|
2155 |
-
{
|
2156 |
-
return $this->modify((int) $value.' month');
|
2157 |
-
}
|
2158 |
-
|
2159 |
-
/**
|
2160 |
-
* Add a month to the instance
|
2161 |
-
*
|
2162 |
-
* @param int $value
|
2163 |
-
*
|
2164 |
-
* @return static
|
2165 |
-
*/
|
2166 |
-
public function addMonthWithOverflow($value = 1)
|
2167 |
-
{
|
2168 |
-
return $this->addMonthsWithOverflow($value);
|
2169 |
-
}
|
2170 |
-
|
2171 |
-
/**
|
2172 |
-
* Remove a month from the instance
|
2173 |
-
*
|
2174 |
-
* @param int $value
|
2175 |
-
*
|
2176 |
-
* @return static
|
2177 |
-
*/
|
2178 |
-
public function subMonthWithOverflow($value = 1)
|
2179 |
-
{
|
2180 |
-
return $this->subMonthsWithOverflow($value);
|
2181 |
-
}
|
2182 |
-
|
2183 |
-
/**
|
2184 |
-
* Remove months from the instance
|
2185 |
-
*
|
2186 |
-
* @param int $value
|
2187 |
-
*
|
2188 |
-
* @return static
|
2189 |
-
*/
|
2190 |
-
public function subMonthsWithOverflow($value)
|
2191 |
-
{
|
2192 |
-
return $this->addMonthsWithOverflow(-1 * $value);
|
2193 |
-
}
|
2194 |
-
|
2195 |
-
/**
|
2196 |
-
* Add months without overflowing to the instance. Positive $value
|
2197 |
-
* travels forward while negative $value travels into the past.
|
2198 |
-
*
|
2199 |
-
* @param int $value
|
2200 |
-
*
|
2201 |
-
* @return static
|
2202 |
-
*/
|
2203 |
-
public function addMonthsNoOverflow($value)
|
2204 |
-
{
|
2205 |
-
$day = $this->day;
|
2206 |
-
|
2207 |
-
$this->modify((int) $value.' month');
|
2208 |
-
|
2209 |
-
if ($day !== $this->day) {
|
2210 |
-
$this->modify('last day of previous month');
|
2211 |
-
}
|
2212 |
-
|
2213 |
-
return $this;
|
2214 |
-
}
|
2215 |
-
|
2216 |
-
/**
|
2217 |
-
* Add a month with no overflow to the instance
|
2218 |
-
*
|
2219 |
-
* @param int $value
|
2220 |
-
*
|
2221 |
-
* @return static
|
2222 |
-
*/
|
2223 |
-
public function addMonthNoOverflow($value = 1)
|
2224 |
-
{
|
2225 |
-
return $this->addMonthsNoOverflow($value);
|
2226 |
-
}
|
2227 |
-
|
2228 |
-
/**
|
2229 |
-
* Remove a month with no overflow from the instance
|
2230 |
-
*
|
2231 |
-
* @param int $value
|
2232 |
-
*
|
2233 |
-
* @return static
|
2234 |
-
*/
|
2235 |
-
public function subMonthNoOverflow($value = 1)
|
2236 |
-
{
|
2237 |
-
return $this->subMonthsNoOverflow($value);
|
2238 |
-
}
|
2239 |
-
|
2240 |
-
/**
|
2241 |
-
* Remove months with no overflow from the instance
|
2242 |
-
*
|
2243 |
-
* @param int $value
|
2244 |
-
*
|
2245 |
-
* @return static
|
2246 |
-
*/
|
2247 |
-
public function subMonthsNoOverflow($value)
|
2248 |
-
{
|
2249 |
-
return $this->addMonthsNoOverflow(-1 * $value);
|
2250 |
-
}
|
2251 |
-
|
2252 |
-
/**
|
2253 |
-
* Add days to the instance. Positive $value travels forward while
|
2254 |
-
* negative $value travels into the past.
|
2255 |
-
*
|
2256 |
-
* @param int $value
|
2257 |
-
*
|
2258 |
-
* @return static
|
2259 |
-
*/
|
2260 |
-
public function addDays($value)
|
2261 |
-
{
|
2262 |
-
return $this->modify((int) $value.' day');
|
2263 |
-
}
|
2264 |
-
|
2265 |
-
/**
|
2266 |
-
* Add a day to the instance
|
2267 |
-
*
|
2268 |
-
* @param int $value
|
2269 |
-
*
|
2270 |
-
* @return static
|
2271 |
-
*/
|
2272 |
-
public function addDay($value = 1)
|
2273 |
-
{
|
2274 |
-
return $this->addDays($value);
|
2275 |
-
}
|
2276 |
-
|
2277 |
-
/**
|
2278 |
-
* Remove a day from the instance
|
2279 |
-
*
|
2280 |
-
* @param int $value
|
2281 |
-
*
|
2282 |
-
* @return static
|
2283 |
-
*/
|
2284 |
-
public function subDay($value = 1)
|
2285 |
-
{
|
2286 |
-
return $this->subDays($value);
|
2287 |
-
}
|
2288 |
-
|
2289 |
-
/**
|
2290 |
-
* Remove days from the instance
|
2291 |
-
*
|
2292 |
-
* @param int $value
|
2293 |
-
*
|
2294 |
-
* @return static
|
2295 |
-
*/
|
2296 |
-
public function subDays($value)
|
2297 |
-
{
|
2298 |
-
return $this->addDays(-1 * $value);
|
2299 |
-
}
|
2300 |
-
|
2301 |
-
/**
|
2302 |
-
* Add weekdays to the instance. Positive $value travels forward while
|
2303 |
-
* negative $value travels into the past.
|
2304 |
-
*
|
2305 |
-
* @param int $value
|
2306 |
-
*
|
2307 |
-
* @return static
|
2308 |
-
*/
|
2309 |
-
public function addWeekdays($value)
|
2310 |
-
{
|
2311 |
-
// fix for https://bugs.php.net/bug.php?id=54909
|
2312 |
-
$t = $this->toTimeString();
|
2313 |
-
$this->modify((int) $value.' weekday');
|
2314 |
-
|
2315 |
-
return $this->setTimeFromTimeString($t);
|
2316 |
-
}
|
2317 |
-
|
2318 |
-
/**
|
2319 |
-
* Add a weekday to the instance
|
2320 |
-
*
|
2321 |
-
* @param int $value
|
2322 |
-
*
|
2323 |
-
* @return static
|
2324 |
-
*/
|
2325 |
-
public function addWeekday($value = 1)
|
2326 |
-
{
|
2327 |
-
return $this->addWeekdays($value);
|
2328 |
-
}
|
2329 |
-
|
2330 |
-
/**
|
2331 |
-
* Remove a weekday from the instance
|
2332 |
-
*
|
2333 |
-
* @param int $value
|
2334 |
-
*
|
2335 |
-
* @return static
|
2336 |
-
*/
|
2337 |
-
public function subWeekday($value = 1)
|
2338 |
-
{
|
2339 |
-
return $this->subWeekdays($value);
|
2340 |
-
}
|
2341 |
-
|
2342 |
-
/**
|
2343 |
-
* Remove weekdays from the instance
|
2344 |
-
*
|
2345 |
-
* @param int $value
|
2346 |
-
*
|
2347 |
-
* @return static
|
2348 |
-
*/
|
2349 |
-
public function subWeekdays($value)
|
2350 |
-
{
|
2351 |
-
return $this->addWeekdays(-1 * $value);
|
2352 |
-
}
|
2353 |
-
|
2354 |
-
/**
|
2355 |
-
* Add weeks to the instance. Positive $value travels forward while
|
2356 |
-
* negative $value travels into the past.
|
2357 |
-
*
|
2358 |
-
* @param int $value
|
2359 |
-
*
|
2360 |
-
* @return static
|
2361 |
-
*/
|
2362 |
-
public function addWeeks($value)
|
2363 |
-
{
|
2364 |
-
return $this->modify((int) $value.' week');
|
2365 |
-
}
|
2366 |
-
|
2367 |
-
/**
|
2368 |
-
* Add a week to the instance
|
2369 |
-
*
|
2370 |
-
* @param int $value
|
2371 |
-
*
|
2372 |
-
* @return static
|
2373 |
-
*/
|
2374 |
-
public function addWeek($value = 1)
|
2375 |
-
{
|
2376 |
-
return $this->addWeeks($value);
|
2377 |
-
}
|
2378 |
-
|
2379 |
-
/**
|
2380 |
-
* Remove a week from the instance
|
2381 |
-
*
|
2382 |
-
* @param int $value
|
2383 |
-
*
|
2384 |
-
* @return static
|
2385 |
-
*/
|
2386 |
-
public function subWeek($value = 1)
|
2387 |
-
{
|
2388 |
-
return $this->subWeeks($value);
|
2389 |
-
}
|
2390 |
-
|
2391 |
-
/**
|
2392 |
-
* Remove weeks to the instance
|
2393 |
-
*
|
2394 |
-
* @param int $value
|
2395 |
-
*
|
2396 |
-
* @return static
|
2397 |
-
*/
|
2398 |
-
public function subWeeks($value)
|
2399 |
-
{
|
2400 |
-
return $this->addWeeks(-1 * $value);
|
2401 |
-
}
|
2402 |
-
|
2403 |
-
/**
|
2404 |
-
* Add hours to the instance. Positive $value travels forward while
|
2405 |
-
* negative $value travels into the past.
|
2406 |
-
*
|
2407 |
-
* @param int $value
|
2408 |
-
*
|
2409 |
-
* @return static
|
2410 |
-
*/
|
2411 |
-
public function addHours($value)
|
2412 |
-
{
|
2413 |
-
return $this->modify((int) $value.' hour');
|
2414 |
-
}
|
2415 |
-
|
2416 |
-
/**
|
2417 |
-
* Add an hour to the instance
|
2418 |
-
*
|
2419 |
-
* @param int $value
|
2420 |
-
*
|
2421 |
-
* @return static
|
2422 |
-
*/
|
2423 |
-
public function addHour($value = 1)
|
2424 |
-
{
|
2425 |
-
return $this->addHours($value);
|
2426 |
-
}
|
2427 |
-
|
2428 |
-
/**
|
2429 |
-
* Remove an hour from the instance
|
2430 |
-
*
|
2431 |
-
* @param int $value
|
2432 |
-
*
|
2433 |
-
* @return static
|
2434 |
-
*/
|
2435 |
-
public function subHour($value = 1)
|
2436 |
-
{
|
2437 |
-
return $this->subHours($value);
|
2438 |
-
}
|
2439 |
-
|
2440 |
-
/**
|
2441 |
-
* Remove hours from the instance
|
2442 |
-
*
|
2443 |
-
* @param int $value
|
2444 |
-
*
|
2445 |
-
* @return static
|
2446 |
-
*/
|
2447 |
-
public function subHours($value)
|
2448 |
-
{
|
2449 |
-
return $this->addHours(-1 * $value);
|
2450 |
-
}
|
2451 |
-
|
2452 |
-
/**
|
2453 |
-
* Add minutes to the instance. Positive $value travels forward while
|
2454 |
-
* negative $value travels into the past.
|
2455 |
-
*
|
2456 |
-
* @param int $value
|
2457 |
-
*
|
2458 |
-
* @return static
|
2459 |
-
*/
|
2460 |
-
public function addMinutes($value)
|
2461 |
-
{
|
2462 |
-
return $this->modify((int) $value.' minute');
|
2463 |
-
}
|
2464 |
-
|
2465 |
-
/**
|
2466 |
-
* Add a minute to the instance
|
2467 |
-
*
|
2468 |
-
* @param int $value
|
2469 |
-
*
|
2470 |
-
* @return static
|
2471 |
-
*/
|
2472 |
-
public function addMinute($value = 1)
|
2473 |
-
{
|
2474 |
-
return $this->addMinutes($value);
|
2475 |
-
}
|
2476 |
-
|
2477 |
-
/**
|
2478 |
-
* Remove a minute from the instance
|
2479 |
-
*
|
2480 |
-
* @param int $value
|
2481 |
-
*
|
2482 |
-
* @return static
|
2483 |
-
*/
|
2484 |
-
public function subMinute($value = 1)
|
2485 |
-
{
|
2486 |
-
return $this->subMinutes($value);
|
2487 |
-
}
|
2488 |
-
|
2489 |
-
/**
|
2490 |
-
* Remove minutes from the instance
|
2491 |
-
*
|
2492 |
-
* @param int $value
|
2493 |
-
*
|
2494 |
-
* @return static
|
2495 |
-
*/
|
2496 |
-
public function subMinutes($value)
|
2497 |
-
{
|
2498 |
-
return $this->addMinutes(-1 * $value);
|
2499 |
-
}
|
2500 |
-
|
2501 |
-
/**
|
2502 |
-
* Add seconds to the instance. Positive $value travels forward while
|
2503 |
-
* negative $value travels into the past.
|
2504 |
-
*
|
2505 |
-
* @param int $value
|
2506 |
-
*
|
2507 |
-
* @return static
|
2508 |
-
*/
|
2509 |
-
public function addSeconds($value)
|
2510 |
-
{
|
2511 |
-
return $this->modify((int) $value.' second');
|
2512 |
-
}
|
2513 |
-
|
2514 |
-
/**
|
2515 |
-
* Add a second to the instance
|
2516 |
-
*
|
2517 |
-
* @param int $value
|
2518 |
-
*
|
2519 |
-
* @return static
|
2520 |
-
*/
|
2521 |
-
public function addSecond($value = 1)
|
2522 |
-
{
|
2523 |
-
return $this->addSeconds($value);
|
2524 |
-
}
|
2525 |
-
|
2526 |
-
/**
|
2527 |
-
* Remove a second from the instance
|
2528 |
-
*
|
2529 |
-
* @param int $value
|
2530 |
-
*
|
2531 |
-
* @return static
|
2532 |
-
*/
|
2533 |
-
public function subSecond($value = 1)
|
2534 |
-
{
|
2535 |
-
return $this->subSeconds($value);
|
2536 |
-
}
|
2537 |
-
|
2538 |
-
/**
|
2539 |
-
* Remove seconds from the instance
|
2540 |
-
*
|
2541 |
-
* @param int $value
|
2542 |
-
*
|
2543 |
-
* @return static
|
2544 |
-
*/
|
2545 |
-
public function subSeconds($value)
|
2546 |
-
{
|
2547 |
-
return $this->addSeconds(-1 * $value);
|
2548 |
-
}
|
2549 |
-
|
2550 |
-
///////////////////////////////////////////////////////////////////
|
2551 |
-
/////////////////////////// DIFFERENCES ///////////////////////////
|
2552 |
-
///////////////////////////////////////////////////////////////////
|
2553 |
-
|
2554 |
-
/**
|
2555 |
-
* Get the difference in years
|
2556 |
-
*
|
2557 |
-
* @param \Carbon\Carbon|null $dt
|
2558 |
-
* @param bool $abs Get the absolute of the difference
|
2559 |
-
*
|
2560 |
-
* @return int
|
2561 |
-
*/
|
2562 |
-
public function diffInYears(Carbon $dt = null, $abs = true)
|
2563 |
-
{
|
2564 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
2565 |
-
|
2566 |
-
return (int) $this->diff($dt, $abs)->format('%r%y');
|
2567 |
-
}
|
2568 |
-
|
2569 |
-
/**
|
2570 |
-
* Get the difference in months
|
2571 |
-
*
|
2572 |
-
* @param \Carbon\Carbon|null $dt
|
2573 |
-
* @param bool $abs Get the absolute of the difference
|
2574 |
-
*
|
2575 |
-
* @return int
|
2576 |
-
*/
|
2577 |
-
public function diffInMonths(Carbon $dt = null, $abs = true)
|
2578 |
-
{
|
2579 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
2580 |
-
|
2581 |
-
return $this->diffInYears($dt, $abs) * static::MONTHS_PER_YEAR + (int) $this->diff($dt, $abs)->format('%r%m');
|
2582 |
-
}
|
2583 |
-
|
2584 |
-
/**
|
2585 |
-
* Get the difference in weeks
|
2586 |
-
*
|
2587 |
-
* @param \Carbon\Carbon|null $dt
|
2588 |
-
* @param bool $abs Get the absolute of the difference
|
2589 |
-
*
|
2590 |
-
* @return int
|
2591 |
-
*/
|
2592 |
-
public function diffInWeeks(Carbon $dt = null, $abs = true)
|
2593 |
-
{
|
2594 |
-
return (int) ($this->diffInDays($dt, $abs) / static::DAYS_PER_WEEK);
|
2595 |
-
}
|
2596 |
-
|
2597 |
-
/**
|
2598 |
-
* Get the difference in days
|
2599 |
-
*
|
2600 |
-
* @param \Carbon\Carbon|null $dt
|
2601 |
-
* @param bool $abs Get the absolute of the difference
|
2602 |
-
*
|
2603 |
-
* @return int
|
2604 |
-
*/
|
2605 |
-
public function diffInDays(Carbon $dt = null, $abs = true)
|
2606 |
-
{
|
2607 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
2608 |
-
|
2609 |
-
return (int) $this->diff($dt, $abs)->format('%r%a');
|
2610 |
-
}
|
2611 |
-
|
2612 |
-
/**
|
2613 |
-
* Get the difference in days using a filter closure
|
2614 |
-
*
|
2615 |
-
* @param Closure $callback
|
2616 |
-
* @param \Carbon\Carbon|null $dt
|
2617 |
-
* @param bool $abs Get the absolute of the difference
|
2618 |
-
*
|
2619 |
-
* @return int
|
2620 |
-
*/
|
2621 |
-
public function diffInDaysFiltered(Closure $callback, Carbon $dt = null, $abs = true)
|
2622 |
-
{
|
2623 |
-
return $this->diffFiltered(CarbonInterval::day(), $callback, $dt, $abs);
|
2624 |
-
}
|
2625 |
-
|
2626 |
-
/**
|
2627 |
-
* Get the difference in hours using a filter closure
|
2628 |
-
*
|
2629 |
-
* @param Closure $callback
|
2630 |
-
* @param \Carbon\Carbon|null $dt
|
2631 |
-
* @param bool $abs Get the absolute of the difference
|
2632 |
-
*
|
2633 |
-
* @return int
|
2634 |
-
*/
|
2635 |
-
public function diffInHoursFiltered(Closure $callback, Carbon $dt = null, $abs = true)
|
2636 |
-
{
|
2637 |
-
return $this->diffFiltered(CarbonInterval::hour(), $callback, $dt, $abs);
|
2638 |
-
}
|
2639 |
-
|
2640 |
-
/**
|
2641 |
-
* Get the difference by the given interval using a filter closure
|
2642 |
-
*
|
2643 |
-
* @param CarbonInterval $ci An interval to traverse by
|
2644 |
-
* @param Closure $callback
|
2645 |
-
* @param Carbon|null $dt
|
2646 |
-
* @param bool $abs Get the absolute of the difference
|
2647 |
-
*
|
2648 |
-
* @return int
|
2649 |
-
*/
|
2650 |
-
public function diffFiltered(CarbonInterval $ci, Closure $callback, Carbon $dt = null, $abs = true)
|
2651 |
-
{
|
2652 |
-
$start = $this;
|
2653 |
-
$end = $dt ?: static::now($this->getTimezone());
|
2654 |
-
$inverse = false;
|
2655 |
-
|
2656 |
-
if ($end < $start) {
|
2657 |
-
$start = $end;
|
2658 |
-
$end = $this;
|
2659 |
-
$inverse = true;
|
2660 |
-
}
|
2661 |
-
|
2662 |
-
$period = new DatePeriod($start, $ci, $end);
|
2663 |
-
$vals = array_filter(iterator_to_array($period), function (DateTime $date) use ($callback) {
|
2664 |
-
return call_user_func($callback, Carbon::instance($date));
|
2665 |
-
});
|
2666 |
-
|
2667 |
-
$diff = count($vals);
|
2668 |
-
|
2669 |
-
return $inverse && !$abs ? -$diff : $diff;
|
2670 |
-
}
|
2671 |
-
|
2672 |
-
/**
|
2673 |
-
* Get the difference in weekdays
|
2674 |
-
*
|
2675 |
-
* @param \Carbon\Carbon|null $dt
|
2676 |
-
* @param bool $abs Get the absolute of the difference
|
2677 |
-
*
|
2678 |
-
* @return int
|
2679 |
-
*/
|
2680 |
-
public function diffInWeekdays(Carbon $dt = null, $abs = true)
|
2681 |
-
{
|
2682 |
-
return $this->diffInDaysFiltered(function (Carbon $date) {
|
2683 |
-
return $date->isWeekday();
|
2684 |
-
}, $dt, $abs);
|
2685 |
-
}
|
2686 |
-
|
2687 |
-
/**
|
2688 |
-
* Get the difference in weekend days using a filter
|
2689 |
-
*
|
2690 |
-
* @param \Carbon\Carbon|null $dt
|
2691 |
-
* @param bool $abs Get the absolute of the difference
|
2692 |
-
*
|
2693 |
-
* @return int
|
2694 |
-
*/
|
2695 |
-
public function diffInWeekendDays(Carbon $dt = null, $abs = true)
|
2696 |
-
{
|
2697 |
-
return $this->diffInDaysFiltered(function (Carbon $date) {
|
2698 |
-
return $date->isWeekend();
|
2699 |
-
}, $dt, $abs);
|
2700 |
-
}
|
2701 |
-
|
2702 |
-
/**
|
2703 |
-
* Get the difference in hours
|
2704 |
-
*
|
2705 |
-
* @param \Carbon\Carbon|null $dt
|
2706 |
-
* @param bool $abs Get the absolute of the difference
|
2707 |
-
*
|
2708 |
-
* @return int
|
2709 |
-
*/
|
2710 |
-
public function diffInHours(Carbon $dt = null, $abs = true)
|
2711 |
-
{
|
2712 |
-
return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
|
2713 |
-
}
|
2714 |
-
|
2715 |
-
/**
|
2716 |
-
* Get the difference in minutes
|
2717 |
-
*
|
2718 |
-
* @param \Carbon\Carbon|null $dt
|
2719 |
-
* @param bool $abs Get the absolute of the difference
|
2720 |
-
*
|
2721 |
-
* @return int
|
2722 |
-
*/
|
2723 |
-
public function diffInMinutes(Carbon $dt = null, $abs = true)
|
2724 |
-
{
|
2725 |
-
return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE);
|
2726 |
-
}
|
2727 |
-
|
2728 |
-
/**
|
2729 |
-
* Get the difference in seconds
|
2730 |
-
*
|
2731 |
-
* @param \Carbon\Carbon|null $dt
|
2732 |
-
* @param bool $abs Get the absolute of the difference
|
2733 |
-
*
|
2734 |
-
* @return int
|
2735 |
-
*/
|
2736 |
-
public function diffInSeconds(Carbon $dt = null, $abs = true)
|
2737 |
-
{
|
2738 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
2739 |
-
$value = $dt->getTimestamp() - $this->getTimestamp();
|
2740 |
-
|
2741 |
-
return $abs ? abs($value) : $value;
|
2742 |
-
}
|
2743 |
-
|
2744 |
-
/**
|
2745 |
-
* The number of seconds since midnight.
|
2746 |
-
*
|
2747 |
-
* @return int
|
2748 |
-
*/
|
2749 |
-
public function secondsSinceMidnight()
|
2750 |
-
{
|
2751 |
-
return $this->diffInSeconds($this->copy()->startOfDay());
|
2752 |
-
}
|
2753 |
-
|
2754 |
-
/**
|
2755 |
-
* The number of seconds until 23:23:59.
|
2756 |
-
*
|
2757 |
-
* @return int
|
2758 |
-
*/
|
2759 |
-
public function secondsUntilEndOfDay()
|
2760 |
-
{
|
2761 |
-
return $this->diffInSeconds($this->copy()->endOfDay());
|
2762 |
-
}
|
2763 |
-
|
2764 |
-
/**
|
2765 |
-
* Get the difference in a human readable format in the current locale.
|
2766 |
-
*
|
2767 |
-
* When comparing a value in the past to default now:
|
2768 |
-
* 1 hour ago
|
2769 |
-
* 5 months ago
|
2770 |
-
*
|
2771 |
-
* When comparing a value in the future to default now:
|
2772 |
-
* 1 hour from now
|
2773 |
-
* 5 months from now
|
2774 |
-
*
|
2775 |
-
* When comparing a value in the past to another value:
|
2776 |
-
* 1 hour before
|
2777 |
-
* 5 months before
|
2778 |
-
*
|
2779 |
-
* When comparing a value in the future to another value:
|
2780 |
-
* 1 hour after
|
2781 |
-
* 5 months after
|
2782 |
-
*
|
2783 |
-
* @param Carbon|null $other
|
2784 |
-
* @param bool $absolute removes time difference modifiers ago, after, etc
|
2785 |
-
* @param bool $short displays short format of time units
|
2786 |
-
*
|
2787 |
-
* @return string
|
2788 |
-
*/
|
2789 |
-
public function diffForHumans(Carbon $other = null, $absolute = false, $short = false)
|
2790 |
-
{
|
2791 |
-
$isNow = $other === null;
|
2792 |
-
|
2793 |
-
if ($isNow) {
|
2794 |
-
$other = static::now($this->getTimezone());
|
2795 |
-
}
|
2796 |
-
|
2797 |
-
$diffInterval = $this->diff($other);
|
2798 |
-
|
2799 |
-
switch (true) {
|
2800 |
-
case $diffInterval->y > 0:
|
2801 |
-
$unit = $short ? 'y' : 'year';
|
2802 |
-
$count = $diffInterval->y;
|
2803 |
-
break;
|
2804 |
-
|
2805 |
-
case $diffInterval->m > 0:
|
2806 |
-
$unit = $short ? 'm' : 'month';
|
2807 |
-
$count = $diffInterval->m;
|
2808 |
-
break;
|
2809 |
-
|
2810 |
-
case $diffInterval->d > 0:
|
2811 |
-
$unit = $short ? 'd' : 'day';
|
2812 |
-
$count = $diffInterval->d;
|
2813 |
-
|
2814 |
-
if ($count >= static::DAYS_PER_WEEK) {
|
2815 |
-
$unit = $short ? 'w' : 'week';
|
2816 |
-
$count = (int) ($count / static::DAYS_PER_WEEK);
|
2817 |
-
}
|
2818 |
-
break;
|
2819 |
-
|
2820 |
-
case $diffInterval->h > 0:
|
2821 |
-
$unit = $short ? 'h' : 'hour';
|
2822 |
-
$count = $diffInterval->h;
|
2823 |
-
break;
|
2824 |
-
|
2825 |
-
case $diffInterval->i > 0:
|
2826 |
-
$unit = $short ? 'min' : 'minute';
|
2827 |
-
$count = $diffInterval->i;
|
2828 |
-
break;
|
2829 |
-
|
2830 |
-
default:
|
2831 |
-
$count = $diffInterval->s;
|
2832 |
-
$unit = $short ? 's' : 'second';
|
2833 |
-
break;
|
2834 |
-
}
|
2835 |
-
|
2836 |
-
if ($count === 0) {
|
2837 |
-
$count = 1;
|
2838 |
-
}
|
2839 |
-
|
2840 |
-
$time = static::translator()->transChoice($unit, $count, array(':count' => $count));
|
2841 |
-
|
2842 |
-
if ($absolute) {
|
2843 |
-
return $time;
|
2844 |
-
}
|
2845 |
-
|
2846 |
-
$isFuture = $diffInterval->invert === 1;
|
2847 |
-
|
2848 |
-
$transId = $isNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before');
|
2849 |
-
|
2850 |
-
// Some langs have special pluralization for past and future tense.
|
2851 |
-
$tryKeyExists = $unit.'_'.$transId;
|
2852 |
-
if ($tryKeyExists !== static::translator()->transChoice($tryKeyExists, $count)) {
|
2853 |
-
$time = static::translator()->transChoice($tryKeyExists, $count, array(':count' => $count));
|
2854 |
-
}
|
2855 |
-
|
2856 |
-
return static::translator()->trans($transId, array(':time' => $time));
|
2857 |
-
}
|
2858 |
-
|
2859 |
-
///////////////////////////////////////////////////////////////////
|
2860 |
-
//////////////////////////// MODIFIERS ////////////////////////////
|
2861 |
-
///////////////////////////////////////////////////////////////////
|
2862 |
-
|
2863 |
-
/**
|
2864 |
-
* Resets the time to 00:00:00
|
2865 |
-
*
|
2866 |
-
* @return static
|
2867 |
-
*/
|
2868 |
-
public function startOfDay()
|
2869 |
-
{
|
2870 |
-
return $this->setTime(0, 0, 0);
|
2871 |
-
}
|
2872 |
-
|
2873 |
-
/**
|
2874 |
-
* Resets the time to 23:59:59
|
2875 |
-
*
|
2876 |
-
* @return static
|
2877 |
-
*/
|
2878 |
-
public function endOfDay()
|
2879 |
-
{
|
2880 |
-
return $this->setTime(23, 59, 59);
|
2881 |
-
}
|
2882 |
-
|
2883 |
-
/**
|
2884 |
-
* Resets the date to the first day of the month and the time to 00:00:00
|
2885 |
-
*
|
2886 |
-
* @return static
|
2887 |
-
*/
|
2888 |
-
public function startOfMonth()
|
2889 |
-
{
|
2890 |
-
return $this->setDateTime($this->year, $this->month, 1, 0, 0, 0);
|
2891 |
-
}
|
2892 |
-
|
2893 |
-
/**
|
2894 |
-
* Resets the date to end of the month and time to 23:59:59
|
2895 |
-
*
|
2896 |
-
* @return static
|
2897 |
-
*/
|
2898 |
-
public function endOfMonth()
|
2899 |
-
{
|
2900 |
-
return $this->setDateTime($this->year, $this->month, $this->daysInMonth, 23, 59, 59);
|
2901 |
-
}
|
2902 |
-
|
2903 |
-
/**
|
2904 |
-
* Resets the date to the first day of the quarter and the time to 00:00:00
|
2905 |
-
*
|
2906 |
-
* @return static
|
2907 |
-
*/
|
2908 |
-
public function startOfQuarter()
|
2909 |
-
{
|
2910 |
-
$month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1;
|
2911 |
-
|
2912 |
-
return $this->setDateTime($this->year, $month, 1, 0, 0, 0);
|
2913 |
-
}
|
2914 |
-
|
2915 |
-
/**
|
2916 |
-
* Resets the date to end of the quarter and time to 23:59:59
|
2917 |
-
*
|
2918 |
-
* @return static
|
2919 |
-
*/
|
2920 |
-
public function endOfQuarter()
|
2921 |
-
{
|
2922 |
-
return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth();
|
2923 |
-
}
|
2924 |
-
|
2925 |
-
/**
|
2926 |
-
* Resets the date to the first day of the year and the time to 00:00:00
|
2927 |
-
*
|
2928 |
-
* @return static
|
2929 |
-
*/
|
2930 |
-
public function startOfYear()
|
2931 |
-
{
|
2932 |
-
return $this->setDateTime($this->year, 1, 1, 0, 0, 0);
|
2933 |
-
}
|
2934 |
-
|
2935 |
-
/**
|
2936 |
-
* Resets the date to end of the year and time to 23:59:59
|
2937 |
-
*
|
2938 |
-
* @return static
|
2939 |
-
*/
|
2940 |
-
public function endOfYear()
|
2941 |
-
{
|
2942 |
-
return $this->setDateTime($this->year, 12, 31, 23, 59, 59);
|
2943 |
-
}
|
2944 |
-
|
2945 |
-
/**
|
2946 |
-
* Resets the date to the first day of the decade and the time to 00:00:00
|
2947 |
-
*
|
2948 |
-
* @return static
|
2949 |
-
*/
|
2950 |
-
public function startOfDecade()
|
2951 |
-
{
|
2952 |
-
$year = $this->year - $this->year % static::YEARS_PER_DECADE;
|
2953 |
-
|
2954 |
-
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2955 |
-
}
|
2956 |
-
|
2957 |
-
/**
|
2958 |
-
* Resets the date to end of the decade and time to 23:59:59
|
2959 |
-
*
|
2960 |
-
* @return static
|
2961 |
-
*/
|
2962 |
-
public function endOfDecade()
|
2963 |
-
{
|
2964 |
-
$year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1;
|
2965 |
-
|
2966 |
-
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2967 |
-
}
|
2968 |
-
|
2969 |
-
/**
|
2970 |
-
* Resets the date to the first day of the century and the time to 00:00:00
|
2971 |
-
*
|
2972 |
-
* @return static
|
2973 |
-
*/
|
2974 |
-
public function startOfCentury()
|
2975 |
-
{
|
2976 |
-
$year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY;
|
2977 |
-
|
2978 |
-
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2979 |
-
}
|
2980 |
-
|
2981 |
-
/**
|
2982 |
-
* Resets the date to end of the century and time to 23:59:59
|
2983 |
-
*
|
2984 |
-
* @return static
|
2985 |
-
*/
|
2986 |
-
public function endOfCentury()
|
2987 |
-
{
|
2988 |
-
$year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY;
|
2989 |
-
|
2990 |
-
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2991 |
-
}
|
2992 |
-
|
2993 |
-
/**
|
2994 |
-
* Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
|
2995 |
-
*
|
2996 |
-
* @return static
|
2997 |
-
*/
|
2998 |
-
public function startOfWeek()
|
2999 |
-
{
|
3000 |
-
while ($this->dayOfWeek !== static::$weekStartsAt) {
|
3001 |
-
$this->subDay();
|
3002 |
-
}
|
3003 |
-
|
3004 |
-
return $this->startOfDay();
|
3005 |
-
}
|
3006 |
-
|
3007 |
-
/**
|
3008 |
-
* Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59
|
3009 |
-
*
|
3010 |
-
* @return static
|
3011 |
-
*/
|
3012 |
-
public function endOfWeek()
|
3013 |
-
{
|
3014 |
-
while ($this->dayOfWeek !== static::$weekEndsAt) {
|
3015 |
-
$this->addDay();
|
3016 |
-
}
|
3017 |
-
|
3018 |
-
return $this->endOfDay();
|
3019 |
-
}
|
3020 |
-
|
3021 |
-
/**
|
3022 |
-
* Modify to the next occurrence of a given day of the week.
|
3023 |
-
* If no dayOfWeek is provided, modify to the next occurrence
|
3024 |
-
* of the current day of the week. Use the supplied constants
|
3025 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3026 |
-
*
|
3027 |
-
* @param int|null $dayOfWeek
|
3028 |
-
*
|
3029 |
-
* @return static
|
3030 |
-
*/
|
3031 |
-
public function next($dayOfWeek = null)
|
3032 |
-
{
|
3033 |
-
if ($dayOfWeek === null) {
|
3034 |
-
$dayOfWeek = $this->dayOfWeek;
|
3035 |
-
}
|
3036 |
-
|
3037 |
-
return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
|
3038 |
-
}
|
3039 |
-
|
3040 |
-
/**
|
3041 |
-
* Go forward or backward to the next week- or weekend-day.
|
3042 |
-
*
|
3043 |
-
* @param bool $weekday
|
3044 |
-
* @param bool $forward
|
3045 |
-
*
|
3046 |
-
* @return static
|
3047 |
-
*/
|
3048 |
-
private function nextOrPreviousDay($weekday = true, $forward = true)
|
3049 |
-
{
|
3050 |
-
$step = $forward ? 1 : -1;
|
3051 |
-
|
3052 |
-
do {
|
3053 |
-
$this->addDay($step);
|
3054 |
-
} while ($weekday ? $this->isWeekend() : $this->isWeekday());
|
3055 |
-
|
3056 |
-
return $this;
|
3057 |
-
}
|
3058 |
-
|
3059 |
-
/**
|
3060 |
-
* Go forward to the next weekday.
|
3061 |
-
*
|
3062 |
-
* @return $this
|
3063 |
-
*/
|
3064 |
-
public function nextWeekday()
|
3065 |
-
{
|
3066 |
-
return $this->nextOrPreviousDay();
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
/**
|
3070 |
-
* Go backward to the previous weekday.
|
3071 |
-
*
|
3072 |
-
* @return static
|
3073 |
-
*/
|
3074 |
-
public function previousWeekday()
|
3075 |
-
{
|
3076 |
-
return $this->nextOrPreviousDay(true, false);
|
3077 |
-
}
|
3078 |
-
|
3079 |
-
/**
|
3080 |
-
* Go forward to the next weekend day.
|
3081 |
-
*
|
3082 |
-
* @return static
|
3083 |
-
*/
|
3084 |
-
public function nextWeekendDay()
|
3085 |
-
{
|
3086 |
-
return $this->nextOrPreviousDay(false);
|
3087 |
-
}
|
3088 |
-
|
3089 |
-
/**
|
3090 |
-
* Go backward to the previous weekend day.
|
3091 |
-
*
|
3092 |
-
* @return static
|
3093 |
-
*/
|
3094 |
-
public function previousWeekendDay()
|
3095 |
-
{
|
3096 |
-
return $this->nextOrPreviousDay(false, false);
|
3097 |
-
}
|
3098 |
-
|
3099 |
-
/**
|
3100 |
-
* Modify to the previous occurrence of a given day of the week.
|
3101 |
-
* If no dayOfWeek is provided, modify to the previous occurrence
|
3102 |
-
* of the current day of the week. Use the supplied constants
|
3103 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3104 |
-
*
|
3105 |
-
* @param int|null $dayOfWeek
|
3106 |
-
*
|
3107 |
-
* @return static
|
3108 |
-
*/
|
3109 |
-
public function previous($dayOfWeek = null)
|
3110 |
-
{
|
3111 |
-
if ($dayOfWeek === null) {
|
3112 |
-
$dayOfWeek = $this->dayOfWeek;
|
3113 |
-
}
|
3114 |
-
|
3115 |
-
return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]);
|
3116 |
-
}
|
3117 |
-
|
3118 |
-
/**
|
3119 |
-
* Modify to the first occurrence of a given day of the week
|
3120 |
-
* in the current month. If no dayOfWeek is provided, modify to the
|
3121 |
-
* first day of the current month. Use the supplied constants
|
3122 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3123 |
-
*
|
3124 |
-
* @param int|null $dayOfWeek
|
3125 |
-
*
|
3126 |
-
* @return static
|
3127 |
-
*/
|
3128 |
-
public function firstOfMonth($dayOfWeek = null)
|
3129 |
-
{
|
3130 |
-
$this->startOfDay();
|
3131 |
-
|
3132 |
-
if ($dayOfWeek === null) {
|
3133 |
-
return $this->day(1);
|
3134 |
-
}
|
3135 |
-
|
3136 |
-
return $this->modify('first '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year);
|
3137 |
-
}
|
3138 |
-
|
3139 |
-
/**
|
3140 |
-
* Modify to the last occurrence of a given day of the week
|
3141 |
-
* in the current month. If no dayOfWeek is provided, modify to the
|
3142 |
-
* last day of the current month. Use the supplied constants
|
3143 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3144 |
-
*
|
3145 |
-
* @param int|null $dayOfWeek
|
3146 |
-
*
|
3147 |
-
* @return static
|
3148 |
-
*/
|
3149 |
-
public function lastOfMonth($dayOfWeek = null)
|
3150 |
-
{
|
3151 |
-
$this->startOfDay();
|
3152 |
-
|
3153 |
-
if ($dayOfWeek === null) {
|
3154 |
-
return $this->day($this->daysInMonth);
|
3155 |
-
}
|
3156 |
-
|
3157 |
-
return $this->modify('last '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year);
|
3158 |
-
}
|
3159 |
-
|
3160 |
-
/**
|
3161 |
-
* Modify to the given occurrence of a given day of the week
|
3162 |
-
* in the current month. If the calculated occurrence is outside the scope
|
3163 |
-
* of the current month, then return false and no modifications are made.
|
3164 |
-
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3165 |
-
*
|
3166 |
-
* @param int $nth
|
3167 |
-
* @param int $dayOfWeek
|
3168 |
-
*
|
3169 |
-
* @return mixed
|
3170 |
-
*/
|
3171 |
-
public function nthOfMonth($nth, $dayOfWeek)
|
3172 |
-
{
|
3173 |
-
$dt = $this->copy()->firstOfMonth();
|
3174 |
-
$check = $dt->format('Y-m');
|
3175 |
-
$dt->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3176 |
-
|
3177 |
-
return $dt->format('Y-m') === $check ? $this->modify($dt) : false;
|
3178 |
-
}
|
3179 |
-
|
3180 |
-
/**
|
3181 |
-
* Modify to the first occurrence of a given day of the week
|
3182 |
-
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3183 |
-
* first day of the current quarter. Use the supplied constants
|
3184 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3185 |
-
*
|
3186 |
-
* @param int|null $dayOfWeek
|
3187 |
-
*
|
3188 |
-
* @return static
|
3189 |
-
*/
|
3190 |
-
public function firstOfQuarter($dayOfWeek = null)
|
3191 |
-
{
|
3192 |
-
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek);
|
3193 |
-
}
|
3194 |
-
|
3195 |
-
/**
|
3196 |
-
* Modify to the last occurrence of a given day of the week
|
3197 |
-
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3198 |
-
* last day of the current quarter. Use the supplied constants
|
3199 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3200 |
-
*
|
3201 |
-
* @param int|null $dayOfWeek
|
3202 |
-
*
|
3203 |
-
* @return static
|
3204 |
-
*/
|
3205 |
-
public function lastOfQuarter($dayOfWeek = null)
|
3206 |
-
{
|
3207 |
-
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek);
|
3208 |
-
}
|
3209 |
-
|
3210 |
-
/**
|
3211 |
-
* Modify to the given occurrence of a given day of the week
|
3212 |
-
* in the current quarter. If the calculated occurrence is outside the scope
|
3213 |
-
* of the current quarter, then return false and no modifications are made.
|
3214 |
-
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3215 |
-
*
|
3216 |
-
* @param int $nth
|
3217 |
-
* @param int $dayOfWeek
|
3218 |
-
*
|
3219 |
-
* @return mixed
|
3220 |
-
*/
|
3221 |
-
public function nthOfQuarter($nth, $dayOfWeek)
|
3222 |
-
{
|
3223 |
-
$dt = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER);
|
3224 |
-
$lastMonth = $dt->month;
|
3225 |
-
$year = $dt->year;
|
3226 |
-
$dt->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3227 |
-
|
3228 |
-
return ($lastMonth < $dt->month || $year !== $dt->year) ? false : $this->modify($dt);
|
3229 |
-
}
|
3230 |
-
|
3231 |
-
/**
|
3232 |
-
* Modify to the first occurrence of a given day of the week
|
3233 |
-
* in the current year. If no dayOfWeek is provided, modify to the
|
3234 |
-
* first day of the current year. Use the supplied constants
|
3235 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3236 |
-
*
|
3237 |
-
* @param int|null $dayOfWeek
|
3238 |
-
*
|
3239 |
-
* @return static
|
3240 |
-
*/
|
3241 |
-
public function firstOfYear($dayOfWeek = null)
|
3242 |
-
{
|
3243 |
-
return $this->month(1)->firstOfMonth($dayOfWeek);
|
3244 |
-
}
|
3245 |
-
|
3246 |
-
/**
|
3247 |
-
* Modify to the last occurrence of a given day of the week
|
3248 |
-
* in the current year. If no dayOfWeek is provided, modify to the
|
3249 |
-
* last day of the current year. Use the supplied constants
|
3250 |
-
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3251 |
-
*
|
3252 |
-
* @param int|null $dayOfWeek
|
3253 |
-
*
|
3254 |
-
* @return static
|
3255 |
-
*/
|
3256 |
-
public function lastOfYear($dayOfWeek = null)
|
3257 |
-
{
|
3258 |
-
return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek);
|
3259 |
-
}
|
3260 |
-
|
3261 |
-
/**
|
3262 |
-
* Modify to the given occurrence of a given day of the week
|
3263 |
-
* in the current year. If the calculated occurrence is outside the scope
|
3264 |
-
* of the current year, then return false and no modifications are made.
|
3265 |
-
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3266 |
-
*
|
3267 |
-
* @param int $nth
|
3268 |
-
* @param int $dayOfWeek
|
3269 |
-
*
|
3270 |
-
* @return mixed
|
3271 |
-
*/
|
3272 |
-
public function nthOfYear($nth, $dayOfWeek)
|
3273 |
-
{
|
3274 |
-
$dt = $this->copy()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3275 |
-
|
3276 |
-
return $this->year === $dt->year ? $this->modify($dt) : false;
|
3277 |
-
}
|
3278 |
-
|
3279 |
-
/**
|
3280 |
-
* Modify the current instance to the average of a given instance (default now) and the current instance.
|
3281 |
-
*
|
3282 |
-
* @param \Carbon\Carbon|null $dt
|
3283 |
-
*
|
3284 |
-
* @return static
|
3285 |
-
*/
|
3286 |
-
public function average(Carbon $dt = null)
|
3287 |
-
{
|
3288 |
-
$dt = $dt ?: static::now($this->getTimezone());
|
3289 |
-
|
3290 |
-
return $this->addSeconds((int) ($this->diffInSeconds($dt, false) / 2));
|
3291 |
-
}
|
3292 |
-
|
3293 |
-
/**
|
3294 |
-
* Check if its the birthday. Compares the date/month values of the two dates.
|
3295 |
-
*
|
3296 |
-
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
3297 |
-
*
|
3298 |
-
* @return bool
|
3299 |
-
*/
|
3300 |
-
public function isBirthday(Carbon $dt = null)
|
3301 |
-
{
|
3302 |
-
return $this->isSameAs('md', $dt);
|
3303 |
-
}
|
3304 |
-
|
3305 |
-
/**
|
3306 |
-
* Consider the timezone when modifying the instance.
|
3307 |
-
*
|
3308 |
-
* @param string $modify
|
3309 |
-
*
|
3310 |
-
* @return static
|
3311 |
-
*/
|
3312 |
-
public function modify($modify)
|
3313 |
-
{
|
3314 |
-
if ($this->local) {
|
3315 |
-
return parent::modify($modify);
|
3316 |
-
}
|
3317 |
-
|
3318 |
-
$timezone = $this->getTimezone();
|
3319 |
-
$this->setTimezone('UTC');
|
3320 |
-
$instance = parent::modify($modify);
|
3321 |
-
$this->setTimezone($timezone);
|
3322 |
-
|
3323 |
-
return $instance;
|
3324 |
-
}
|
3325 |
-
|
3326 |
-
/**
|
3327 |
-
* Return a serialized string of the instance.
|
3328 |
-
*
|
3329 |
-
* @return string
|
3330 |
-
*/
|
3331 |
-
public function serialize()
|
3332 |
-
{
|
3333 |
-
return serialize($this);
|
3334 |
-
}
|
3335 |
-
|
3336 |
-
/**
|
3337 |
-
* Create an instance form a serialized string.
|
3338 |
-
*
|
3339 |
-
* @param string $value
|
3340 |
-
*
|
3341 |
-
* @throws \InvalidArgumentException
|
3342 |
-
*
|
3343 |
-
* @return static
|
3344 |
-
*/
|
3345 |
-
public static function fromSerialized($value)
|
3346 |
-
{
|
3347 |
-
$instance = @unserialize($value);
|
3348 |
-
|
3349 |
-
if (!$instance instanceof static) {
|
3350 |
-
throw new InvalidArgumentException('Invalid serialized value.');
|
3351 |
-
}
|
3352 |
-
|
3353 |
-
return $instance;
|
3354 |
-
}
|
3355 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Carbon;
|
13 |
+
|
14 |
+
use Carbon\Exceptions\InvalidDateException;
|
15 |
+
use Closure;
|
16 |
+
use DatePeriod;
|
17 |
+
use DateTime;
|
18 |
+
use DateTimeZone;
|
19 |
+
use InvalidArgumentException;
|
20 |
+
use Symfony\Component\Translation\Loader\ArrayLoader;
|
21 |
+
use Symfony\Component\Translation\Translator;
|
22 |
+
use Symfony\Component\Translation\TranslatorInterface;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* A simple API extension for DateTime
|
26 |
+
*
|
27 |
+
* @property int $year
|
28 |
+
* @property int $yearIso
|
29 |
+
* @property int $month
|
30 |
+
* @property int $day
|
31 |
+
* @property int $hour
|
32 |
+
* @property int $minute
|
33 |
+
* @property int $second
|
34 |
+
* @property int $timestamp seconds since the Unix Epoch
|
35 |
+
* @property \DateTimeZone $timezone the current timezone
|
36 |
+
* @property \DateTimeZone $tz alias of timezone
|
37 |
+
* @property-read int $micro
|
38 |
+
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
39 |
+
* @property-read int $dayOfYear 0 through 365
|
40 |
+
* @property-read int $weekOfMonth 1 through 5
|
41 |
+
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
42 |
+
* @property-read int $daysInMonth number of days in the given month
|
43 |
+
* @property-read int $age does a diffInYears() with default parameters
|
44 |
+
* @property-read int $quarter the quarter of this instance, 1 - 4
|
45 |
+
* @property-read int $offset the timezone offset in seconds from UTC
|
46 |
+
* @property-read int $offsetHours the timezone offset in hours from UTC
|
47 |
+
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
48 |
+
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
49 |
+
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
50 |
+
* @property-read string $timezoneName
|
51 |
+
* @property-read string $tzName
|
52 |
+
*/
|
53 |
+
class Carbon extends DateTime
|
54 |
+
{
|
55 |
+
/**
|
56 |
+
* The day constants.
|
57 |
+
*/
|
58 |
+
const SUNDAY = 0;
|
59 |
+
const MONDAY = 1;
|
60 |
+
const TUESDAY = 2;
|
61 |
+
const WEDNESDAY = 3;
|
62 |
+
const THURSDAY = 4;
|
63 |
+
const FRIDAY = 5;
|
64 |
+
const SATURDAY = 6;
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Names of days of the week.
|
68 |
+
*
|
69 |
+
* @var array
|
70 |
+
*/
|
71 |
+
protected static $days = array(
|
72 |
+
self::SUNDAY => 'Sunday',
|
73 |
+
self::MONDAY => 'Monday',
|
74 |
+
self::TUESDAY => 'Tuesday',
|
75 |
+
self::WEDNESDAY => 'Wednesday',
|
76 |
+
self::THURSDAY => 'Thursday',
|
77 |
+
self::FRIDAY => 'Friday',
|
78 |
+
self::SATURDAY => 'Saturday',
|
79 |
+
);
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Terms used to detect if a time passed is a relative date.
|
83 |
+
*
|
84 |
+
* This is here for testing purposes.
|
85 |
+
*
|
86 |
+
* @var array
|
87 |
+
*/
|
88 |
+
protected static $relativeKeywords = array(
|
89 |
+
'+',
|
90 |
+
'-',
|
91 |
+
'ago',
|
92 |
+
'first',
|
93 |
+
'last',
|
94 |
+
'next',
|
95 |
+
'this',
|
96 |
+
'today',
|
97 |
+
'tomorrow',
|
98 |
+
'yesterday',
|
99 |
+
);
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Number of X in Y.
|
103 |
+
*/
|
104 |
+
const YEARS_PER_CENTURY = 100;
|
105 |
+
const YEARS_PER_DECADE = 10;
|
106 |
+
const MONTHS_PER_YEAR = 12;
|
107 |
+
const MONTHS_PER_QUARTER = 3;
|
108 |
+
const WEEKS_PER_YEAR = 52;
|
109 |
+
const DAYS_PER_WEEK = 7;
|
110 |
+
const HOURS_PER_DAY = 24;
|
111 |
+
const MINUTES_PER_HOUR = 60;
|
112 |
+
const SECONDS_PER_MINUTE = 60;
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Default format to use for __toString method when type juggling occurs.
|
116 |
+
*
|
117 |
+
* @var string
|
118 |
+
*/
|
119 |
+
const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s';
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Format to use for __toString method when type juggling occurs.
|
123 |
+
*
|
124 |
+
* @var string
|
125 |
+
*/
|
126 |
+
protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT;
|
127 |
+
|
128 |
+
/**
|
129 |
+
* First day of week.
|
130 |
+
*
|
131 |
+
* @var int
|
132 |
+
*/
|
133 |
+
protected static $weekStartsAt = self::MONDAY;
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Last day of week.
|
137 |
+
*
|
138 |
+
* @var int
|
139 |
+
*/
|
140 |
+
protected static $weekEndsAt = self::SUNDAY;
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Days of weekend.
|
144 |
+
*
|
145 |
+
* @var array
|
146 |
+
*/
|
147 |
+
protected static $weekendDays = array(
|
148 |
+
self::SATURDAY,
|
149 |
+
self::SUNDAY,
|
150 |
+
);
|
151 |
+
|
152 |
+
/**
|
153 |
+
* A test Carbon instance to be returned when now instances are created.
|
154 |
+
*
|
155 |
+
* @var \Carbon\Carbon
|
156 |
+
*/
|
157 |
+
protected static $testNow;
|
158 |
+
|
159 |
+
/**
|
160 |
+
* A translator to ... er ... translate stuff.
|
161 |
+
*
|
162 |
+
* @var \Symfony\Component\Translation\TranslatorInterface
|
163 |
+
*/
|
164 |
+
protected static $translator;
|
165 |
+
|
166 |
+
/**
|
167 |
+
* The errors that can occur.
|
168 |
+
*
|
169 |
+
* @var array
|
170 |
+
*/
|
171 |
+
protected static $lastErrors;
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Will UTF8 encoding be used to print localized date/time ?
|
175 |
+
*
|
176 |
+
* @var bool
|
177 |
+
*/
|
178 |
+
protected static $utf8 = false;
|
179 |
+
|
180 |
+
/*
|
181 |
+
* Indicates if months should be calculated with overflow.
|
182 |
+
*
|
183 |
+
* @var bool
|
184 |
+
*/
|
185 |
+
protected static $monthsOverflow = true;
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Indicates if months should be calculated with overflow.
|
189 |
+
*
|
190 |
+
* @param bool $monthsOverflow
|
191 |
+
*
|
192 |
+
* @return void
|
193 |
+
*/
|
194 |
+
public static function useMonthsOverflow($monthsOverflow = true)
|
195 |
+
{
|
196 |
+
static::$monthsOverflow = $monthsOverflow;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Reset the month overflow behavior.
|
201 |
+
*
|
202 |
+
* @return void
|
203 |
+
*/
|
204 |
+
public static function resetMonthsOverflow()
|
205 |
+
{
|
206 |
+
static::$monthsOverflow = true;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Get the month overflow behavior.
|
211 |
+
*
|
212 |
+
* @return bool
|
213 |
+
*/
|
214 |
+
public static function shouldOverflowMonths()
|
215 |
+
{
|
216 |
+
return static::$monthsOverflow;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Creates a DateTimeZone from a string, DateTimeZone or integer offset.
|
221 |
+
*
|
222 |
+
* @param \DateTimeZone|string|int|null $object
|
223 |
+
*
|
224 |
+
* @throws \InvalidArgumentException
|
225 |
+
*
|
226 |
+
* @return \DateTimeZone
|
227 |
+
*/
|
228 |
+
protected static function safeCreateDateTimeZone($object)
|
229 |
+
{
|
230 |
+
if ($object === null) {
|
231 |
+
// Don't return null... avoid Bug #52063 in PHP <5.3.6
|
232 |
+
return new DateTimeZone(date_default_timezone_get());
|
233 |
+
}
|
234 |
+
|
235 |
+
if ($object instanceof DateTimeZone) {
|
236 |
+
return $object;
|
237 |
+
}
|
238 |
+
|
239 |
+
if (is_numeric($object)) {
|
240 |
+
$tzName = timezone_name_from_abbr(null, $object * 3600, true);
|
241 |
+
|
242 |
+
if ($tzName === false) {
|
243 |
+
throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')');
|
244 |
+
}
|
245 |
+
|
246 |
+
$object = $tzName;
|
247 |
+
}
|
248 |
+
|
249 |
+
$tz = @timezone_open((string) $object);
|
250 |
+
|
251 |
+
if ($tz === false) {
|
252 |
+
throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')');
|
253 |
+
}
|
254 |
+
|
255 |
+
return $tz;
|
256 |
+
}
|
257 |
+
|
258 |
+
///////////////////////////////////////////////////////////////////
|
259 |
+
//////////////////////////// CONSTRUCTORS /////////////////////////
|
260 |
+
///////////////////////////////////////////////////////////////////
|
261 |
+
|
262 |
+
/**
|
263 |
+
* Create a new Carbon instance.
|
264 |
+
*
|
265 |
+
* Please see the testing aids section (specifically static::setTestNow())
|
266 |
+
* for more on the possibility of this constructor returning a test instance.
|
267 |
+
*
|
268 |
+
* @param string|null $time
|
269 |
+
* @param \DateTimeZone|string|null $tz
|
270 |
+
*/
|
271 |
+
public function __construct($time = null, $tz = null)
|
272 |
+
{
|
273 |
+
// If the class has a test now set and we are trying to create a now()
|
274 |
+
// instance then override as required
|
275 |
+
if (static::hasTestNow() && (empty($time) || $time === 'now' || static::hasRelativeKeywords($time))) {
|
276 |
+
$testInstance = clone static::getTestNow();
|
277 |
+
if (static::hasRelativeKeywords($time)) {
|
278 |
+
$testInstance->modify($time);
|
279 |
+
}
|
280 |
+
|
281 |
+
//shift the time according to the given time zone
|
282 |
+
if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) {
|
283 |
+
$testInstance->setTimezone($tz);
|
284 |
+
} else {
|
285 |
+
$tz = $testInstance->getTimezone();
|
286 |
+
}
|
287 |
+
|
288 |
+
$time = $testInstance->toDateTimeString();
|
289 |
+
}
|
290 |
+
|
291 |
+
parent::__construct($time, static::safeCreateDateTimeZone($tz));
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Create a Carbon instance from a DateTime one.
|
296 |
+
*
|
297 |
+
* @param \DateTime $dt
|
298 |
+
*
|
299 |
+
* @return static
|
300 |
+
*/
|
301 |
+
public static function instance(DateTime $dt)
|
302 |
+
{
|
303 |
+
if ($dt instanceof static) {
|
304 |
+
return clone $dt;
|
305 |
+
}
|
306 |
+
|
307 |
+
return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimezone());
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* Create a carbon instance from a string.
|
312 |
+
*
|
313 |
+
* This is an alias for the constructor that allows better fluent syntax
|
314 |
+
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
|
315 |
+
* than (new Carbon('Monday next week'))->fn().
|
316 |
+
*
|
317 |
+
* @param string|null $time
|
318 |
+
* @param \DateTimeZone|string|null $tz
|
319 |
+
*
|
320 |
+
* @return static
|
321 |
+
*/
|
322 |
+
public static function parse($time = null, $tz = null)
|
323 |
+
{
|
324 |
+
return new static($time, $tz);
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Get a Carbon instance for the current date and time.
|
329 |
+
*
|
330 |
+
* @param \DateTimeZone|string|null $tz
|
331 |
+
*
|
332 |
+
* @return static
|
333 |
+
*/
|
334 |
+
public static function now($tz = null)
|
335 |
+
{
|
336 |
+
return new static(null, $tz);
|
337 |
+
}
|
338 |
+
|
339 |
+
/**
|
340 |
+
* Create a Carbon instance for today.
|
341 |
+
*
|
342 |
+
* @param \DateTimeZone|string|null $tz
|
343 |
+
*
|
344 |
+
* @return static
|
345 |
+
*/
|
346 |
+
public static function today($tz = null)
|
347 |
+
{
|
348 |
+
return static::now($tz)->startOfDay();
|
349 |
+
}
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Create a Carbon instance for tomorrow.
|
353 |
+
*
|
354 |
+
* @param \DateTimeZone|string|null $tz
|
355 |
+
*
|
356 |
+
* @return static
|
357 |
+
*/
|
358 |
+
public static function tomorrow($tz = null)
|
359 |
+
{
|
360 |
+
return static::today($tz)->addDay();
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Create a Carbon instance for yesterday.
|
365 |
+
*
|
366 |
+
* @param \DateTimeZone|string|null $tz
|
367 |
+
*
|
368 |
+
* @return static
|
369 |
+
*/
|
370 |
+
public static function yesterday($tz = null)
|
371 |
+
{
|
372 |
+
return static::today($tz)->subDay();
|
373 |
+
}
|
374 |
+
|
375 |
+
/**
|
376 |
+
* Create a Carbon instance for the greatest supported date.
|
377 |
+
*
|
378 |
+
* @return static
|
379 |
+
*/
|
380 |
+
public static function maxValue()
|
381 |
+
{
|
382 |
+
if (PHP_INT_SIZE === 4) {
|
383 |
+
// 32 bit (and additionally Windows 64 bit)
|
384 |
+
return static::createFromTimestamp(PHP_INT_MAX);
|
385 |
+
}
|
386 |
+
|
387 |
+
// 64 bit
|
388 |
+
return static::create(9999, 12, 31, 23, 59, 59);
|
389 |
+
}
|
390 |
+
|
391 |
+
/**
|
392 |
+
* Create a Carbon instance for the lowest supported date.
|
393 |
+
*
|
394 |
+
* @return static
|
395 |
+
*/
|
396 |
+
public static function minValue()
|
397 |
+
{
|
398 |
+
if (PHP_INT_SIZE === 4) {
|
399 |
+
// 32 bit (and additionally Windows 64 bit)
|
400 |
+
return static::createFromTimestamp(~PHP_INT_MAX);
|
401 |
+
}
|
402 |
+
|
403 |
+
// 64 bit
|
404 |
+
return static::create(1, 1, 1, 0, 0, 0);
|
405 |
+
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Create a new Carbon instance from a specific date and time.
|
409 |
+
*
|
410 |
+
* If any of $year, $month or $day are set to null their now() values will
|
411 |
+
* be used.
|
412 |
+
*
|
413 |
+
* If $hour is null it will be set to its now() value and the default
|
414 |
+
* values for $minute and $second will be their now() values.
|
415 |
+
*
|
416 |
+
* If $hour is not null then the default values for $minute and $second
|
417 |
+
* will be 0.
|
418 |
+
*
|
419 |
+
* @param int|null $year
|
420 |
+
* @param int|null $month
|
421 |
+
* @param int|null $day
|
422 |
+
* @param int|null $hour
|
423 |
+
* @param int|null $minute
|
424 |
+
* @param int|null $second
|
425 |
+
* @param \DateTimeZone|string|null $tz
|
426 |
+
*
|
427 |
+
* @return static
|
428 |
+
*/
|
429 |
+
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
430 |
+
{
|
431 |
+
$now = static::hasTestNow() ? static::getTestNow()->getTimestamp() : time();
|
432 |
+
|
433 |
+
$defaults = array_combine(array(
|
434 |
+
'year',
|
435 |
+
'month',
|
436 |
+
'day',
|
437 |
+
'hour',
|
438 |
+
'minute',
|
439 |
+
'second',
|
440 |
+
), explode('-', date('Y-n-j-G-i-s', $now)));
|
441 |
+
|
442 |
+
$year = $year === null ? $defaults['year'] : $year;
|
443 |
+
$month = $month === null ? $defaults['month'] : $month;
|
444 |
+
$day = $day === null ? $defaults['day'] : $day;
|
445 |
+
|
446 |
+
if ($hour === null) {
|
447 |
+
$hour = $defaults['hour'];
|
448 |
+
$minute = $minute === null ? $defaults['minute'] : $minute;
|
449 |
+
$second = $second === null ? $defaults['second'] : $second;
|
450 |
+
} else {
|
451 |
+
$minute = $minute === null ? 0 : $minute;
|
452 |
+
$second = $second === null ? 0 : $second;
|
453 |
+
}
|
454 |
+
|
455 |
+
$fixYear = null;
|
456 |
+
|
457 |
+
if ($year < 0) {
|
458 |
+
$fixYear = $year;
|
459 |
+
$year = 0;
|
460 |
+
} elseif ($year > 9999) {
|
461 |
+
$fixYear = $year - 9999;
|
462 |
+
$year = 9999;
|
463 |
+
}
|
464 |
+
|
465 |
+
$instance = static::createFromFormat('Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz);
|
466 |
+
|
467 |
+
if ($fixYear !== null) {
|
468 |
+
$instance->addYears($fixYear);
|
469 |
+
}
|
470 |
+
|
471 |
+
return $instance;
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Create a new safe Carbon instance from a specific date and time.
|
476 |
+
*
|
477 |
+
* If any of $year, $month or $day are set to null their now() values will
|
478 |
+
* be used.
|
479 |
+
*
|
480 |
+
* If $hour is null it will be set to its now() value and the default
|
481 |
+
* values for $minute and $second will be their now() values.
|
482 |
+
*
|
483 |
+
* If $hour is not null then the default values for $minute and $second
|
484 |
+
* will be 0.
|
485 |
+
*
|
486 |
+
* If one of the set values is not valid, an \InvalidArgumentException
|
487 |
+
* will be thrown.
|
488 |
+
*
|
489 |
+
* @param int|null $year
|
490 |
+
* @param int|null $month
|
491 |
+
* @param int|null $day
|
492 |
+
* @param int|null $hour
|
493 |
+
* @param int|null $minute
|
494 |
+
* @param int|null $second
|
495 |
+
* @param \DateTimeZone|string|null $tz
|
496 |
+
*
|
497 |
+
* @throws \Carbon\Exceptions\InvalidDateException
|
498 |
+
*
|
499 |
+
* @return static
|
500 |
+
*/
|
501 |
+
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
502 |
+
{
|
503 |
+
$fields = array(
|
504 |
+
'year' => array(0, 9999),
|
505 |
+
'month' => array(0, 12),
|
506 |
+
'day' => array(0, 31),
|
507 |
+
'hour' => array(0, 24),
|
508 |
+
'minute' => array(0, 59),
|
509 |
+
'second' => array(0, 59),
|
510 |
+
);
|
511 |
+
|
512 |
+
foreach ($fields as $field => $range) {
|
513 |
+
if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) {
|
514 |
+
throw new InvalidDateException($field, $$field);
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
$instance = static::create($year, $month, 1, $hour, $minute, $second, $tz);
|
519 |
+
|
520 |
+
if ($day !== null && $day > $instance->daysInMonth) {
|
521 |
+
throw new InvalidDateException('day', $day);
|
522 |
+
}
|
523 |
+
|
524 |
+
return $instance->day($day);
|
525 |
+
}
|
526 |
+
|
527 |
+
/**
|
528 |
+
* Create a Carbon instance from just a date. The time portion is set to now.
|
529 |
+
*
|
530 |
+
* @param int|null $year
|
531 |
+
* @param int|null $month
|
532 |
+
* @param int|null $day
|
533 |
+
* @param \DateTimeZone|string|null $tz
|
534 |
+
*
|
535 |
+
* @return static
|
536 |
+
*/
|
537 |
+
public static function createFromDate($year = null, $month = null, $day = null, $tz = null)
|
538 |
+
{
|
539 |
+
return static::create($year, $month, $day, null, null, null, $tz);
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Create a Carbon instance from just a time. The date portion is set to today.
|
544 |
+
*
|
545 |
+
* @param int|null $hour
|
546 |
+
* @param int|null $minute
|
547 |
+
* @param int|null $second
|
548 |
+
* @param \DateTimeZone|string|null $tz
|
549 |
+
*
|
550 |
+
* @return static
|
551 |
+
*/
|
552 |
+
public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null)
|
553 |
+
{
|
554 |
+
return static::create(null, null, null, $hour, $minute, $second, $tz);
|
555 |
+
}
|
556 |
+
|
557 |
+
/**
|
558 |
+
* Create a Carbon instance from a specific format.
|
559 |
+
*
|
560 |
+
* @param string $format
|
561 |
+
* @param string $time
|
562 |
+
* @param \DateTimeZone|string|null $tz
|
563 |
+
*
|
564 |
+
* @throws \InvalidArgumentException
|
565 |
+
*
|
566 |
+
* @return static
|
567 |
+
*/
|
568 |
+
public static function createFromFormat($format, $time, $tz = null)
|
569 |
+
{
|
570 |
+
if ($tz !== null) {
|
571 |
+
$dt = parent::createFromFormat($format, $time, static::safeCreateDateTimeZone($tz));
|
572 |
+
} else {
|
573 |
+
$dt = parent::createFromFormat($format, $time);
|
574 |
+
}
|
575 |
+
|
576 |
+
static::setLastErrors($lastErrors = parent::getLastErrors());
|
577 |
+
|
578 |
+
if ($dt instanceof DateTime) {
|
579 |
+
return static::instance($dt);
|
580 |
+
}
|
581 |
+
|
582 |
+
throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors']));
|
583 |
+
}
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Set last errors.
|
587 |
+
*
|
588 |
+
* @param array $lastErrors
|
589 |
+
*
|
590 |
+
* @return void
|
591 |
+
*/
|
592 |
+
private static function setLastErrors(array $lastErrors)
|
593 |
+
{
|
594 |
+
static::$lastErrors = $lastErrors;
|
595 |
+
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* {@inheritdoc}
|
599 |
+
*/
|
600 |
+
public static function getLastErrors()
|
601 |
+
{
|
602 |
+
return static::$lastErrors;
|
603 |
+
}
|
604 |
+
|
605 |
+
/**
|
606 |
+
* Create a Carbon instance from a timestamp.
|
607 |
+
*
|
608 |
+
* @param int $timestamp
|
609 |
+
* @param \DateTimeZone|string|null $tz
|
610 |
+
*
|
611 |
+
* @return static
|
612 |
+
*/
|
613 |
+
public static function createFromTimestamp($timestamp, $tz = null)
|
614 |
+
{
|
615 |
+
return static::now($tz)->setTimestamp($timestamp);
|
616 |
+
}
|
617 |
+
|
618 |
+
/**
|
619 |
+
* Create a Carbon instance from an UTC timestamp.
|
620 |
+
*
|
621 |
+
* @param int $timestamp
|
622 |
+
*
|
623 |
+
* @return static
|
624 |
+
*/
|
625 |
+
public static function createFromTimestampUTC($timestamp)
|
626 |
+
{
|
627 |
+
return new static('@'.$timestamp);
|
628 |
+
}
|
629 |
+
|
630 |
+
/**
|
631 |
+
* Get a copy of the instance.
|
632 |
+
*
|
633 |
+
* @return static
|
634 |
+
*/
|
635 |
+
public function copy()
|
636 |
+
{
|
637 |
+
return clone $this;
|
638 |
+
}
|
639 |
+
|
640 |
+
///////////////////////////////////////////////////////////////////
|
641 |
+
///////////////////////// GETTERS AND SETTERS /////////////////////
|
642 |
+
///////////////////////////////////////////////////////////////////
|
643 |
+
|
644 |
+
/**
|
645 |
+
* Get a part of the Carbon object
|
646 |
+
*
|
647 |
+
* @param string $name
|
648 |
+
*
|
649 |
+
* @throws \InvalidArgumentException
|
650 |
+
*
|
651 |
+
* @return string|int|\DateTimeZone
|
652 |
+
*/
|
653 |
+
public function __get($name)
|
654 |
+
{
|
655 |
+
switch (true) {
|
656 |
+
case array_key_exists($name, $formats = array(
|
657 |
+
'year' => 'Y',
|
658 |
+
'yearIso' => 'o',
|
659 |
+
'month' => 'n',
|
660 |
+
'day' => 'j',
|
661 |
+
'hour' => 'G',
|
662 |
+
'minute' => 'i',
|
663 |
+
'second' => 's',
|
664 |
+
'micro' => 'u',
|
665 |
+
'dayOfWeek' => 'w',
|
666 |
+
'dayOfYear' => 'z',
|
667 |
+
'weekOfYear' => 'W',
|
668 |
+
'daysInMonth' => 't',
|
669 |
+
'timestamp' => 'U',
|
670 |
+
)):
|
671 |
+
return (int) $this->format($formats[$name]);
|
672 |
+
|
673 |
+
case $name === 'weekOfMonth':
|
674 |
+
return (int) ceil($this->day / static::DAYS_PER_WEEK);
|
675 |
+
|
676 |
+
case $name === 'age':
|
677 |
+
return $this->diffInYears();
|
678 |
+
|
679 |
+
case $name === 'quarter':
|
680 |
+
return (int) ceil($this->month / static::MONTHS_PER_QUARTER);
|
681 |
+
|
682 |
+
case $name === 'offset':
|
683 |
+
return $this->getOffset();
|
684 |
+
|
685 |
+
case $name === 'offsetHours':
|
686 |
+
return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR;
|
687 |
+
|
688 |
+
case $name === 'dst':
|
689 |
+
return $this->format('I') === '1';
|
690 |
+
|
691 |
+
case $name === 'local':
|
692 |
+
return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset();
|
693 |
+
|
694 |
+
case $name === 'utc':
|
695 |
+
return $this->getOffset() === 0;
|
696 |
+
|
697 |
+
case $name === 'timezone' || $name === 'tz':
|
698 |
+
return $this->getTimezone();
|
699 |
+
|
700 |
+
case $name === 'timezoneName' || $name === 'tzName':
|
701 |
+
return $this->getTimezone()->getName();
|
702 |
+
|
703 |
+
default:
|
704 |
+
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
|
705 |
+
}
|
706 |
+
}
|
707 |
+
|
708 |
+
/**
|
709 |
+
* Check if an attribute exists on the object
|
710 |
+
*
|
711 |
+
* @param string $name
|
712 |
+
*
|
713 |
+
* @return bool
|
714 |
+
*/
|
715 |
+
public function __isset($name)
|
716 |
+
{
|
717 |
+
try {
|
718 |
+
$this->__get($name);
|
719 |
+
} catch (InvalidArgumentException $e) {
|
720 |
+
return false;
|
721 |
+
}
|
722 |
+
|
723 |
+
return true;
|
724 |
+
}
|
725 |
+
|
726 |
+
/**
|
727 |
+
* Set a part of the Carbon object
|
728 |
+
*
|
729 |
+
* @param string $name
|
730 |
+
* @param string|int|\DateTimeZone $value
|
731 |
+
*
|
732 |
+
* @throws \InvalidArgumentException
|
733 |
+
*/
|
734 |
+
public function __set($name, $value)
|
735 |
+
{
|
736 |
+
switch ($name) {
|
737 |
+
case 'year':
|
738 |
+
case 'month':
|
739 |
+
case 'day':
|
740 |
+
case 'hour':
|
741 |
+
case 'minute':
|
742 |
+
case 'second':
|
743 |
+
list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s'));
|
744 |
+
$$name = $value;
|
745 |
+
$this->setDateTime($year, $month, $day, $hour, $minute, $second);
|
746 |
+
break;
|
747 |
+
|
748 |
+
case 'timestamp':
|
749 |
+
parent::setTimestamp($value);
|
750 |
+
break;
|
751 |
+
|
752 |
+
case 'timezone':
|
753 |
+
case 'tz':
|
754 |
+
$this->setTimezone($value);
|
755 |
+
break;
|
756 |
+
|
757 |
+
default:
|
758 |
+
throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name));
|
759 |
+
}
|
760 |
+
}
|
761 |
+
|
762 |
+
/**
|
763 |
+
* Set the instance's year
|
764 |
+
*
|
765 |
+
* @param int $value
|
766 |
+
*
|
767 |
+
* @return static
|
768 |
+
*/
|
769 |
+
public function year($value)
|
770 |
+
{
|
771 |
+
$this->year = $value;
|
772 |
+
|
773 |
+
return $this;
|
774 |
+
}
|
775 |
+
|
776 |
+
/**
|
777 |
+
* Set the instance's month
|
778 |
+
*
|
779 |
+
* @param int $value
|
780 |
+
*
|
781 |
+
* @return static
|
782 |
+
*/
|
783 |
+
public function month($value)
|
784 |
+
{
|
785 |
+
$this->month = $value;
|
786 |
+
|
787 |
+
return $this;
|
788 |
+
}
|
789 |
+
|
790 |
+
/**
|
791 |
+
* Set the instance's day
|
792 |
+
*
|
793 |
+
* @param int $value
|
794 |
+
*
|
795 |
+
* @return static
|
796 |
+
*/
|
797 |
+
public function day($value)
|
798 |
+
{
|
799 |
+
$this->day = $value;
|
800 |
+
|
801 |
+
return $this;
|
802 |
+
}
|
803 |
+
|
804 |
+
/**
|
805 |
+
* Set the instance's hour
|
806 |
+
*
|
807 |
+
* @param int $value
|
808 |
+
*
|
809 |
+
* @return static
|
810 |
+
*/
|
811 |
+
public function hour($value)
|
812 |
+
{
|
813 |
+
$this->hour = $value;
|
814 |
+
|
815 |
+
return $this;
|
816 |
+
}
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Set the instance's minute
|
820 |
+
*
|
821 |
+
* @param int $value
|
822 |
+
*
|
823 |
+
* @return static
|
824 |
+
*/
|
825 |
+
public function minute($value)
|
826 |
+
{
|
827 |
+
$this->minute = $value;
|
828 |
+
|
829 |
+
return $this;
|
830 |
+
}
|
831 |
+
|
832 |
+
/**
|
833 |
+
* Set the instance's second
|
834 |
+
*
|
835 |
+
* @param int $value
|
836 |
+
*
|
837 |
+
* @return static
|
838 |
+
*/
|
839 |
+
public function second($value)
|
840 |
+
{
|
841 |
+
$this->second = $value;
|
842 |
+
|
843 |
+
return $this;
|
844 |
+
}
|
845 |
+
|
846 |
+
/**
|
847 |
+
* Sets the current date of the DateTime object to a different date.
|
848 |
+
* Calls modify as a workaround for a php bug
|
849 |
+
*
|
850 |
+
* @param int $year
|
851 |
+
* @param int $month
|
852 |
+
* @param int $day
|
853 |
+
*
|
854 |
+
* @return static
|
855 |
+
*
|
856 |
+
* @see https://github.com/briannesbitt/Carbon/issues/539
|
857 |
+
* @see https://bugs.php.net/bug.php?id=63863
|
858 |
+
*/
|
859 |
+
public function setDate($year, $month, $day)
|
860 |
+
{
|
861 |
+
$this->modify('+0 day');
|
862 |
+
|
863 |
+
return parent::setDate($year, $month, $day);
|
864 |
+
}
|
865 |
+
|
866 |
+
/**
|
867 |
+
* Set the date and time all together
|
868 |
+
*
|
869 |
+
* @param int $year
|
870 |
+
* @param int $month
|
871 |
+
* @param int $day
|
872 |
+
* @param int $hour
|
873 |
+
* @param int $minute
|
874 |
+
* @param int $second
|
875 |
+
*
|
876 |
+
* @return static
|
877 |
+
*/
|
878 |
+
public function setDateTime($year, $month, $day, $hour, $minute, $second = 0)
|
879 |
+
{
|
880 |
+
return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second);
|
881 |
+
}
|
882 |
+
|
883 |
+
/**
|
884 |
+
* Set the time by time string
|
885 |
+
*
|
886 |
+
* @param string $time
|
887 |
+
*
|
888 |
+
* @return static
|
889 |
+
*/
|
890 |
+
public function setTimeFromTimeString($time)
|
891 |
+
{
|
892 |
+
$time = explode(':', $time);
|
893 |
+
|
894 |
+
$hour = $time[0];
|
895 |
+
$minute = isset($time[1]) ? $time[1] : 0;
|
896 |
+
$second = isset($time[2]) ? $time[2] : 0;
|
897 |
+
|
898 |
+
return $this->setTime($hour, $minute, $second);
|
899 |
+
}
|
900 |
+
|
901 |
+
/**
|
902 |
+
* Set the instance's timestamp
|
903 |
+
*
|
904 |
+
* @param int $value
|
905 |
+
*
|
906 |
+
* @return static
|
907 |
+
*/
|
908 |
+
public function timestamp($value)
|
909 |
+
{
|
910 |
+
return $this->setTimestamp($value);
|
911 |
+
}
|
912 |
+
|
913 |
+
/**
|
914 |
+
* Alias for setTimezone()
|
915 |
+
*
|
916 |
+
* @param \DateTimeZone|string $value
|
917 |
+
*
|
918 |
+
* @return static
|
919 |
+
*/
|
920 |
+
public function timezone($value)
|
921 |
+
{
|
922 |
+
return $this->setTimezone($value);
|
923 |
+
}
|
924 |
+
|
925 |
+
/**
|
926 |
+
* Alias for setTimezone()
|
927 |
+
*
|
928 |
+
* @param \DateTimeZone|string $value
|
929 |
+
*
|
930 |
+
* @return static
|
931 |
+
*/
|
932 |
+
public function tz($value)
|
933 |
+
{
|
934 |
+
return $this->setTimezone($value);
|
935 |
+
}
|
936 |
+
|
937 |
+
/**
|
938 |
+
* Set the instance's timezone from a string or object
|
939 |
+
*
|
940 |
+
* @param \DateTimeZone|string $value
|
941 |
+
*
|
942 |
+
* @return static
|
943 |
+
*/
|
944 |
+
public function setTimezone($value)
|
945 |
+
{
|
946 |
+
return parent::setTimezone(static::safeCreateDateTimeZone($value));
|
947 |
+
}
|
948 |
+
|
949 |
+
///////////////////////////////////////////////////////////////////
|
950 |
+
/////////////////////// WEEK SPECIAL DAYS /////////////////////////
|
951 |
+
///////////////////////////////////////////////////////////////////
|
952 |
+
|
953 |
+
/**
|
954 |
+
* Get the first day of week
|
955 |
+
*
|
956 |
+
* @return int
|
957 |
+
*/
|
958 |
+
public static function getWeekStartsAt()
|
959 |
+
{
|
960 |
+
return static::$weekStartsAt;
|
961 |
+
}
|
962 |
+
|
963 |
+
/**
|
964 |
+
* Set the first day of week
|
965 |
+
*
|
966 |
+
* @param int
|
967 |
+
*/
|
968 |
+
public static function setWeekStartsAt($day)
|
969 |
+
{
|
970 |
+
static::$weekStartsAt = $day;
|
971 |
+
}
|
972 |
+
|
973 |
+
/**
|
974 |
+
* Get the last day of week
|
975 |
+
*
|
976 |
+
* @return int
|
977 |
+
*/
|
978 |
+
public static function getWeekEndsAt()
|
979 |
+
{
|
980 |
+
return static::$weekEndsAt;
|
981 |
+
}
|
982 |
+
|
983 |
+
/**
|
984 |
+
* Set the last day of week
|
985 |
+
*
|
986 |
+
* @param int
|
987 |
+
*/
|
988 |
+
public static function setWeekEndsAt($day)
|
989 |
+
{
|
990 |
+
static::$weekEndsAt = $day;
|
991 |
+
}
|
992 |
+
|
993 |
+
/**
|
994 |
+
* Get weekend days
|
995 |
+
*
|
996 |
+
* @return array
|
997 |
+
*/
|
998 |
+
public static function getWeekendDays()
|
999 |
+
{
|
1000 |
+
return static::$weekendDays;
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
/**
|
1004 |
+
* Set weekend days
|
1005 |
+
*
|
1006 |
+
* @param array
|
1007 |
+
*/
|
1008 |
+
public static function setWeekendDays($days)
|
1009 |
+
{
|
1010 |
+
static::$weekendDays = $days;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
///////////////////////////////////////////////////////////////////
|
1014 |
+
///////////////////////// TESTING AIDS ////////////////////////////
|
1015 |
+
///////////////////////////////////////////////////////////////////
|
1016 |
+
|
1017 |
+
/**
|
1018 |
+
* Set a Carbon instance (real or mock) to be returned when a "now"
|
1019 |
+
* instance is created. The provided instance will be returned
|
1020 |
+
* specifically under the following conditions:
|
1021 |
+
* - A call to the static now() method, ex. Carbon::now()
|
1022 |
+
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
|
1023 |
+
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
|
1024 |
+
* - When a string containing the desired time is passed to Carbon::parse().
|
1025 |
+
*
|
1026 |
+
* Note the timezone parameter was left out of the examples above and
|
1027 |
+
* has no affect as the mock value will be returned regardless of its value.
|
1028 |
+
*
|
1029 |
+
* To clear the test instance call this method using the default
|
1030 |
+
* parameter of null.
|
1031 |
+
*
|
1032 |
+
* @param \Carbon\Carbon|string|null $testNow
|
1033 |
+
*/
|
1034 |
+
public static function setTestNow($testNow = null)
|
1035 |
+
{
|
1036 |
+
static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* Get the Carbon instance (real or mock) to be returned when a "now"
|
1041 |
+
* instance is created.
|
1042 |
+
*
|
1043 |
+
* @return static the current instance used for testing
|
1044 |
+
*/
|
1045 |
+
public static function getTestNow()
|
1046 |
+
{
|
1047 |
+
return static::$testNow;
|
1048 |
+
}
|
1049 |
+
|
1050 |
+
/**
|
1051 |
+
* Determine if there is a valid test instance set. A valid test instance
|
1052 |
+
* is anything that is not null.
|
1053 |
+
*
|
1054 |
+
* @return bool true if there is a test instance, otherwise false
|
1055 |
+
*/
|
1056 |
+
public static function hasTestNow()
|
1057 |
+
{
|
1058 |
+
return static::getTestNow() !== null;
|
1059 |
+
}
|
1060 |
+
|
1061 |
+
/**
|
1062 |
+
* Determine if there is a relative keyword in the time string, this is to
|
1063 |
+
* create dates relative to now for test instances. e.g.: next tuesday
|
1064 |
+
*
|
1065 |
+
* @param string $time
|
1066 |
+
*
|
1067 |
+
* @return bool true if there is a keyword, otherwise false
|
1068 |
+
*/
|
1069 |
+
public static function hasRelativeKeywords($time)
|
1070 |
+
{
|
1071 |
+
// skip common format with a '-' in it
|
1072 |
+
if (preg_match('/\d{4}-\d{1,2}-\d{1,2}/', $time) !== 1) {
|
1073 |
+
foreach (static::$relativeKeywords as $keyword) {
|
1074 |
+
if (stripos($time, $keyword) !== false) {
|
1075 |
+
return true;
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
|
1080 |
+
return false;
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
///////////////////////////////////////////////////////////////////
|
1084 |
+
/////////////////////// LOCALIZATION //////////////////////////////
|
1085 |
+
///////////////////////////////////////////////////////////////////
|
1086 |
+
|
1087 |
+
/**
|
1088 |
+
* Initialize the translator instance if necessary.
|
1089 |
+
*
|
1090 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
1091 |
+
*/
|
1092 |
+
protected static function translator()
|
1093 |
+
{
|
1094 |
+
if (static::$translator === null) {
|
1095 |
+
static::$translator = new Translator('en');
|
1096 |
+
static::$translator->addLoader('array', new ArrayLoader());
|
1097 |
+
static::setLocale('en');
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
return static::$translator;
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
/**
|
1104 |
+
* Get the translator instance in use
|
1105 |
+
*
|
1106 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
1107 |
+
*/
|
1108 |
+
public static function getTranslator()
|
1109 |
+
{
|
1110 |
+
return static::translator();
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
/**
|
1114 |
+
* Set the translator instance to use
|
1115 |
+
*
|
1116 |
+
* @param \Symfony\Component\Translation\TranslatorInterface $translator
|
1117 |
+
*/
|
1118 |
+
public static function setTranslator(TranslatorInterface $translator)
|
1119 |
+
{
|
1120 |
+
static::$translator = $translator;
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
/**
|
1124 |
+
* Get the current translator locale
|
1125 |
+
*
|
1126 |
+
* @return string
|
1127 |
+
*/
|
1128 |
+
public static function getLocale()
|
1129 |
+
{
|
1130 |
+
return static::translator()->getLocale();
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
/**
|
1134 |
+
* Set the current translator locale and indicate if the source locale file exists
|
1135 |
+
*
|
1136 |
+
* @param string $locale
|
1137 |
+
*
|
1138 |
+
* @return bool
|
1139 |
+
*/
|
1140 |
+
public static function setLocale($locale)
|
1141 |
+
{
|
1142 |
+
$locale = preg_replace_callback('/\b([a-z]{2})[-_](?:([a-z]{4})[-_])?([a-z]{2})\b/', function ($matches) {
|
1143 |
+
return $matches[1].'_'.(!empty($matches[2]) ? ucfirst($matches[2]).'_' : '').strtoupper($matches[3]);
|
1144 |
+
}, strtolower($locale));
|
1145 |
+
|
1146 |
+
if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) {
|
1147 |
+
static::translator()->setLocale($locale);
|
1148 |
+
// Ensure the locale has been loaded.
|
1149 |
+
static::translator()->addResource('array', require $filename, $locale);
|
1150 |
+
|
1151 |
+
return true;
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
return false;
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
///////////////////////////////////////////////////////////////////
|
1158 |
+
/////////////////////// STRING FORMATTING /////////////////////////
|
1159 |
+
///////////////////////////////////////////////////////////////////
|
1160 |
+
|
1161 |
+
/**
|
1162 |
+
* Set if UTF8 will be used for localized date/time
|
1163 |
+
*
|
1164 |
+
* @param bool $utf8
|
1165 |
+
*/
|
1166 |
+
public static function setUtf8($utf8)
|
1167 |
+
{
|
1168 |
+
static::$utf8 = $utf8;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
/**
|
1172 |
+
* Format the instance with the current locale. You can set the current
|
1173 |
+
* locale using setlocale() http://php.net/setlocale.
|
1174 |
+
*
|
1175 |
+
* @param string $format
|
1176 |
+
*
|
1177 |
+
* @return string
|
1178 |
+
*/
|
1179 |
+
public function formatLocalized($format)
|
1180 |
+
{
|
1181 |
+
// Check for Windows to find and replace the %e
|
1182 |
+
// modifier correctly
|
1183 |
+
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
1184 |
+
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
|
1185 |
+
}
|
1186 |
+
|
1187 |
+
$formatted = strftime($format, strtotime($this));
|
1188 |
+
|
1189 |
+
return static::$utf8 ? utf8_encode($formatted) : $formatted;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
/**
|
1193 |
+
* Reset the format used to the default when type juggling a Carbon instance to a string
|
1194 |
+
*/
|
1195 |
+
public static function resetToStringFormat()
|
1196 |
+
{
|
1197 |
+
static::setToStringFormat(static::DEFAULT_TO_STRING_FORMAT);
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
/**
|
1201 |
+
* Set the default format used when type juggling a Carbon instance to a string
|
1202 |
+
*
|
1203 |
+
* @param string $format
|
1204 |
+
*/
|
1205 |
+
public static function setToStringFormat($format)
|
1206 |
+
{
|
1207 |
+
static::$toStringFormat = $format;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/**
|
1211 |
+
* Format the instance as a string using the set format
|
1212 |
+
*
|
1213 |
+
* @return string
|
1214 |
+
*/
|
1215 |
+
public function __toString()
|
1216 |
+
{
|
1217 |
+
return $this->format(static::$toStringFormat);
|
1218 |
+
}
|
1219 |
+
|
1220 |
+
/**
|
1221 |
+
* Format the instance as date
|
1222 |
+
*
|
1223 |
+
* @return string
|
1224 |
+
*/
|
1225 |
+
public function toDateString()
|
1226 |
+
{
|
1227 |
+
return $this->format('Y-m-d');
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
/**
|
1231 |
+
* Format the instance as a readable date
|
1232 |
+
*
|
1233 |
+
* @return string
|
1234 |
+
*/
|
1235 |
+
public function toFormattedDateString()
|
1236 |
+
{
|
1237 |
+
return $this->format('M j, Y');
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
/**
|
1241 |
+
* Format the instance as time
|
1242 |
+
*
|
1243 |
+
* @return string
|
1244 |
+
*/
|
1245 |
+
public function toTimeString()
|
1246 |
+
{
|
1247 |
+
return $this->format('H:i:s');
|
1248 |
+
}
|
1249 |
+
|
1250 |
+
/**
|
1251 |
+
* Format the instance as date and time
|
1252 |
+
*
|
1253 |
+
* @return string
|
1254 |
+
*/
|
1255 |
+
public function toDateTimeString()
|
1256 |
+
{
|
1257 |
+
return $this->format('Y-m-d H:i:s');
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
/**
|
1261 |
+
* Format the instance with day, date and time
|
1262 |
+
*
|
1263 |
+
* @return string
|
1264 |
+
*/
|
1265 |
+
public function toDayDateTimeString()
|
1266 |
+
{
|
1267 |
+
return $this->format('D, M j, Y g:i A');
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
/**
|
1271 |
+
* Format the instance as ATOM
|
1272 |
+
*
|
1273 |
+
* @return string
|
1274 |
+
*/
|
1275 |
+
public function toAtomString()
|
1276 |
+
{
|
1277 |
+
return $this->format(static::ATOM);
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
/**
|
1281 |
+
* Format the instance as COOKIE
|
1282 |
+
*
|
1283 |
+
* @return string
|
1284 |
+
*/
|
1285 |
+
public function toCookieString()
|
1286 |
+
{
|
1287 |
+
return $this->format(static::COOKIE);
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
/**
|
1291 |
+
* Format the instance as ISO8601
|
1292 |
+
*
|
1293 |
+
* @return string
|
1294 |
+
*/
|
1295 |
+
public function toIso8601String()
|
1296 |
+
{
|
1297 |
+
return $this->toAtomString();
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
/**
|
1301 |
+
* Format the instance as RFC822
|
1302 |
+
*
|
1303 |
+
* @return string
|
1304 |
+
*/
|
1305 |
+
public function toRfc822String()
|
1306 |
+
{
|
1307 |
+
return $this->format(static::RFC822);
|
1308 |
+
}
|
1309 |
+
|
1310 |
+
/**
|
1311 |
+
* Format the instance as RFC850
|
1312 |
+
*
|
1313 |
+
* @return string
|
1314 |
+
*/
|
1315 |
+
public function toRfc850String()
|
1316 |
+
{
|
1317 |
+
return $this->format(static::RFC850);
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
/**
|
1321 |
+
* Format the instance as RFC1036
|
1322 |
+
*
|
1323 |
+
* @return string
|
1324 |
+
*/
|
1325 |
+
public function toRfc1036String()
|
1326 |
+
{
|
1327 |
+
return $this->format(static::RFC1036);
|
1328 |
+
}
|
1329 |
+
|
1330 |
+
/**
|
1331 |
+
* Format the instance as RFC1123
|
1332 |
+
*
|
1333 |
+
* @return string
|
1334 |
+
*/
|
1335 |
+
public function toRfc1123String()
|
1336 |
+
{
|
1337 |
+
return $this->format(static::RFC1123);
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
/**
|
1341 |
+
* Format the instance as RFC2822
|
1342 |
+
*
|
1343 |
+
* @return string
|
1344 |
+
*/
|
1345 |
+
public function toRfc2822String()
|
1346 |
+
{
|
1347 |
+
return $this->format(static::RFC2822);
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
/**
|
1351 |
+
* Format the instance as RFC3339
|
1352 |
+
*
|
1353 |
+
* @return string
|
1354 |
+
*/
|
1355 |
+
public function toRfc3339String()
|
1356 |
+
{
|
1357 |
+
return $this->format(static::RFC3339);
|
1358 |
+
}
|
1359 |
+
|
1360 |
+
/**
|
1361 |
+
* Format the instance as RSS
|
1362 |
+
*
|
1363 |
+
* @return string
|
1364 |
+
*/
|
1365 |
+
public function toRssString()
|
1366 |
+
{
|
1367 |
+
return $this->format(static::RSS);
|
1368 |
+
}
|
1369 |
+
|
1370 |
+
/**
|
1371 |
+
* Format the instance as W3C
|
1372 |
+
*
|
1373 |
+
* @return string
|
1374 |
+
*/
|
1375 |
+
public function toW3cString()
|
1376 |
+
{
|
1377 |
+
return $this->format(static::W3C);
|
1378 |
+
}
|
1379 |
+
|
1380 |
+
///////////////////////////////////////////////////////////////////
|
1381 |
+
////////////////////////// COMPARISONS ////////////////////////////
|
1382 |
+
///////////////////////////////////////////////////////////////////
|
1383 |
+
|
1384 |
+
/**
|
1385 |
+
* Determines if the instance is equal to another
|
1386 |
+
*
|
1387 |
+
* @param Carbon $dt
|
1388 |
+
*
|
1389 |
+
* @return bool
|
1390 |
+
*/
|
1391 |
+
public function eq(Carbon $dt)
|
1392 |
+
{
|
1393 |
+
return $this == $dt;
|
1394 |
+
}
|
1395 |
+
|
1396 |
+
/**
|
1397 |
+
* Determines if the instance is equal to another
|
1398 |
+
*
|
1399 |
+
* @param Carbon $dt
|
1400 |
+
*
|
1401 |
+
* @see eq()
|
1402 |
+
*
|
1403 |
+
* @return bool
|
1404 |
+
*/
|
1405 |
+
public function equalTo(Carbon $dt)
|
1406 |
+
{
|
1407 |
+
return $this->eq($dt);
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
/**
|
1411 |
+
* Determines if the instance is not equal to another
|
1412 |
+
*
|
1413 |
+
* @param Carbon $dt
|
1414 |
+
*
|
1415 |
+
* @return bool
|
1416 |
+
*/
|
1417 |
+
public function ne(Carbon $dt)
|
1418 |
+
{
|
1419 |
+
return !$this->eq($dt);
|
1420 |
+
}
|
1421 |
+
|
1422 |
+
/**
|
1423 |
+
* Determines if the instance is not equal to another
|
1424 |
+
*
|
1425 |
+
* @param Carbon $dt
|
1426 |
+
*
|
1427 |
+
* @see ne()
|
1428 |
+
*
|
1429 |
+
* @return bool
|
1430 |
+
*/
|
1431 |
+
public function notEqualTo(Carbon $dt)
|
1432 |
+
{
|
1433 |
+
return $this->ne($dt);
|
1434 |
+
}
|
1435 |
+
|
1436 |
+
/**
|
1437 |
+
* Determines if the instance is greater (after) than another
|
1438 |
+
*
|
1439 |
+
* @param Carbon $dt
|
1440 |
+
*
|
1441 |
+
* @return bool
|
1442 |
+
*/
|
1443 |
+
public function gt(Carbon $dt)
|
1444 |
+
{
|
1445 |
+
return $this > $dt;
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
/**
|
1449 |
+
* Determines if the instance is greater (after) than another
|
1450 |
+
*
|
1451 |
+
* @param Carbon $dt
|
1452 |
+
*
|
1453 |
+
* @see gt()
|
1454 |
+
*
|
1455 |
+
* @return bool
|
1456 |
+
*/
|
1457 |
+
public function greaterThan(Carbon $dt)
|
1458 |
+
{
|
1459 |
+
return $this->gt($dt);
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
/**
|
1463 |
+
* Determines if the instance is greater (after) than or equal to another
|
1464 |
+
*
|
1465 |
+
* @param Carbon $dt
|
1466 |
+
*
|
1467 |
+
* @return bool
|
1468 |
+
*/
|
1469 |
+
public function gte(Carbon $dt)
|
1470 |
+
{
|
1471 |
+
return $this >= $dt;
|
1472 |
+
}
|
1473 |
+
|
1474 |
+
/**
|
1475 |
+
* Determines if the instance is greater (after) than or equal to another
|
1476 |
+
*
|
1477 |
+
* @param Carbon $dt
|
1478 |
+
*
|
1479 |
+
* @see gte()
|
1480 |
+
*
|
1481 |
+
* @return bool
|
1482 |
+
*/
|
1483 |
+
public function greaterThanOrEqualTo(Carbon $dt)
|
1484 |
+
{
|
1485 |
+
return $this->gte($dt);
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
/**
|
1489 |
+
* Determines if the instance is less (before) than another
|
1490 |
+
*
|
1491 |
+
* @param Carbon $dt
|
1492 |
+
*
|
1493 |
+
* @return bool
|
1494 |
+
*/
|
1495 |
+
public function lt(Carbon $dt)
|
1496 |
+
{
|
1497 |
+
return $this < $dt;
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
/**
|
1501 |
+
* Determines if the instance is less (before) than another
|
1502 |
+
*
|
1503 |
+
* @param Carbon $dt
|
1504 |
+
*
|
1505 |
+
* @see lt()
|
1506 |
+
*
|
1507 |
+
* @return bool
|
1508 |
+
*/
|
1509 |
+
public function lessThan(Carbon $dt)
|
1510 |
+
{
|
1511 |
+
return $this->lt($dt);
|
1512 |
+
}
|
1513 |
+
|
1514 |
+
/**
|
1515 |
+
* Determines if the instance is less (before) or equal to another
|
1516 |
+
*
|
1517 |
+
* @param Carbon $dt
|
1518 |
+
*
|
1519 |
+
* @return bool
|
1520 |
+
*/
|
1521 |
+
public function lte(Carbon $dt)
|
1522 |
+
{
|
1523 |
+
return $this <= $dt;
|
1524 |
+
}
|
1525 |
+
|
1526 |
+
/**
|
1527 |
+
* Determines if the instance is less (before) or equal to another
|
1528 |
+
*
|
1529 |
+
* @param Carbon $dt
|
1530 |
+
*
|
1531 |
+
* @see lte()
|
1532 |
+
*
|
1533 |
+
* @return bool
|
1534 |
+
*/
|
1535 |
+
public function lessThanOrEqualTo(Carbon $dt)
|
1536 |
+
{
|
1537 |
+
return $this->lte($dt);
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
/**
|
1541 |
+
* Determines if the instance is between two others
|
1542 |
+
*
|
1543 |
+
* @param Carbon $dt1
|
1544 |
+
* @param Carbon $dt2
|
1545 |
+
* @param bool $equal Indicates if a > and < comparison should be used or <= or >=
|
1546 |
+
*
|
1547 |
+
* @return bool
|
1548 |
+
*/
|
1549 |
+
public function between(Carbon $dt1, Carbon $dt2, $equal = true)
|
1550 |
+
{
|
1551 |
+
if ($dt1->gt($dt2)) {
|
1552 |
+
$temp = $dt1;
|
1553 |
+
$dt1 = $dt2;
|
1554 |
+
$dt2 = $temp;
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
if ($equal) {
|
1558 |
+
return $this->gte($dt1) && $this->lte($dt2);
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
return $this->gt($dt1) && $this->lt($dt2);
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
/**
|
1565 |
+
* Get the closest date from the instance.
|
1566 |
+
*
|
1567 |
+
* @param Carbon $dt1
|
1568 |
+
* @param Carbon $dt2
|
1569 |
+
*
|
1570 |
+
* @return static
|
1571 |
+
*/
|
1572 |
+
public function closest(Carbon $dt1, Carbon $dt2)
|
1573 |
+
{
|
1574 |
+
return $this->diffInSeconds($dt1) < $this->diffInSeconds($dt2) ? $dt1 : $dt2;
|
1575 |
+
}
|
1576 |
+
|
1577 |
+
/**
|
1578 |
+
* Get the farthest date from the instance.
|
1579 |
+
*
|
1580 |
+
* @param Carbon $dt1
|
1581 |
+
* @param Carbon $dt2
|
1582 |
+
*
|
1583 |
+
* @return static
|
1584 |
+
*/
|
1585 |
+
public function farthest(Carbon $dt1, Carbon $dt2)
|
1586 |
+
{
|
1587 |
+
return $this->diffInSeconds($dt1) > $this->diffInSeconds($dt2) ? $dt1 : $dt2;
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
/**
|
1591 |
+
* Get the minimum instance between a given instance (default now) and the current instance.
|
1592 |
+
*
|
1593 |
+
* @param \Carbon\Carbon|null $dt
|
1594 |
+
*
|
1595 |
+
* @return static
|
1596 |
+
*/
|
1597 |
+
public function min(Carbon $dt = null)
|
1598 |
+
{
|
1599 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
1600 |
+
|
1601 |
+
return $this->lt($dt) ? $this : $dt;
|
1602 |
+
}
|
1603 |
+
|
1604 |
+
/**
|
1605 |
+
* Get the minimum instance between a given instance (default now) and the current instance.
|
1606 |
+
*
|
1607 |
+
* @param \Carbon\Carbon|null $dt
|
1608 |
+
*
|
1609 |
+
* @see min()
|
1610 |
+
*
|
1611 |
+
* @return static
|
1612 |
+
*/
|
1613 |
+
public function minimum(Carbon $dt = null)
|
1614 |
+
{
|
1615 |
+
return $this->min($dt);
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
/**
|
1619 |
+
* Get the maximum instance between a given instance (default now) and the current instance.
|
1620 |
+
*
|
1621 |
+
* @param \Carbon\Carbon|null $dt
|
1622 |
+
*
|
1623 |
+
* @return static
|
1624 |
+
*/
|
1625 |
+
public function max(Carbon $dt = null)
|
1626 |
+
{
|
1627 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
1628 |
+
|
1629 |
+
return $this->gt($dt) ? $this : $dt;
|
1630 |
+
}
|
1631 |
+
|
1632 |
+
/**
|
1633 |
+
* Get the maximum instance between a given instance (default now) and the current instance.
|
1634 |
+
*
|
1635 |
+
* @param \Carbon\Carbon|null $dt
|
1636 |
+
*
|
1637 |
+
* @see max()
|
1638 |
+
*
|
1639 |
+
* @return static
|
1640 |
+
*/
|
1641 |
+
public function maximum(Carbon $dt = null)
|
1642 |
+
{
|
1643 |
+
return $this->max($dt);
|
1644 |
+
}
|
1645 |
+
|
1646 |
+
/**
|
1647 |
+
* Determines if the instance is a weekday
|
1648 |
+
*
|
1649 |
+
* @return bool
|
1650 |
+
*/
|
1651 |
+
public function isWeekday()
|
1652 |
+
{
|
1653 |
+
return !$this->isWeekend();
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
/**
|
1657 |
+
* Determines if the instance is a weekend day
|
1658 |
+
*
|
1659 |
+
* @return bool
|
1660 |
+
*/
|
1661 |
+
public function isWeekend()
|
1662 |
+
{
|
1663 |
+
return in_array($this->dayOfWeek, static::$weekendDays);
|
1664 |
+
}
|
1665 |
+
|
1666 |
+
/**
|
1667 |
+
* Determines if the instance is yesterday
|
1668 |
+
*
|
1669 |
+
* @return bool
|
1670 |
+
*/
|
1671 |
+
public function isYesterday()
|
1672 |
+
{
|
1673 |
+
return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString();
|
1674 |
+
}
|
1675 |
+
|
1676 |
+
/**
|
1677 |
+
* Determines if the instance is today
|
1678 |
+
*
|
1679 |
+
* @return bool
|
1680 |
+
*/
|
1681 |
+
public function isToday()
|
1682 |
+
{
|
1683 |
+
return $this->toDateString() === static::now($this->getTimezone())->toDateString();
|
1684 |
+
}
|
1685 |
+
|
1686 |
+
/**
|
1687 |
+
* Determines if the instance is tomorrow
|
1688 |
+
*
|
1689 |
+
* @return bool
|
1690 |
+
*/
|
1691 |
+
public function isTomorrow()
|
1692 |
+
{
|
1693 |
+
return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString();
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
/**
|
1697 |
+
* Determines if the instance is within the next week
|
1698 |
+
*
|
1699 |
+
* @return bool
|
1700 |
+
*/
|
1701 |
+
public function isNextWeek()
|
1702 |
+
{
|
1703 |
+
return $this->weekOfYear === static::now($this->getTimezone())->addWeek()->weekOfYear;
|
1704 |
+
}
|
1705 |
+
|
1706 |
+
/**
|
1707 |
+
* Determines if the instance is within the last week
|
1708 |
+
*
|
1709 |
+
* @return bool
|
1710 |
+
*/
|
1711 |
+
public function isLastWeek()
|
1712 |
+
{
|
1713 |
+
return $this->weekOfYear === static::now($this->getTimezone())->subWeek()->weekOfYear;
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
/**
|
1717 |
+
* Determines if the instance is within the next month
|
1718 |
+
*
|
1719 |
+
* @return bool
|
1720 |
+
*/
|
1721 |
+
public function isNextMonth()
|
1722 |
+
{
|
1723 |
+
return $this->month === static::now($this->getTimezone())->addMonthNoOverflow()->month;
|
1724 |
+
}
|
1725 |
+
|
1726 |
+
/**
|
1727 |
+
* Determines if the instance is within the last month
|
1728 |
+
*
|
1729 |
+
* @return bool
|
1730 |
+
*/
|
1731 |
+
public function isLastMonth()
|
1732 |
+
{
|
1733 |
+
return $this->month === static::now($this->getTimezone())->subMonthNoOverflow()->month;
|
1734 |
+
}
|
1735 |
+
|
1736 |
+
/**
|
1737 |
+
* Determines if the instance is within next year
|
1738 |
+
*
|
1739 |
+
* @return bool
|
1740 |
+
*/
|
1741 |
+
public function isNextYear()
|
1742 |
+
{
|
1743 |
+
return $this->year === static::now($this->getTimezone())->addYear()->year;
|
1744 |
+
}
|
1745 |
+
|
1746 |
+
/**
|
1747 |
+
* Determines if the instance is within the previous year
|
1748 |
+
*
|
1749 |
+
* @return bool
|
1750 |
+
*/
|
1751 |
+
public function isLastYear()
|
1752 |
+
{
|
1753 |
+
return $this->year === static::now($this->getTimezone())->subYear()->year;
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
/**
|
1757 |
+
* Determines if the instance is in the future, ie. greater (after) than now
|
1758 |
+
*
|
1759 |
+
* @return bool
|
1760 |
+
*/
|
1761 |
+
public function isFuture()
|
1762 |
+
{
|
1763 |
+
return $this->gt(static::now($this->getTimezone()));
|
1764 |
+
}
|
1765 |
+
|
1766 |
+
/**
|
1767 |
+
* Determines if the instance is in the past, ie. less (before) than now
|
1768 |
+
*
|
1769 |
+
* @return bool
|
1770 |
+
*/
|
1771 |
+
public function isPast()
|
1772 |
+
{
|
1773 |
+
return $this->lt(static::now($this->getTimezone()));
|
1774 |
+
}
|
1775 |
+
|
1776 |
+
/**
|
1777 |
+
* Determines if the instance is a leap year
|
1778 |
+
*
|
1779 |
+
* @return bool
|
1780 |
+
*/
|
1781 |
+
public function isLeapYear()
|
1782 |
+
{
|
1783 |
+
return $this->format('L') === '1';
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
/**
|
1787 |
+
* Determines if the instance is a long year
|
1788 |
+
*
|
1789 |
+
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
1790 |
+
*
|
1791 |
+
* @return bool
|
1792 |
+
*/
|
1793 |
+
public function isLongYear()
|
1794 |
+
{
|
1795 |
+
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
/*
|
1799 |
+
* Compares the formatted values of the two dates.
|
1800 |
+
*
|
1801 |
+
* @param string $format The date formats to compare.
|
1802 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1803 |
+
*
|
1804 |
+
* @return bool
|
1805 |
+
*/
|
1806 |
+
public function isSameAs($format, Carbon $dt = null)
|
1807 |
+
{
|
1808 |
+
$dt = $dt ?: static::now($this->tz);
|
1809 |
+
|
1810 |
+
return $this->format($format) === $dt->format($format);
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
/**
|
1814 |
+
* Determines if the instance is in the current year
|
1815 |
+
*
|
1816 |
+
* @return bool
|
1817 |
+
*/
|
1818 |
+
public function isCurrentYear()
|
1819 |
+
{
|
1820 |
+
return $this->isSameYear();
|
1821 |
+
}
|
1822 |
+
|
1823 |
+
/**
|
1824 |
+
* Checks if the passed in date is in the same year as the instance year.
|
1825 |
+
*
|
1826 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1827 |
+
*
|
1828 |
+
* @return bool
|
1829 |
+
*/
|
1830 |
+
public function isSameYear(Carbon $dt = null)
|
1831 |
+
{
|
1832 |
+
return $this->isSameAs('Y', $dt);
|
1833 |
+
}
|
1834 |
+
|
1835 |
+
/**
|
1836 |
+
* Determines if the instance is in the current month
|
1837 |
+
*
|
1838 |
+
* @return bool
|
1839 |
+
*/
|
1840 |
+
public function isCurrentMonth()
|
1841 |
+
{
|
1842 |
+
return $this->isSameMonth();
|
1843 |
+
}
|
1844 |
+
|
1845 |
+
/**
|
1846 |
+
* Checks if the passed in date is in the same month as the instance month (and year if needed).
|
1847 |
+
*
|
1848 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1849 |
+
* @param bool $ofSameYear Check if it is the same month in the same year.
|
1850 |
+
*
|
1851 |
+
* @return bool
|
1852 |
+
*/
|
1853 |
+
public function isSameMonth(Carbon $dt = null, $ofSameYear = false)
|
1854 |
+
{
|
1855 |
+
$format = $ofSameYear ? 'Y-m' : 'm';
|
1856 |
+
|
1857 |
+
return $this->isSameAs($format, $dt);
|
1858 |
+
}
|
1859 |
+
|
1860 |
+
/**
|
1861 |
+
* Checks if the passed in date is the same day as the instance current day.
|
1862 |
+
*
|
1863 |
+
* @param \Carbon\Carbon $dt
|
1864 |
+
*
|
1865 |
+
* @return bool
|
1866 |
+
*/
|
1867 |
+
public function isSameDay(Carbon $dt)
|
1868 |
+
{
|
1869 |
+
return $this->toDateString() === $dt->toDateString();
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
/**
|
1873 |
+
* Checks if this day is a Sunday.
|
1874 |
+
*
|
1875 |
+
* @return bool
|
1876 |
+
*/
|
1877 |
+
public function isSunday()
|
1878 |
+
{
|
1879 |
+
return $this->dayOfWeek === static::SUNDAY;
|
1880 |
+
}
|
1881 |
+
|
1882 |
+
/**
|
1883 |
+
* Checks if this day is a Monday.
|
1884 |
+
*
|
1885 |
+
* @return bool
|
1886 |
+
*/
|
1887 |
+
public function isMonday()
|
1888 |
+
{
|
1889 |
+
return $this->dayOfWeek === static::MONDAY;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
/**
|
1893 |
+
* Checks if this day is a Tuesday.
|
1894 |
+
*
|
1895 |
+
* @return bool
|
1896 |
+
*/
|
1897 |
+
public function isTuesday()
|
1898 |
+
{
|
1899 |
+
return $this->dayOfWeek === static::TUESDAY;
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
/**
|
1903 |
+
* Checks if this day is a Wednesday.
|
1904 |
+
*
|
1905 |
+
* @return bool
|
1906 |
+
*/
|
1907 |
+
public function isWednesday()
|
1908 |
+
{
|
1909 |
+
return $this->dayOfWeek === static::WEDNESDAY;
|
1910 |
+
}
|
1911 |
+
|
1912 |
+
/**
|
1913 |
+
* Checks if this day is a Thursday.
|
1914 |
+
*
|
1915 |
+
* @return bool
|
1916 |
+
*/
|
1917 |
+
public function isThursday()
|
1918 |
+
{
|
1919 |
+
return $this->dayOfWeek === static::THURSDAY;
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
/**
|
1923 |
+
* Checks if this day is a Friday.
|
1924 |
+
*
|
1925 |
+
* @return bool
|
1926 |
+
*/
|
1927 |
+
public function isFriday()
|
1928 |
+
{
|
1929 |
+
return $this->dayOfWeek === static::FRIDAY;
|
1930 |
+
}
|
1931 |
+
|
1932 |
+
/**
|
1933 |
+
* Checks if this day is a Saturday.
|
1934 |
+
*
|
1935 |
+
* @return bool
|
1936 |
+
*/
|
1937 |
+
public function isSaturday()
|
1938 |
+
{
|
1939 |
+
return $this->dayOfWeek === static::SATURDAY;
|
1940 |
+
}
|
1941 |
+
|
1942 |
+
///////////////////////////////////////////////////////////////////
|
1943 |
+
/////////////////// ADDITIONS AND SUBTRACTIONS ////////////////////
|
1944 |
+
///////////////////////////////////////////////////////////////////
|
1945 |
+
|
1946 |
+
/**
|
1947 |
+
* Add years to the instance. Positive $value travel forward while
|
1948 |
+
* negative $value travel into the past.
|
1949 |
+
*
|
1950 |
+
* @param int $value
|
1951 |
+
*
|
1952 |
+
* @return static
|
1953 |
+
*/
|
1954 |
+
public function addYears($value)
|
1955 |
+
{
|
1956 |
+
return $this->modify((int) $value.' year');
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
/**
|
1960 |
+
* Add a year to the instance
|
1961 |
+
*
|
1962 |
+
* @param int $value
|
1963 |
+
*
|
1964 |
+
* @return static
|
1965 |
+
*/
|
1966 |
+
public function addYear($value = 1)
|
1967 |
+
{
|
1968 |
+
return $this->addYears($value);
|
1969 |
+
}
|
1970 |
+
|
1971 |
+
/**
|
1972 |
+
* Remove a year from the instance
|
1973 |
+
*
|
1974 |
+
* @param int $value
|
1975 |
+
*
|
1976 |
+
* @return static
|
1977 |
+
*/
|
1978 |
+
public function subYear($value = 1)
|
1979 |
+
{
|
1980 |
+
return $this->subYears($value);
|
1981 |
+
}
|
1982 |
+
|
1983 |
+
/**
|
1984 |
+
* Remove years from the instance.
|
1985 |
+
*
|
1986 |
+
* @param int $value
|
1987 |
+
*
|
1988 |
+
* @return static
|
1989 |
+
*/
|
1990 |
+
public function subYears($value)
|
1991 |
+
{
|
1992 |
+
return $this->addYears(-1 * $value);
|
1993 |
+
}
|
1994 |
+
|
1995 |
+
/**
|
1996 |
+
* Add quarters to the instance. Positive $value travels forward while
|
1997 |
+
* negative $value travels into the past.
|
1998 |
+
*
|
1999 |
+
* @param int $value
|
2000 |
+
*
|
2001 |
+
* @return static
|
2002 |
+
*/
|
2003 |
+
public function addQuarters($value)
|
2004 |
+
{
|
2005 |
+
return $this->addMonths(static::MONTHS_PER_QUARTER * $value);
|
2006 |
+
}
|
2007 |
+
|
2008 |
+
/**
|
2009 |
+
* Add a quarter to the instance
|
2010 |
+
*
|
2011 |
+
* @param int $value
|
2012 |
+
*
|
2013 |
+
* @return static
|
2014 |
+
*/
|
2015 |
+
public function addQuarter($value = 1)
|
2016 |
+
{
|
2017 |
+
return $this->addQuarters($value);
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
/**
|
2021 |
+
* Remove a quarter from the instance
|
2022 |
+
*
|
2023 |
+
* @param int $value
|
2024 |
+
*
|
2025 |
+
* @return static
|
2026 |
+
*/
|
2027 |
+
public function subQuarter($value = 1)
|
2028 |
+
{
|
2029 |
+
return $this->subQuarters($value);
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
/**
|
2033 |
+
* Remove quarters from the instance
|
2034 |
+
*
|
2035 |
+
* @param int $value
|
2036 |
+
*
|
2037 |
+
* @return static
|
2038 |
+
*/
|
2039 |
+
public function subQuarters($value)
|
2040 |
+
{
|
2041 |
+
return $this->addQuarters(-1 * $value);
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
/**
|
2045 |
+
* Add centuries to the instance. Positive $value travels forward while
|
2046 |
+
* negative $value travels into the past.
|
2047 |
+
*
|
2048 |
+
* @param int $value
|
2049 |
+
*
|
2050 |
+
* @return static
|
2051 |
+
*/
|
2052 |
+
public function addCenturies($value)
|
2053 |
+
{
|
2054 |
+
return $this->addYears(static::YEARS_PER_CENTURY * $value);
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
/**
|
2058 |
+
* Add a century to the instance
|
2059 |
+
*
|
2060 |
+
* @param int $value
|
2061 |
+
*
|
2062 |
+
* @return static
|
2063 |
+
*/
|
2064 |
+
public function addCentury($value = 1)
|
2065 |
+
{
|
2066 |
+
return $this->addCenturies($value);
|
2067 |
+
}
|
2068 |
+
|
2069 |
+
/**
|
2070 |
+
* Remove a century from the instance
|
2071 |
+
*
|
2072 |
+
* @param int $value
|
2073 |
+
*
|
2074 |
+
* @return static
|
2075 |
+
*/
|
2076 |
+
public function subCentury($value = 1)
|
2077 |
+
{
|
2078 |
+
return $this->subCenturies($value);
|
2079 |
+
}
|
2080 |
+
|
2081 |
+
/**
|
2082 |
+
* Remove centuries from the instance
|
2083 |
+
*
|
2084 |
+
* @param int $value
|
2085 |
+
*
|
2086 |
+
* @return static
|
2087 |
+
*/
|
2088 |
+
public function subCenturies($value)
|
2089 |
+
{
|
2090 |
+
return $this->addCenturies(-1 * $value);
|
2091 |
+
}
|
2092 |
+
|
2093 |
+
/**
|
2094 |
+
* Add months to the instance. Positive $value travels forward while
|
2095 |
+
* negative $value travels into the past.
|
2096 |
+
*
|
2097 |
+
* @param int $value
|
2098 |
+
*
|
2099 |
+
* @return static
|
2100 |
+
*/
|
2101 |
+
public function addMonths($value)
|
2102 |
+
{
|
2103 |
+
if (static::shouldOverflowMonths()) {
|
2104 |
+
return $this->addMonthsWithOverflow($value);
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
return $this->addMonthsNoOverflow($value);
|
2108 |
+
}
|
2109 |
+
|
2110 |
+
/**
|
2111 |
+
* Add a month to the instance
|
2112 |
+
*
|
2113 |
+
* @param int $value
|
2114 |
+
*
|
2115 |
+
* @return static
|
2116 |
+
*/
|
2117 |
+
public function addMonth($value = 1)
|
2118 |
+
{
|
2119 |
+
return $this->addMonths($value);
|
2120 |
+
}
|
2121 |
+
|
2122 |
+
/**
|
2123 |
+
* Remove a month from the instance
|
2124 |
+
*
|
2125 |
+
* @param int $value
|
2126 |
+
*
|
2127 |
+
* @return static
|
2128 |
+
*/
|
2129 |
+
public function subMonth($value = 1)
|
2130 |
+
{
|
2131 |
+
return $this->subMonths($value);
|
2132 |
+
}
|
2133 |
+
|
2134 |
+
/**
|
2135 |
+
* Remove months from the instance
|
2136 |
+
*
|
2137 |
+
* @param int $value
|
2138 |
+
*
|
2139 |
+
* @return static
|
2140 |
+
*/
|
2141 |
+
public function subMonths($value)
|
2142 |
+
{
|
2143 |
+
return $this->addMonths(-1 * $value);
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
/**
|
2147 |
+
* Add months to the instance. Positive $value travels forward while
|
2148 |
+
* negative $value travels into the past.
|
2149 |
+
*
|
2150 |
+
* @param int $value
|
2151 |
+
*
|
2152 |
+
* @return static
|
2153 |
+
*/
|
2154 |
+
public function addMonthsWithOverflow($value)
|
2155 |
+
{
|
2156 |
+
return $this->modify((int) $value.' month');
|
2157 |
+
}
|
2158 |
+
|
2159 |
+
/**
|
2160 |
+
* Add a month to the instance
|
2161 |
+
*
|
2162 |
+
* @param int $value
|
2163 |
+
*
|
2164 |
+
* @return static
|
2165 |
+
*/
|
2166 |
+
public function addMonthWithOverflow($value = 1)
|
2167 |
+
{
|
2168 |
+
return $this->addMonthsWithOverflow($value);
|
2169 |
+
}
|
2170 |
+
|
2171 |
+
/**
|
2172 |
+
* Remove a month from the instance
|
2173 |
+
*
|
2174 |
+
* @param int $value
|
2175 |
+
*
|
2176 |
+
* @return static
|
2177 |
+
*/
|
2178 |
+
public function subMonthWithOverflow($value = 1)
|
2179 |
+
{
|
2180 |
+
return $this->subMonthsWithOverflow($value);
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
/**
|
2184 |
+
* Remove months from the instance
|
2185 |
+
*
|
2186 |
+
* @param int $value
|
2187 |
+
*
|
2188 |
+
* @return static
|
2189 |
+
*/
|
2190 |
+
public function subMonthsWithOverflow($value)
|
2191 |
+
{
|
2192 |
+
return $this->addMonthsWithOverflow(-1 * $value);
|
2193 |
+
}
|
2194 |
+
|
2195 |
+
/**
|
2196 |
+
* Add months without overflowing to the instance. Positive $value
|
2197 |
+
* travels forward while negative $value travels into the past.
|
2198 |
+
*
|
2199 |
+
* @param int $value
|
2200 |
+
*
|
2201 |
+
* @return static
|
2202 |
+
*/
|
2203 |
+
public function addMonthsNoOverflow($value)
|
2204 |
+
{
|
2205 |
+
$day = $this->day;
|
2206 |
+
|
2207 |
+
$this->modify((int) $value.' month');
|
2208 |
+
|
2209 |
+
if ($day !== $this->day) {
|
2210 |
+
$this->modify('last day of previous month');
|
2211 |
+
}
|
2212 |
+
|
2213 |
+
return $this;
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
/**
|
2217 |
+
* Add a month with no overflow to the instance
|
2218 |
+
*
|
2219 |
+
* @param int $value
|
2220 |
+
*
|
2221 |
+
* @return static
|
2222 |
+
*/
|
2223 |
+
public function addMonthNoOverflow($value = 1)
|
2224 |
+
{
|
2225 |
+
return $this->addMonthsNoOverflow($value);
|
2226 |
+
}
|
2227 |
+
|
2228 |
+
/**
|
2229 |
+
* Remove a month with no overflow from the instance
|
2230 |
+
*
|
2231 |
+
* @param int $value
|
2232 |
+
*
|
2233 |
+
* @return static
|
2234 |
+
*/
|
2235 |
+
public function subMonthNoOverflow($value = 1)
|
2236 |
+
{
|
2237 |
+
return $this->subMonthsNoOverflow($value);
|
2238 |
+
}
|
2239 |
+
|
2240 |
+
/**
|
2241 |
+
* Remove months with no overflow from the instance
|
2242 |
+
*
|
2243 |
+
* @param int $value
|
2244 |
+
*
|
2245 |
+
* @return static
|
2246 |
+
*/
|
2247 |
+
public function subMonthsNoOverflow($value)
|
2248 |
+
{
|
2249 |
+
return $this->addMonthsNoOverflow(-1 * $value);
|
2250 |
+
}
|
2251 |
+
|
2252 |
+
/**
|
2253 |
+
* Add days to the instance. Positive $value travels forward while
|
2254 |
+
* negative $value travels into the past.
|
2255 |
+
*
|
2256 |
+
* @param int $value
|
2257 |
+
*
|
2258 |
+
* @return static
|
2259 |
+
*/
|
2260 |
+
public function addDays($value)
|
2261 |
+
{
|
2262 |
+
return $this->modify((int) $value.' day');
|
2263 |
+
}
|
2264 |
+
|
2265 |
+
/**
|
2266 |
+
* Add a day to the instance
|
2267 |
+
*
|
2268 |
+
* @param int $value
|
2269 |
+
*
|
2270 |
+
* @return static
|
2271 |
+
*/
|
2272 |
+
public function addDay($value = 1)
|
2273 |
+
{
|
2274 |
+
return $this->addDays($value);
|
2275 |
+
}
|
2276 |
+
|
2277 |
+
/**
|
2278 |
+
* Remove a day from the instance
|
2279 |
+
*
|
2280 |
+
* @param int $value
|
2281 |
+
*
|
2282 |
+
* @return static
|
2283 |
+
*/
|
2284 |
+
public function subDay($value = 1)
|
2285 |
+
{
|
2286 |
+
return $this->subDays($value);
|
2287 |
+
}
|
2288 |
+
|
2289 |
+
/**
|
2290 |
+
* Remove days from the instance
|
2291 |
+
*
|
2292 |
+
* @param int $value
|
2293 |
+
*
|
2294 |
+
* @return static
|
2295 |
+
*/
|
2296 |
+
public function subDays($value)
|
2297 |
+
{
|
2298 |
+
return $this->addDays(-1 * $value);
|
2299 |
+
}
|
2300 |
+
|
2301 |
+
/**
|
2302 |
+
* Add weekdays to the instance. Positive $value travels forward while
|
2303 |
+
* negative $value travels into the past.
|
2304 |
+
*
|
2305 |
+
* @param int $value
|
2306 |
+
*
|
2307 |
+
* @return static
|
2308 |
+
*/
|
2309 |
+
public function addWeekdays($value)
|
2310 |
+
{
|
2311 |
+
// fix for https://bugs.php.net/bug.php?id=54909
|
2312 |
+
$t = $this->toTimeString();
|
2313 |
+
$this->modify((int) $value.' weekday');
|
2314 |
+
|
2315 |
+
return $this->setTimeFromTimeString($t);
|
2316 |
+
}
|
2317 |
+
|
2318 |
+
/**
|
2319 |
+
* Add a weekday to the instance
|
2320 |
+
*
|
2321 |
+
* @param int $value
|
2322 |
+
*
|
2323 |
+
* @return static
|
2324 |
+
*/
|
2325 |
+
public function addWeekday($value = 1)
|
2326 |
+
{
|
2327 |
+
return $this->addWeekdays($value);
|
2328 |
+
}
|
2329 |
+
|
2330 |
+
/**
|
2331 |
+
* Remove a weekday from the instance
|
2332 |
+
*
|
2333 |
+
* @param int $value
|
2334 |
+
*
|
2335 |
+
* @return static
|
2336 |
+
*/
|
2337 |
+
public function subWeekday($value = 1)
|
2338 |
+
{
|
2339 |
+
return $this->subWeekdays($value);
|
2340 |
+
}
|
2341 |
+
|
2342 |
+
/**
|
2343 |
+
* Remove weekdays from the instance
|
2344 |
+
*
|
2345 |
+
* @param int $value
|
2346 |
+
*
|
2347 |
+
* @return static
|
2348 |
+
*/
|
2349 |
+
public function subWeekdays($value)
|
2350 |
+
{
|
2351 |
+
return $this->addWeekdays(-1 * $value);
|
2352 |
+
}
|
2353 |
+
|
2354 |
+
/**
|
2355 |
+
* Add weeks to the instance. Positive $value travels forward while
|
2356 |
+
* negative $value travels into the past.
|
2357 |
+
*
|
2358 |
+
* @param int $value
|
2359 |
+
*
|
2360 |
+
* @return static
|
2361 |
+
*/
|
2362 |
+
public function addWeeks($value)
|
2363 |
+
{
|
2364 |
+
return $this->modify((int) $value.' week');
|
2365 |
+
}
|
2366 |
+
|
2367 |
+
/**
|
2368 |
+
* Add a week to the instance
|
2369 |
+
*
|
2370 |
+
* @param int $value
|
2371 |
+
*
|
2372 |
+
* @return static
|
2373 |
+
*/
|
2374 |
+
public function addWeek($value = 1)
|
2375 |
+
{
|
2376 |
+
return $this->addWeeks($value);
|
2377 |
+
}
|
2378 |
+
|
2379 |
+
/**
|
2380 |
+
* Remove a week from the instance
|
2381 |
+
*
|
2382 |
+
* @param int $value
|
2383 |
+
*
|
2384 |
+
* @return static
|
2385 |
+
*/
|
2386 |
+
public function subWeek($value = 1)
|
2387 |
+
{
|
2388 |
+
return $this->subWeeks($value);
|
2389 |
+
}
|
2390 |
+
|
2391 |
+
/**
|
2392 |
+
* Remove weeks to the instance
|
2393 |
+
*
|
2394 |
+
* @param int $value
|
2395 |
+
*
|
2396 |
+
* @return static
|
2397 |
+
*/
|
2398 |
+
public function subWeeks($value)
|
2399 |
+
{
|
2400 |
+
return $this->addWeeks(-1 * $value);
|
2401 |
+
}
|
2402 |
+
|
2403 |
+
/**
|
2404 |
+
* Add hours to the instance. Positive $value travels forward while
|
2405 |
+
* negative $value travels into the past.
|
2406 |
+
*
|
2407 |
+
* @param int $value
|
2408 |
+
*
|
2409 |
+
* @return static
|
2410 |
+
*/
|
2411 |
+
public function addHours($value)
|
2412 |
+
{
|
2413 |
+
return $this->modify((int) $value.' hour');
|
2414 |
+
}
|
2415 |
+
|
2416 |
+
/**
|
2417 |
+
* Add an hour to the instance
|
2418 |
+
*
|
2419 |
+
* @param int $value
|
2420 |
+
*
|
2421 |
+
* @return static
|
2422 |
+
*/
|
2423 |
+
public function addHour($value = 1)
|
2424 |
+
{
|
2425 |
+
return $this->addHours($value);
|
2426 |
+
}
|
2427 |
+
|
2428 |
+
/**
|
2429 |
+
* Remove an hour from the instance
|
2430 |
+
*
|
2431 |
+
* @param int $value
|
2432 |
+
*
|
2433 |
+
* @return static
|
2434 |
+
*/
|
2435 |
+
public function subHour($value = 1)
|
2436 |
+
{
|
2437 |
+
return $this->subHours($value);
|
2438 |
+
}
|
2439 |
+
|
2440 |
+
/**
|
2441 |
+
* Remove hours from the instance
|
2442 |
+
*
|
2443 |
+
* @param int $value
|
2444 |
+
*
|
2445 |
+
* @return static
|
2446 |
+
*/
|
2447 |
+
public function subHours($value)
|
2448 |
+
{
|
2449 |
+
return $this->addHours(-1 * $value);
|
2450 |
+
}
|
2451 |
+
|
2452 |
+
/**
|
2453 |
+
* Add minutes to the instance. Positive $value travels forward while
|
2454 |
+
* negative $value travels into the past.
|
2455 |
+
*
|
2456 |
+
* @param int $value
|
2457 |
+
*
|
2458 |
+
* @return static
|
2459 |
+
*/
|
2460 |
+
public function addMinutes($value)
|
2461 |
+
{
|
2462 |
+
return $this->modify((int) $value.' minute');
|
2463 |
+
}
|
2464 |
+
|
2465 |
+
/**
|
2466 |
+
* Add a minute to the instance
|
2467 |
+
*
|
2468 |
+
* @param int $value
|
2469 |
+
*
|
2470 |
+
* @return static
|
2471 |
+
*/
|
2472 |
+
public function addMinute($value = 1)
|
2473 |
+
{
|
2474 |
+
return $this->addMinutes($value);
|
2475 |
+
}
|
2476 |
+
|
2477 |
+
/**
|
2478 |
+
* Remove a minute from the instance
|
2479 |
+
*
|
2480 |
+
* @param int $value
|
2481 |
+
*
|
2482 |
+
* @return static
|
2483 |
+
*/
|
2484 |
+
public function subMinute($value = 1)
|
2485 |
+
{
|
2486 |
+
return $this->subMinutes($value);
|
2487 |
+
}
|
2488 |
+
|
2489 |
+
/**
|
2490 |
+
* Remove minutes from the instance
|
2491 |
+
*
|
2492 |
+
* @param int $value
|
2493 |
+
*
|
2494 |
+
* @return static
|
2495 |
+
*/
|
2496 |
+
public function subMinutes($value)
|
2497 |
+
{
|
2498 |
+
return $this->addMinutes(-1 * $value);
|
2499 |
+
}
|
2500 |
+
|
2501 |
+
/**
|
2502 |
+
* Add seconds to the instance. Positive $value travels forward while
|
2503 |
+
* negative $value travels into the past.
|
2504 |
+
*
|
2505 |
+
* @param int $value
|
2506 |
+
*
|
2507 |
+
* @return static
|
2508 |
+
*/
|
2509 |
+
public function addSeconds($value)
|
2510 |
+
{
|
2511 |
+
return $this->modify((int) $value.' second');
|
2512 |
+
}
|
2513 |
+
|
2514 |
+
/**
|
2515 |
+
* Add a second to the instance
|
2516 |
+
*
|
2517 |
+
* @param int $value
|
2518 |
+
*
|
2519 |
+
* @return static
|
2520 |
+
*/
|
2521 |
+
public function addSecond($value = 1)
|
2522 |
+
{
|
2523 |
+
return $this->addSeconds($value);
|
2524 |
+
}
|
2525 |
+
|
2526 |
+
/**
|
2527 |
+
* Remove a second from the instance
|
2528 |
+
*
|
2529 |
+
* @param int $value
|
2530 |
+
*
|
2531 |
+
* @return static
|
2532 |
+
*/
|
2533 |
+
public function subSecond($value = 1)
|
2534 |
+
{
|
2535 |
+
return $this->subSeconds($value);
|
2536 |
+
}
|
2537 |
+
|
2538 |
+
/**
|
2539 |
+
* Remove seconds from the instance
|
2540 |
+
*
|
2541 |
+
* @param int $value
|
2542 |
+
*
|
2543 |
+
* @return static
|
2544 |
+
*/
|
2545 |
+
public function subSeconds($value)
|
2546 |
+
{
|
2547 |
+
return $this->addSeconds(-1 * $value);
|
2548 |
+
}
|
2549 |
+
|
2550 |
+
///////////////////////////////////////////////////////////////////
|
2551 |
+
/////////////////////////// DIFFERENCES ///////////////////////////
|
2552 |
+
///////////////////////////////////////////////////////////////////
|
2553 |
+
|
2554 |
+
/**
|
2555 |
+
* Get the difference in years
|
2556 |
+
*
|
2557 |
+
* @param \Carbon\Carbon|null $dt
|
2558 |
+
* @param bool $abs Get the absolute of the difference
|
2559 |
+
*
|
2560 |
+
* @return int
|
2561 |
+
*/
|
2562 |
+
public function diffInYears(Carbon $dt = null, $abs = true)
|
2563 |
+
{
|
2564 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2565 |
+
|
2566 |
+
return (int) $this->diff($dt, $abs)->format('%r%y');
|
2567 |
+
}
|
2568 |
+
|
2569 |
+
/**
|
2570 |
+
* Get the difference in months
|
2571 |
+
*
|
2572 |
+
* @param \Carbon\Carbon|null $dt
|
2573 |
+
* @param bool $abs Get the absolute of the difference
|
2574 |
+
*
|
2575 |
+
* @return int
|
2576 |
+
*/
|
2577 |
+
public function diffInMonths(Carbon $dt = null, $abs = true)
|
2578 |
+
{
|
2579 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2580 |
+
|
2581 |
+
return $this->diffInYears($dt, $abs) * static::MONTHS_PER_YEAR + (int) $this->diff($dt, $abs)->format('%r%m');
|
2582 |
+
}
|
2583 |
+
|
2584 |
+
/**
|
2585 |
+
* Get the difference in weeks
|
2586 |
+
*
|
2587 |
+
* @param \Carbon\Carbon|null $dt
|
2588 |
+
* @param bool $abs Get the absolute of the difference
|
2589 |
+
*
|
2590 |
+
* @return int
|
2591 |
+
*/
|
2592 |
+
public function diffInWeeks(Carbon $dt = null, $abs = true)
|
2593 |
+
{
|
2594 |
+
return (int) ($this->diffInDays($dt, $abs) / static::DAYS_PER_WEEK);
|
2595 |
+
}
|
2596 |
+
|
2597 |
+
/**
|
2598 |
+
* Get the difference in days
|
2599 |
+
*
|
2600 |
+
* @param \Carbon\Carbon|null $dt
|
2601 |
+
* @param bool $abs Get the absolute of the difference
|
2602 |
+
*
|
2603 |
+
* @return int
|
2604 |
+
*/
|
2605 |
+
public function diffInDays(Carbon $dt = null, $abs = true)
|
2606 |
+
{
|
2607 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2608 |
+
|
2609 |
+
return (int) $this->diff($dt, $abs)->format('%r%a');
|
2610 |
+
}
|
2611 |
+
|
2612 |
+
/**
|
2613 |
+
* Get the difference in days using a filter closure
|
2614 |
+
*
|
2615 |
+
* @param Closure $callback
|
2616 |
+
* @param \Carbon\Carbon|null $dt
|
2617 |
+
* @param bool $abs Get the absolute of the difference
|
2618 |
+
*
|
2619 |
+
* @return int
|
2620 |
+
*/
|
2621 |
+
public function diffInDaysFiltered(Closure $callback, Carbon $dt = null, $abs = true)
|
2622 |
+
{
|
2623 |
+
return $this->diffFiltered(CarbonInterval::day(), $callback, $dt, $abs);
|
2624 |
+
}
|
2625 |
+
|
2626 |
+
/**
|
2627 |
+
* Get the difference in hours using a filter closure
|
2628 |
+
*
|
2629 |
+
* @param Closure $callback
|
2630 |
+
* @param \Carbon\Carbon|null $dt
|
2631 |
+
* @param bool $abs Get the absolute of the difference
|
2632 |
+
*
|
2633 |
+
* @return int
|
2634 |
+
*/
|
2635 |
+
public function diffInHoursFiltered(Closure $callback, Carbon $dt = null, $abs = true)
|
2636 |
+
{
|
2637 |
+
return $this->diffFiltered(CarbonInterval::hour(), $callback, $dt, $abs);
|
2638 |
+
}
|
2639 |
+
|
2640 |
+
/**
|
2641 |
+
* Get the difference by the given interval using a filter closure
|
2642 |
+
*
|
2643 |
+
* @param CarbonInterval $ci An interval to traverse by
|
2644 |
+
* @param Closure $callback
|
2645 |
+
* @param Carbon|null $dt
|
2646 |
+
* @param bool $abs Get the absolute of the difference
|
2647 |
+
*
|
2648 |
+
* @return int
|
2649 |
+
*/
|
2650 |
+
public function diffFiltered(CarbonInterval $ci, Closure $callback, Carbon $dt = null, $abs = true)
|
2651 |
+
{
|
2652 |
+
$start = $this;
|
2653 |
+
$end = $dt ?: static::now($this->getTimezone());
|
2654 |
+
$inverse = false;
|
2655 |
+
|
2656 |
+
if ($end < $start) {
|
2657 |
+
$start = $end;
|
2658 |
+
$end = $this;
|
2659 |
+
$inverse = true;
|
2660 |
+
}
|
2661 |
+
|
2662 |
+
$period = new DatePeriod($start, $ci, $end);
|
2663 |
+
$vals = array_filter(iterator_to_array($period), function (DateTime $date) use ($callback) {
|
2664 |
+
return call_user_func($callback, Carbon::instance($date));
|
2665 |
+
});
|
2666 |
+
|
2667 |
+
$diff = count($vals);
|
2668 |
+
|
2669 |
+
return $inverse && !$abs ? -$diff : $diff;
|
2670 |
+
}
|
2671 |
+
|
2672 |
+
/**
|
2673 |
+
* Get the difference in weekdays
|
2674 |
+
*
|
2675 |
+
* @param \Carbon\Carbon|null $dt
|
2676 |
+
* @param bool $abs Get the absolute of the difference
|
2677 |
+
*
|
2678 |
+
* @return int
|
2679 |
+
*/
|
2680 |
+
public function diffInWeekdays(Carbon $dt = null, $abs = true)
|
2681 |
+
{
|
2682 |
+
return $this->diffInDaysFiltered(function (Carbon $date) {
|
2683 |
+
return $date->isWeekday();
|
2684 |
+
}, $dt, $abs);
|
2685 |
+
}
|
2686 |
+
|
2687 |
+
/**
|
2688 |
+
* Get the difference in weekend days using a filter
|
2689 |
+
*
|
2690 |
+
* @param \Carbon\Carbon|null $dt
|
2691 |
+
* @param bool $abs Get the absolute of the difference
|
2692 |
+
*
|
2693 |
+
* @return int
|
2694 |
+
*/
|
2695 |
+
public function diffInWeekendDays(Carbon $dt = null, $abs = true)
|
2696 |
+
{
|
2697 |
+
return $this->diffInDaysFiltered(function (Carbon $date) {
|
2698 |
+
return $date->isWeekend();
|
2699 |
+
}, $dt, $abs);
|
2700 |
+
}
|
2701 |
+
|
2702 |
+
/**
|
2703 |
+
* Get the difference in hours
|
2704 |
+
*
|
2705 |
+
* @param \Carbon\Carbon|null $dt
|
2706 |
+
* @param bool $abs Get the absolute of the difference
|
2707 |
+
*
|
2708 |
+
* @return int
|
2709 |
+
*/
|
2710 |
+
public function diffInHours(Carbon $dt = null, $abs = true)
|
2711 |
+
{
|
2712 |
+
return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
|
2713 |
+
}
|
2714 |
+
|
2715 |
+
/**
|
2716 |
+
* Get the difference in minutes
|
2717 |
+
*
|
2718 |
+
* @param \Carbon\Carbon|null $dt
|
2719 |
+
* @param bool $abs Get the absolute of the difference
|
2720 |
+
*
|
2721 |
+
* @return int
|
2722 |
+
*/
|
2723 |
+
public function diffInMinutes(Carbon $dt = null, $abs = true)
|
2724 |
+
{
|
2725 |
+
return (int) ($this->diffInSeconds($dt, $abs) / static::SECONDS_PER_MINUTE);
|
2726 |
+
}
|
2727 |
+
|
2728 |
+
/**
|
2729 |
+
* Get the difference in seconds
|
2730 |
+
*
|
2731 |
+
* @param \Carbon\Carbon|null $dt
|
2732 |
+
* @param bool $abs Get the absolute of the difference
|
2733 |
+
*
|
2734 |
+
* @return int
|
2735 |
+
*/
|
2736 |
+
public function diffInSeconds(Carbon $dt = null, $abs = true)
|
2737 |
+
{
|
2738 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2739 |
+
$value = $dt->getTimestamp() - $this->getTimestamp();
|
2740 |
+
|
2741 |
+
return $abs ? abs($value) : $value;
|
2742 |
+
}
|
2743 |
+
|
2744 |
+
/**
|
2745 |
+
* The number of seconds since midnight.
|
2746 |
+
*
|
2747 |
+
* @return int
|
2748 |
+
*/
|
2749 |
+
public function secondsSinceMidnight()
|
2750 |
+
{
|
2751 |
+
return $this->diffInSeconds($this->copy()->startOfDay());
|
2752 |
+
}
|
2753 |
+
|
2754 |
+
/**
|
2755 |
+
* The number of seconds until 23:23:59.
|
2756 |
+
*
|
2757 |
+
* @return int
|
2758 |
+
*/
|
2759 |
+
public function secondsUntilEndOfDay()
|
2760 |
+
{
|
2761 |
+
return $this->diffInSeconds($this->copy()->endOfDay());
|
2762 |
+
}
|
2763 |
+
|
2764 |
+
/**
|
2765 |
+
* Get the difference in a human readable format in the current locale.
|
2766 |
+
*
|
2767 |
+
* When comparing a value in the past to default now:
|
2768 |
+
* 1 hour ago
|
2769 |
+
* 5 months ago
|
2770 |
+
*
|
2771 |
+
* When comparing a value in the future to default now:
|
2772 |
+
* 1 hour from now
|
2773 |
+
* 5 months from now
|
2774 |
+
*
|
2775 |
+
* When comparing a value in the past to another value:
|
2776 |
+
* 1 hour before
|
2777 |
+
* 5 months before
|
2778 |
+
*
|
2779 |
+
* When comparing a value in the future to another value:
|
2780 |
+
* 1 hour after
|
2781 |
+
* 5 months after
|
2782 |
+
*
|
2783 |
+
* @param Carbon|null $other
|
2784 |
+
* @param bool $absolute removes time difference modifiers ago, after, etc
|
2785 |
+
* @param bool $short displays short format of time units
|
2786 |
+
*
|
2787 |
+
* @return string
|
2788 |
+
*/
|
2789 |
+
public function diffForHumans(Carbon $other = null, $absolute = false, $short = false)
|
2790 |
+
{
|
2791 |
+
$isNow = $other === null;
|
2792 |
+
|
2793 |
+
if ($isNow) {
|
2794 |
+
$other = static::now($this->getTimezone());
|
2795 |
+
}
|
2796 |
+
|
2797 |
+
$diffInterval = $this->diff($other);
|
2798 |
+
|
2799 |
+
switch (true) {
|
2800 |
+
case $diffInterval->y > 0:
|
2801 |
+
$unit = $short ? 'y' : 'year';
|
2802 |
+
$count = $diffInterval->y;
|
2803 |
+
break;
|
2804 |
+
|
2805 |
+
case $diffInterval->m > 0:
|
2806 |
+
$unit = $short ? 'm' : 'month';
|
2807 |
+
$count = $diffInterval->m;
|
2808 |
+
break;
|
2809 |
+
|
2810 |
+
case $diffInterval->d > 0:
|
2811 |
+
$unit = $short ? 'd' : 'day';
|
2812 |
+
$count = $diffInterval->d;
|
2813 |
+
|
2814 |
+
if ($count >= static::DAYS_PER_WEEK) {
|
2815 |
+
$unit = $short ? 'w' : 'week';
|
2816 |
+
$count = (int) ($count / static::DAYS_PER_WEEK);
|
2817 |
+
}
|
2818 |
+
break;
|
2819 |
+
|
2820 |
+
case $diffInterval->h > 0:
|
2821 |
+
$unit = $short ? 'h' : 'hour';
|
2822 |
+
$count = $diffInterval->h;
|
2823 |
+
break;
|
2824 |
+
|
2825 |
+
case $diffInterval->i > 0:
|
2826 |
+
$unit = $short ? 'min' : 'minute';
|
2827 |
+
$count = $diffInterval->i;
|
2828 |
+
break;
|
2829 |
+
|
2830 |
+
default:
|
2831 |
+
$count = $diffInterval->s;
|
2832 |
+
$unit = $short ? 's' : 'second';
|
2833 |
+
break;
|
2834 |
+
}
|
2835 |
+
|
2836 |
+
if ($count === 0) {
|
2837 |
+
$count = 1;
|
2838 |
+
}
|
2839 |
+
|
2840 |
+
$time = static::translator()->transChoice($unit, $count, array(':count' => $count));
|
2841 |
+
|
2842 |
+
if ($absolute) {
|
2843 |
+
return $time;
|
2844 |
+
}
|
2845 |
+
|
2846 |
+
$isFuture = $diffInterval->invert === 1;
|
2847 |
+
|
2848 |
+
$transId = $isNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before');
|
2849 |
+
|
2850 |
+
// Some langs have special pluralization for past and future tense.
|
2851 |
+
$tryKeyExists = $unit.'_'.$transId;
|
2852 |
+
if ($tryKeyExists !== static::translator()->transChoice($tryKeyExists, $count)) {
|
2853 |
+
$time = static::translator()->transChoice($tryKeyExists, $count, array(':count' => $count));
|
2854 |
+
}
|
2855 |
+
|
2856 |
+
return static::translator()->trans($transId, array(':time' => $time));
|
2857 |
+
}
|
2858 |
+
|
2859 |
+
///////////////////////////////////////////////////////////////////
|
2860 |
+
//////////////////////////// MODIFIERS ////////////////////////////
|
2861 |
+
///////////////////////////////////////////////////////////////////
|
2862 |
+
|
2863 |
+
/**
|
2864 |
+
* Resets the time to 00:00:00
|
2865 |
+
*
|
2866 |
+
* @return static
|
2867 |
+
*/
|
2868 |
+
public function startOfDay()
|
2869 |
+
{
|
2870 |
+
return $this->setTime(0, 0, 0);
|
2871 |
+
}
|
2872 |
+
|
2873 |
+
/**
|
2874 |
+
* Resets the time to 23:59:59
|
2875 |
+
*
|
2876 |
+
* @return static
|
2877 |
+
*/
|
2878 |
+
public function endOfDay()
|
2879 |
+
{
|
2880 |
+
return $this->setTime(23, 59, 59);
|
2881 |
+
}
|
2882 |
+
|
2883 |
+
/**
|
2884 |
+
* Resets the date to the first day of the month and the time to 00:00:00
|
2885 |
+
*
|
2886 |
+
* @return static
|
2887 |
+
*/
|
2888 |
+
public function startOfMonth()
|
2889 |
+
{
|
2890 |
+
return $this->setDateTime($this->year, $this->month, 1, 0, 0, 0);
|
2891 |
+
}
|
2892 |
+
|
2893 |
+
/**
|
2894 |
+
* Resets the date to end of the month and time to 23:59:59
|
2895 |
+
*
|
2896 |
+
* @return static
|
2897 |
+
*/
|
2898 |
+
public function endOfMonth()
|
2899 |
+
{
|
2900 |
+
return $this->setDateTime($this->year, $this->month, $this->daysInMonth, 23, 59, 59);
|
2901 |
+
}
|
2902 |
+
|
2903 |
+
/**
|
2904 |
+
* Resets the date to the first day of the quarter and the time to 00:00:00
|
2905 |
+
*
|
2906 |
+
* @return static
|
2907 |
+
*/
|
2908 |
+
public function startOfQuarter()
|
2909 |
+
{
|
2910 |
+
$month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1;
|
2911 |
+
|
2912 |
+
return $this->setDateTime($this->year, $month, 1, 0, 0, 0);
|
2913 |
+
}
|
2914 |
+
|
2915 |
+
/**
|
2916 |
+
* Resets the date to end of the quarter and time to 23:59:59
|
2917 |
+
*
|
2918 |
+
* @return static
|
2919 |
+
*/
|
2920 |
+
public function endOfQuarter()
|
2921 |
+
{
|
2922 |
+
return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth();
|
2923 |
+
}
|
2924 |
+
|
2925 |
+
/**
|
2926 |
+
* Resets the date to the first day of the year and the time to 00:00:00
|
2927 |
+
*
|
2928 |
+
* @return static
|
2929 |
+
*/
|
2930 |
+
public function startOfYear()
|
2931 |
+
{
|
2932 |
+
return $this->setDateTime($this->year, 1, 1, 0, 0, 0);
|
2933 |
+
}
|
2934 |
+
|
2935 |
+
/**
|
2936 |
+
* Resets the date to end of the year and time to 23:59:59
|
2937 |
+
*
|
2938 |
+
* @return static
|
2939 |
+
*/
|
2940 |
+
public function endOfYear()
|
2941 |
+
{
|
2942 |
+
return $this->setDateTime($this->year, 12, 31, 23, 59, 59);
|
2943 |
+
}
|
2944 |
+
|
2945 |
+
/**
|
2946 |
+
* Resets the date to the first day of the decade and the time to 00:00:00
|
2947 |
+
*
|
2948 |
+
* @return static
|
2949 |
+
*/
|
2950 |
+
public function startOfDecade()
|
2951 |
+
{
|
2952 |
+
$year = $this->year - $this->year % static::YEARS_PER_DECADE;
|
2953 |
+
|
2954 |
+
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2955 |
+
}
|
2956 |
+
|
2957 |
+
/**
|
2958 |
+
* Resets the date to end of the decade and time to 23:59:59
|
2959 |
+
*
|
2960 |
+
* @return static
|
2961 |
+
*/
|
2962 |
+
public function endOfDecade()
|
2963 |
+
{
|
2964 |
+
$year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1;
|
2965 |
+
|
2966 |
+
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2967 |
+
}
|
2968 |
+
|
2969 |
+
/**
|
2970 |
+
* Resets the date to the first day of the century and the time to 00:00:00
|
2971 |
+
*
|
2972 |
+
* @return static
|
2973 |
+
*/
|
2974 |
+
public function startOfCentury()
|
2975 |
+
{
|
2976 |
+
$year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY;
|
2977 |
+
|
2978 |
+
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2979 |
+
}
|
2980 |
+
|
2981 |
+
/**
|
2982 |
+
* Resets the date to end of the century and time to 23:59:59
|
2983 |
+
*
|
2984 |
+
* @return static
|
2985 |
+
*/
|
2986 |
+
public function endOfCentury()
|
2987 |
+
{
|
2988 |
+
$year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY;
|
2989 |
+
|
2990 |
+
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2991 |
+
}
|
2992 |
+
|
2993 |
+
/**
|
2994 |
+
* Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
|
2995 |
+
*
|
2996 |
+
* @return static
|
2997 |
+
*/
|
2998 |
+
public function startOfWeek()
|
2999 |
+
{
|
3000 |
+
while ($this->dayOfWeek !== static::$weekStartsAt) {
|
3001 |
+
$this->subDay();
|
3002 |
+
}
|
3003 |
+
|
3004 |
+
return $this->startOfDay();
|
3005 |
+
}
|
3006 |
+
|
3007 |
+
/**
|
3008 |
+
* Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59
|
3009 |
+
*
|
3010 |
+
* @return static
|
3011 |
+
*/
|
3012 |
+
public function endOfWeek()
|
3013 |
+
{
|
3014 |
+
while ($this->dayOfWeek !== static::$weekEndsAt) {
|
3015 |
+
$this->addDay();
|
3016 |
+
}
|
3017 |
+
|
3018 |
+
return $this->endOfDay();
|
3019 |
+
}
|
3020 |
+
|
3021 |
+
/**
|
3022 |
+
* Modify to the next occurrence of a given day of the week.
|
3023 |
+
* If no dayOfWeek is provided, modify to the next occurrence
|
3024 |
+
* of the current day of the week. Use the supplied constants
|
3025 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3026 |
+
*
|
3027 |
+
* @param int|null $dayOfWeek
|
3028 |
+
*
|
3029 |
+
* @return static
|
3030 |
+
*/
|
3031 |
+
public function next($dayOfWeek = null)
|
3032 |
+
{
|
3033 |
+
if ($dayOfWeek === null) {
|
3034 |
+
$dayOfWeek = $this->dayOfWeek;
|
3035 |
+
}
|
3036 |
+
|
3037 |
+
return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
|
3038 |
+
}
|
3039 |
+
|
3040 |
+
/**
|
3041 |
+
* Go forward or backward to the next week- or weekend-day.
|
3042 |
+
*
|
3043 |
+
* @param bool $weekday
|
3044 |
+
* @param bool $forward
|
3045 |
+
*
|
3046 |
+
* @return static
|
3047 |
+
*/
|
3048 |
+
private function nextOrPreviousDay($weekday = true, $forward = true)
|
3049 |
+
{
|
3050 |
+
$step = $forward ? 1 : -1;
|
3051 |
+
|
3052 |
+
do {
|
3053 |
+
$this->addDay($step);
|
3054 |
+
} while ($weekday ? $this->isWeekend() : $this->isWeekday());
|
3055 |
+
|
3056 |
+
return $this;
|
3057 |
+
}
|
3058 |
+
|
3059 |
+
/**
|
3060 |
+
* Go forward to the next weekday.
|
3061 |
+
*
|
3062 |
+
* @return $this
|
3063 |
+
*/
|
3064 |
+
public function nextWeekday()
|
3065 |
+
{
|
3066 |
+
return $this->nextOrPreviousDay();
|
3067 |
+
}
|
3068 |
+
|
3069 |
+
/**
|
3070 |
+
* Go backward to the previous weekday.
|
3071 |
+
*
|
3072 |
+
* @return static
|
3073 |
+
*/
|
3074 |
+
public function previousWeekday()
|
3075 |
+
{
|
3076 |
+
return $this->nextOrPreviousDay(true, false);
|
3077 |
+
}
|
3078 |
+
|
3079 |
+
/**
|
3080 |
+
* Go forward to the next weekend day.
|
3081 |
+
*
|
3082 |
+
* @return static
|
3083 |
+
*/
|
3084 |
+
public function nextWeekendDay()
|
3085 |
+
{
|
3086 |
+
return $this->nextOrPreviousDay(false);
|
3087 |
+
}
|
3088 |
+
|
3089 |
+
/**
|
3090 |
+
* Go backward to the previous weekend day.
|
3091 |
+
*
|
3092 |
+
* @return static
|
3093 |
+
*/
|
3094 |
+
public function previousWeekendDay()
|
3095 |
+
{
|
3096 |
+
return $this->nextOrPreviousDay(false, false);
|
3097 |
+
}
|
3098 |
+
|
3099 |
+
/**
|
3100 |
+
* Modify to the previous occurrence of a given day of the week.
|
3101 |
+
* If no dayOfWeek is provided, modify to the previous occurrence
|
3102 |
+
* of the current day of the week. Use the supplied constants
|
3103 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3104 |
+
*
|
3105 |
+
* @param int|null $dayOfWeek
|
3106 |
+
*
|
3107 |
+
* @return static
|
3108 |
+
*/
|
3109 |
+
public function previous($dayOfWeek = null)
|
3110 |
+
{
|
3111 |
+
if ($dayOfWeek === null) {
|
3112 |
+
$dayOfWeek = $this->dayOfWeek;
|
3113 |
+
}
|
3114 |
+
|
3115 |
+
return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]);
|
3116 |
+
}
|
3117 |
+
|
3118 |
+
/**
|
3119 |
+
* Modify to the first occurrence of a given day of the week
|
3120 |
+
* in the current month. If no dayOfWeek is provided, modify to the
|
3121 |
+
* first day of the current month. Use the supplied constants
|
3122 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3123 |
+
*
|
3124 |
+
* @param int|null $dayOfWeek
|
3125 |
+
*
|
3126 |
+
* @return static
|
3127 |
+
*/
|
3128 |
+
public function firstOfMonth($dayOfWeek = null)
|
3129 |
+
{
|
3130 |
+
$this->startOfDay();
|
3131 |
+
|
3132 |
+
if ($dayOfWeek === null) {
|
3133 |
+
return $this->day(1);
|
3134 |
+
}
|
3135 |
+
|
3136 |
+
return $this->modify('first '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year);
|
3137 |
+
}
|
3138 |
+
|
3139 |
+
/**
|
3140 |
+
* Modify to the last occurrence of a given day of the week
|
3141 |
+
* in the current month. If no dayOfWeek is provided, modify to the
|
3142 |
+
* last day of the current month. Use the supplied constants
|
3143 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3144 |
+
*
|
3145 |
+
* @param int|null $dayOfWeek
|
3146 |
+
*
|
3147 |
+
* @return static
|
3148 |
+
*/
|
3149 |
+
public function lastOfMonth($dayOfWeek = null)
|
3150 |
+
{
|
3151 |
+
$this->startOfDay();
|
3152 |
+
|
3153 |
+
if ($dayOfWeek === null) {
|
3154 |
+
return $this->day($this->daysInMonth);
|
3155 |
+
}
|
3156 |
+
|
3157 |
+
return $this->modify('last '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year);
|
3158 |
+
}
|
3159 |
+
|
3160 |
+
/**
|
3161 |
+
* Modify to the given occurrence of a given day of the week
|
3162 |
+
* in the current month. If the calculated occurrence is outside the scope
|
3163 |
+
* of the current month, then return false and no modifications are made.
|
3164 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3165 |
+
*
|
3166 |
+
* @param int $nth
|
3167 |
+
* @param int $dayOfWeek
|
3168 |
+
*
|
3169 |
+
* @return mixed
|
3170 |
+
*/
|
3171 |
+
public function nthOfMonth($nth, $dayOfWeek)
|
3172 |
+
{
|
3173 |
+
$dt = $this->copy()->firstOfMonth();
|
3174 |
+
$check = $dt->format('Y-m');
|
3175 |
+
$dt->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3176 |
+
|
3177 |
+
return $dt->format('Y-m') === $check ? $this->modify($dt) : false;
|
3178 |
+
}
|
3179 |
+
|
3180 |
+
/**
|
3181 |
+
* Modify to the first occurrence of a given day of the week
|
3182 |
+
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3183 |
+
* first day of the current quarter. Use the supplied constants
|
3184 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3185 |
+
*
|
3186 |
+
* @param int|null $dayOfWeek
|
3187 |
+
*
|
3188 |
+
* @return static
|
3189 |
+
*/
|
3190 |
+
public function firstOfQuarter($dayOfWeek = null)
|
3191 |
+
{
|
3192 |
+
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek);
|
3193 |
+
}
|
3194 |
+
|
3195 |
+
/**
|
3196 |
+
* Modify to the last occurrence of a given day of the week
|
3197 |
+
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3198 |
+
* last day of the current quarter. Use the supplied constants
|
3199 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3200 |
+
*
|
3201 |
+
* @param int|null $dayOfWeek
|
3202 |
+
*
|
3203 |
+
* @return static
|
3204 |
+
*/
|
3205 |
+
public function lastOfQuarter($dayOfWeek = null)
|
3206 |
+
{
|
3207 |
+
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek);
|
3208 |
+
}
|
3209 |
+
|
3210 |
+
/**
|
3211 |
+
* Modify to the given occurrence of a given day of the week
|
3212 |
+
* in the current quarter. If the calculated occurrence is outside the scope
|
3213 |
+
* of the current quarter, then return false and no modifications are made.
|
3214 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3215 |
+
*
|
3216 |
+
* @param int $nth
|
3217 |
+
* @param int $dayOfWeek
|
3218 |
+
*
|
3219 |
+
* @return mixed
|
3220 |
+
*/
|
3221 |
+
public function nthOfQuarter($nth, $dayOfWeek)
|
3222 |
+
{
|
3223 |
+
$dt = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER);
|
3224 |
+
$lastMonth = $dt->month;
|
3225 |
+
$year = $dt->year;
|
3226 |
+
$dt->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3227 |
+
|
3228 |
+
return ($lastMonth < $dt->month || $year !== $dt->year) ? false : $this->modify($dt);
|
3229 |
+
}
|
3230 |
+
|
3231 |
+
/**
|
3232 |
+
* Modify to the first occurrence of a given day of the week
|
3233 |
+
* in the current year. If no dayOfWeek is provided, modify to the
|
3234 |
+
* first day of the current year. Use the supplied constants
|
3235 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3236 |
+
*
|
3237 |
+
* @param int|null $dayOfWeek
|
3238 |
+
*
|
3239 |
+
* @return static
|
3240 |
+
*/
|
3241 |
+
public function firstOfYear($dayOfWeek = null)
|
3242 |
+
{
|
3243 |
+
return $this->month(1)->firstOfMonth($dayOfWeek);
|
3244 |
+
}
|
3245 |
+
|
3246 |
+
/**
|
3247 |
+
* Modify to the last occurrence of a given day of the week
|
3248 |
+
* in the current year. If no dayOfWeek is provided, modify to the
|
3249 |
+
* last day of the current year. Use the supplied constants
|
3250 |
+
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3251 |
+
*
|
3252 |
+
* @param int|null $dayOfWeek
|
3253 |
+
*
|
3254 |
+
* @return static
|
3255 |
+
*/
|
3256 |
+
public function lastOfYear($dayOfWeek = null)
|
3257 |
+
{
|
3258 |
+
return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek);
|
3259 |
+
}
|
3260 |
+
|
3261 |
+
/**
|
3262 |
+
* Modify to the given occurrence of a given day of the week
|
3263 |
+
* in the current year. If the calculated occurrence is outside the scope
|
3264 |
+
* of the current year, then return false and no modifications are made.
|
3265 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3266 |
+
*
|
3267 |
+
* @param int $nth
|
3268 |
+
* @param int $dayOfWeek
|
3269 |
+
*
|
3270 |
+
* @return mixed
|
3271 |
+
*/
|
3272 |
+
public function nthOfYear($nth, $dayOfWeek)
|
3273 |
+
{
|
3274 |
+
$dt = $this->copy()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3275 |
+
|
3276 |
+
return $this->year === $dt->year ? $this->modify($dt) : false;
|
3277 |
+
}
|
3278 |
+
|
3279 |
+
/**
|
3280 |
+
* Modify the current instance to the average of a given instance (default now) and the current instance.
|
3281 |
+
*
|
3282 |
+
* @param \Carbon\Carbon|null $dt
|
3283 |
+
*
|
3284 |
+
* @return static
|
3285 |
+
*/
|
3286 |
+
public function average(Carbon $dt = null)
|
3287 |
+
{
|
3288 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
3289 |
+
|
3290 |
+
return $this->addSeconds((int) ($this->diffInSeconds($dt, false) / 2));
|
3291 |
+
}
|
3292 |
+
|
3293 |
+
/**
|
3294 |
+
* Check if its the birthday. Compares the date/month values of the two dates.
|
3295 |
+
*
|
3296 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
3297 |
+
*
|
3298 |
+
* @return bool
|
3299 |
+
*/
|
3300 |
+
public function isBirthday(Carbon $dt = null)
|
3301 |
+
{
|
3302 |
+
return $this->isSameAs('md', $dt);
|
3303 |
+
}
|
3304 |
+
|
3305 |
+
/**
|
3306 |
+
* Consider the timezone when modifying the instance.
|
3307 |
+
*
|
3308 |
+
* @param string $modify
|
3309 |
+
*
|
3310 |
+
* @return static
|
3311 |
+
*/
|
3312 |
+
public function modify($modify)
|
3313 |
+
{
|
3314 |
+
if ($this->local) {
|
3315 |
+
return parent::modify($modify);
|
3316 |
+
}
|
3317 |
+
|
3318 |
+
$timezone = $this->getTimezone();
|
3319 |
+
$this->setTimezone('UTC');
|
3320 |
+
$instance = parent::modify($modify);
|
3321 |
+
$this->setTimezone($timezone);
|
3322 |
+
|
3323 |
+
return $instance;
|
3324 |
+
}
|
3325 |
+
|
3326 |
+
/**
|
3327 |
+
* Return a serialized string of the instance.
|
3328 |
+
*
|
3329 |
+
* @return string
|
3330 |
+
*/
|
3331 |
+
public function serialize()
|
3332 |
+
{
|
3333 |
+
return serialize($this);
|
3334 |
+
}
|
3335 |
+
|
3336 |
+
/**
|
3337 |
+
* Create an instance form a serialized string.
|
3338 |
+
*
|
3339 |
+
* @param string $value
|
3340 |
+
*
|
3341 |
+
* @throws \InvalidArgumentException
|
3342 |
+
*
|
3343 |
+
* @return static
|
3344 |
+
*/
|
3345 |
+
public static function fromSerialized($value)
|
3346 |
+
{
|
3347 |
+
$instance = @unserialize($value);
|
3348 |
+
|
3349 |
+
if (!$instance instanceof static) {
|
3350 |
+
throw new InvalidArgumentException('Invalid serialized value.');
|
3351 |
+
}
|
3352 |
+
|
3353 |
+
return $instance;
|
3354 |
+
}
|
3355 |
+
}
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/CarbonInterval.php
RENAMED
@@ -1,557 +1,557 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Carbon;
|
13 |
-
|
14 |
-
use DateInterval;
|
15 |
-
use InvalidArgumentException;
|
16 |
-
use Symfony\Component\Translation\Loader\ArrayLoader;
|
17 |
-
use Symfony\Component\Translation\Translator;
|
18 |
-
use Symfony\Component\Translation\TranslatorInterface;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* A simple API extension for DateInterval.
|
22 |
-
* The implementation provides helpers to handle weeks but only days are saved.
|
23 |
-
* Weeks are calculated based on the total days of the current instance.
|
24 |
-
*
|
25 |
-
* @property int $years Total years of the current interval.
|
26 |
-
* @property int $months Total months of the current interval.
|
27 |
-
* @property int $weeks Total weeks of the current interval calculated from the days.
|
28 |
-
* @property int $dayz Total days of the current interval (weeks * 7 + days).
|
29 |
-
* @property int $hours Total hours of the current interval.
|
30 |
-
* @property int $minutes Total minutes of the current interval.
|
31 |
-
* @property int $seconds Total seconds of the current interval.
|
32 |
-
* @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
|
33 |
-
* @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks
|
34 |
-
*
|
35 |
-
* @method static CarbonInterval years($years = 1) Create instance specifying a number of years.
|
36 |
-
* @method static CarbonInterval year($years = 1) Alias for years()
|
37 |
-
* @method static CarbonInterval months($months = 1) Create instance specifying a number of months.
|
38 |
-
* @method static CarbonInterval month($months = 1) Alias for months()
|
39 |
-
* @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks.
|
40 |
-
* @method static CarbonInterval week($weeks = 1) Alias for weeks()
|
41 |
-
* @method static CarbonInterval days($days = 1) Create instance specifying a number of days.
|
42 |
-
* @method static CarbonInterval dayz($days = 1) Alias for days()
|
43 |
-
* @method static CarbonInterval day($days = 1) Alias for days()
|
44 |
-
* @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours.
|
45 |
-
* @method static CarbonInterval hour($hours = 1) Alias for hours()
|
46 |
-
* @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes.
|
47 |
-
* @method static CarbonInterval minute($minutes = 1) Alias for minutes()
|
48 |
-
* @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds.
|
49 |
-
* @method static CarbonInterval second($seconds = 1) Alias for seconds()
|
50 |
-
* @method CarbonInterval years() years($years = 1) Set the years portion of the current interval.
|
51 |
-
* @method CarbonInterval year() year($years = 1) Alias for years().
|
52 |
-
* @method CarbonInterval months() months($months = 1) Set the months portion of the current interval.
|
53 |
-
* @method CarbonInterval month() month($months = 1) Alias for months().
|
54 |
-
* @method CarbonInterval weeks() weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value.
|
55 |
-
* @method CarbonInterval week() week($weeks = 1) Alias for weeks().
|
56 |
-
* @method CarbonInterval days() days($days = 1) Set the days portion of the current interval.
|
57 |
-
* @method CarbonInterval dayz() dayz($days = 1) Alias for days().
|
58 |
-
* @method CarbonInterval day() day($days = 1) Alias for days().
|
59 |
-
* @method CarbonInterval hours() hours($hours = 1) Set the hours portion of the current interval.
|
60 |
-
* @method CarbonInterval hour() hour($hours = 1) Alias for hours().
|
61 |
-
* @method CarbonInterval minutes() minutes($minutes = 1) Set the minutes portion of the current interval.
|
62 |
-
* @method CarbonInterval minute() minute($minutes = 1) Alias for minutes().
|
63 |
-
* @method CarbonInterval seconds() seconds($seconds = 1) Set the seconds portion of the current interval.
|
64 |
-
* @method CarbonInterval second() second($seconds = 1) Alias for seconds().
|
65 |
-
*/
|
66 |
-
class CarbonInterval extends DateInterval
|
67 |
-
{
|
68 |
-
/**
|
69 |
-
* Interval spec period designators
|
70 |
-
*/
|
71 |
-
const PERIOD_PREFIX = 'P';
|
72 |
-
const PERIOD_YEARS = 'Y';
|
73 |
-
const PERIOD_MONTHS = 'M';
|
74 |
-
const PERIOD_DAYS = 'D';
|
75 |
-
const PERIOD_TIME_PREFIX = 'T';
|
76 |
-
const PERIOD_HOURS = 'H';
|
77 |
-
const PERIOD_MINUTES = 'M';
|
78 |
-
const PERIOD_SECONDS = 'S';
|
79 |
-
|
80 |
-
/**
|
81 |
-
* A translator to ... er ... translate stuff
|
82 |
-
*
|
83 |
-
* @var \Symfony\Component\Translation\TranslatorInterface
|
84 |
-
*/
|
85 |
-
protected static $translator;
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Before PHP 5.4.20/5.5.4 instead of FALSE days will be set to -99999 when the interval instance
|
89 |
-
* was created by DateTime:diff().
|
90 |
-
*/
|
91 |
-
const PHP_DAYS_FALSE = -99999;
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Determine if the interval was created via DateTime:diff() or not.
|
95 |
-
*
|
96 |
-
* @param DateInterval $interval
|
97 |
-
*
|
98 |
-
* @return bool
|
99 |
-
*/
|
100 |
-
private static function wasCreatedFromDiff(DateInterval $interval)
|
101 |
-
{
|
102 |
-
return $interval->days !== false && $interval->days !== static::PHP_DAYS_FALSE;
|
103 |
-
}
|
104 |
-
|
105 |
-
///////////////////////////////////////////////////////////////////
|
106 |
-
//////////////////////////// CONSTRUCTORS /////////////////////////
|
107 |
-
///////////////////////////////////////////////////////////////////
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Create a new CarbonInterval instance.
|
111 |
-
*
|
112 |
-
* @param int $years
|
113 |
-
* @param int $months
|
114 |
-
* @param int $weeks
|
115 |
-
* @param int $days
|
116 |
-
* @param int $hours
|
117 |
-
* @param int $minutes
|
118 |
-
* @param int $seconds
|
119 |
-
*/
|
120 |
-
public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
|
121 |
-
{
|
122 |
-
$spec = static::PERIOD_PREFIX;
|
123 |
-
|
124 |
-
$spec .= $years > 0 ? $years.static::PERIOD_YEARS : '';
|
125 |
-
$spec .= $months > 0 ? $months.static::PERIOD_MONTHS : '';
|
126 |
-
|
127 |
-
$specDays = 0;
|
128 |
-
$specDays += $weeks > 0 ? $weeks * Carbon::DAYS_PER_WEEK : 0;
|
129 |
-
$specDays += $days > 0 ? $days : 0;
|
130 |
-
|
131 |
-
$spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : '';
|
132 |
-
|
133 |
-
if ($hours > 0 || $minutes > 0 || $seconds > 0) {
|
134 |
-
$spec .= static::PERIOD_TIME_PREFIX;
|
135 |
-
$spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : '';
|
136 |
-
$spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : '';
|
137 |
-
$spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : '';
|
138 |
-
}
|
139 |
-
|
140 |
-
if ($spec === static::PERIOD_PREFIX) {
|
141 |
-
// Allow the zero interval.
|
142 |
-
$spec .= '0'.static::PERIOD_YEARS;
|
143 |
-
}
|
144 |
-
|
145 |
-
parent::__construct($spec);
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Create a new CarbonInterval instance from specific values.
|
150 |
-
* This is an alias for the constructor that allows better fluent
|
151 |
-
* syntax as it allows you to do CarbonInterval::create(1)->fn() rather than
|
152 |
-
* (new CarbonInterval(1))->fn().
|
153 |
-
*
|
154 |
-
* @param int $years
|
155 |
-
* @param int $months
|
156 |
-
* @param int $weeks
|
157 |
-
* @param int $days
|
158 |
-
* @param int $hours
|
159 |
-
* @param int $minutes
|
160 |
-
* @param int $seconds
|
161 |
-
*
|
162 |
-
* @return static
|
163 |
-
*/
|
164 |
-
public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
|
165 |
-
{
|
166 |
-
return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds);
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Provide static helpers to create instances. Allows CarbonInterval::years(3).
|
171 |
-
*
|
172 |
-
* Note: This is done using the magic method to allow static and instance methods to
|
173 |
-
* have the same names.
|
174 |
-
*
|
175 |
-
* @param string $name
|
176 |
-
* @param array $args
|
177 |
-
*
|
178 |
-
* @return static
|
179 |
-
*/
|
180 |
-
public static function __callStatic($name, $args)
|
181 |
-
{
|
182 |
-
$arg = count($args) === 0 ? 1 : $args[0];
|
183 |
-
|
184 |
-
switch ($name) {
|
185 |
-
case 'years':
|
186 |
-
case 'year':
|
187 |
-
return new static($arg);
|
188 |
-
|
189 |
-
case 'months':
|
190 |
-
case 'month':
|
191 |
-
return new static(null, $arg);
|
192 |
-
|
193 |
-
case 'weeks':
|
194 |
-
case 'week':
|
195 |
-
return new static(null, null, $arg);
|
196 |
-
|
197 |
-
case 'days':
|
198 |
-
case 'dayz':
|
199 |
-
case 'day':
|
200 |
-
return new static(null, null, null, $arg);
|
201 |
-
|
202 |
-
case 'hours':
|
203 |
-
case 'hour':
|
204 |
-
return new static(null, null, null, null, $arg);
|
205 |
-
|
206 |
-
case 'minutes':
|
207 |
-
case 'minute':
|
208 |
-
return new static(null, null, null, null, null, $arg);
|
209 |
-
|
210 |
-
case 'seconds':
|
211 |
-
case 'second':
|
212 |
-
return new static(null, null, null, null, null, null, $arg);
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Create a CarbonInterval instance from a DateInterval one. Can not instance
|
218 |
-
* DateInterval objects created from DateTime::diff() as you can't externally
|
219 |
-
* set the $days field.
|
220 |
-
*
|
221 |
-
* @param DateInterval $di
|
222 |
-
*
|
223 |
-
* @throws \InvalidArgumentException
|
224 |
-
*
|
225 |
-
* @return static
|
226 |
-
*/
|
227 |
-
public static function instance(DateInterval $di)
|
228 |
-
{
|
229 |
-
if (static::wasCreatedFromDiff($di)) {
|
230 |
-
throw new InvalidArgumentException('Can not instance a DateInterval object created from DateTime::diff().');
|
231 |
-
}
|
232 |
-
|
233 |
-
$instance = new static($di->y, $di->m, 0, $di->d, $di->h, $di->i, $di->s);
|
234 |
-
$instance->invert = $di->invert;
|
235 |
-
$instance->days = $di->days;
|
236 |
-
|
237 |
-
return $instance;
|
238 |
-
}
|
239 |
-
|
240 |
-
///////////////////////////////////////////////////////////////////
|
241 |
-
/////////////////////// LOCALIZATION //////////////////////////////
|
242 |
-
///////////////////////////////////////////////////////////////////
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Initialize the translator instance if necessary.
|
246 |
-
*
|
247 |
-
* @return \Symfony\Component\Translation\TranslatorInterface
|
248 |
-
*/
|
249 |
-
protected static function translator()
|
250 |
-
{
|
251 |
-
if (static::$translator === null) {
|
252 |
-
static::$translator = new Translator('en');
|
253 |
-
static::$translator->addLoader('array', new ArrayLoader());
|
254 |
-
static::setLocale('en');
|
255 |
-
}
|
256 |
-
|
257 |
-
return static::$translator;
|
258 |
-
}
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Get the translator instance in use
|
262 |
-
*
|
263 |
-
* @return \Symfony\Component\Translation\TranslatorInterface
|
264 |
-
*/
|
265 |
-
public static function getTranslator()
|
266 |
-
{
|
267 |
-
return static::translator();
|
268 |
-
}
|
269 |
-
|
270 |
-
/**
|
271 |
-
* Set the translator instance to use
|
272 |
-
*
|
273 |
-
* @param TranslatorInterface $translator
|
274 |
-
*/
|
275 |
-
public static function setTranslator(TranslatorInterface $translator)
|
276 |
-
{
|
277 |
-
static::$translator = $translator;
|
278 |
-
}
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Get the current translator locale
|
282 |
-
*
|
283 |
-
* @return string
|
284 |
-
*/
|
285 |
-
public static function getLocale()
|
286 |
-
{
|
287 |
-
return static::translator()->getLocale();
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* Set the current translator locale
|
292 |
-
*
|
293 |
-
* @param string $locale
|
294 |
-
*/
|
295 |
-
public static function setLocale($locale)
|
296 |
-
{
|
297 |
-
static::translator()->setLocale($locale);
|
298 |
-
|
299 |
-
// Ensure the locale has been loaded.
|
300 |
-
static::translator()->addResource('array', require __DIR__.'/Lang/'.$locale.'.php', $locale);
|
301 |
-
}
|
302 |
-
|
303 |
-
///////////////////////////////////////////////////////////////////
|
304 |
-
///////////////////////// GETTERS AND SETTERS /////////////////////
|
305 |
-
///////////////////////////////////////////////////////////////////
|
306 |
-
|
307 |
-
/**
|
308 |
-
* Get a part of the CarbonInterval object
|
309 |
-
*
|
310 |
-
* @param string $name
|
311 |
-
*
|
312 |
-
* @throws \InvalidArgumentException
|
313 |
-
*
|
314 |
-
* @return int
|
315 |
-
*/
|
316 |
-
public function __get($name)
|
317 |
-
{
|
318 |
-
switch ($name) {
|
319 |
-
case 'years':
|
320 |
-
return $this->y;
|
321 |
-
|
322 |
-
case 'months':
|
323 |
-
return $this->m;
|
324 |
-
|
325 |
-
case 'dayz':
|
326 |
-
return $this->d;
|
327 |
-
|
328 |
-
case 'hours':
|
329 |
-
return $this->h;
|
330 |
-
|
331 |
-
case 'minutes':
|
332 |
-
return $this->i;
|
333 |
-
|
334 |
-
case 'seconds':
|
335 |
-
return $this->s;
|
336 |
-
|
337 |
-
case 'weeks':
|
338 |
-
return (int) floor($this->d / Carbon::DAYS_PER_WEEK);
|
339 |
-
|
340 |
-
case 'daysExcludeWeeks':
|
341 |
-
case 'dayzExcludeWeeks':
|
342 |
-
return $this->d % Carbon::DAYS_PER_WEEK;
|
343 |
-
|
344 |
-
default:
|
345 |
-
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
|
346 |
-
}
|
347 |
-
}
|
348 |
-
|
349 |
-
/**
|
350 |
-
* Set a part of the CarbonInterval object
|
351 |
-
*
|
352 |
-
* @param string $name
|
353 |
-
* @param int $val
|
354 |
-
*
|
355 |
-
* @throws \InvalidArgumentException
|
356 |
-
*/
|
357 |
-
public function __set($name, $val)
|
358 |
-
{
|
359 |
-
switch ($name) {
|
360 |
-
case 'years':
|
361 |
-
$this->y = $val;
|
362 |
-
break;
|
363 |
-
|
364 |
-
case 'months':
|
365 |
-
$this->m = $val;
|
366 |
-
break;
|
367 |
-
|
368 |
-
case 'weeks':
|
369 |
-
$this->d = $val * Carbon::DAYS_PER_WEEK;
|
370 |
-
break;
|
371 |
-
|
372 |
-
case 'dayz':
|
373 |
-
$this->d = $val;
|
374 |
-
break;
|
375 |
-
|
376 |
-
case 'hours':
|
377 |
-
$this->h = $val;
|
378 |
-
break;
|
379 |
-
|
380 |
-
case 'minutes':
|
381 |
-
$this->i = $val;
|
382 |
-
break;
|
383 |
-
|
384 |
-
case 'seconds':
|
385 |
-
$this->s = $val;
|
386 |
-
break;
|
387 |
-
}
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Allow setting of weeks and days to be cumulative.
|
392 |
-
*
|
393 |
-
* @param int $weeks Number of weeks to set
|
394 |
-
* @param int $days Number of days to set
|
395 |
-
*
|
396 |
-
* @return static
|
397 |
-
*/
|
398 |
-
public function weeksAndDays($weeks, $days)
|
399 |
-
{
|
400 |
-
$this->dayz = ($weeks * Carbon::DAYS_PER_WEEK) + $days;
|
401 |
-
|
402 |
-
return $this;
|
403 |
-
}
|
404 |
-
|
405 |
-
/**
|
406 |
-
* Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day().
|
407 |
-
*
|
408 |
-
* Note: This is done using the magic method to allow static and instance methods to
|
409 |
-
* have the same names.
|
410 |
-
*
|
411 |
-
* @param string $name
|
412 |
-
* @param array $args
|
413 |
-
*
|
414 |
-
* @return static
|
415 |
-
*/
|
416 |
-
public function __call($name, $args)
|
417 |
-
{
|
418 |
-
$arg = count($args) === 0 ? 1 : $args[0];
|
419 |
-
|
420 |
-
switch ($name) {
|
421 |
-
case 'years':
|
422 |
-
case 'year':
|
423 |
-
$this->years = $arg;
|
424 |
-
break;
|
425 |
-
|
426 |
-
case 'months':
|
427 |
-
case 'month':
|
428 |
-
$this->months = $arg;
|
429 |
-
break;
|
430 |
-
|
431 |
-
case 'weeks':
|
432 |
-
case 'week':
|
433 |
-
$this->dayz = $arg * Carbon::DAYS_PER_WEEK;
|
434 |
-
break;
|
435 |
-
|
436 |
-
case 'days':
|
437 |
-
case 'dayz':
|
438 |
-
case 'day':
|
439 |
-
$this->dayz = $arg;
|
440 |
-
break;
|
441 |
-
|
442 |
-
case 'hours':
|
443 |
-
case 'hour':
|
444 |
-
$this->hours = $arg;
|
445 |
-
break;
|
446 |
-
|
447 |
-
case 'minutes':
|
448 |
-
case 'minute':
|
449 |
-
$this->minutes = $arg;
|
450 |
-
break;
|
451 |
-
|
452 |
-
case 'seconds':
|
453 |
-
case 'second':
|
454 |
-
$this->seconds = $arg;
|
455 |
-
break;
|
456 |
-
}
|
457 |
-
|
458 |
-
return $this;
|
459 |
-
}
|
460 |
-
|
461 |
-
/**
|
462 |
-
* Get the current interval in a human readable format in the current locale.
|
463 |
-
*
|
464 |
-
* @return string
|
465 |
-
*/
|
466 |
-
public function forHumans()
|
467 |
-
{
|
468 |
-
$periods = array(
|
469 |
-
'year' => $this->years,
|
470 |
-
'month' => $this->months,
|
471 |
-
'week' => $this->weeks,
|
472 |
-
'day' => $this->daysExcludeWeeks,
|
473 |
-
'hour' => $this->hours,
|
474 |
-
'minute' => $this->minutes,
|
475 |
-
'second' => $this->seconds,
|
476 |
-
);
|
477 |
-
|
478 |
-
$parts = array();
|
479 |
-
foreach ($periods as $unit => $count) {
|
480 |
-
if ($count > 0) {
|
481 |
-
array_push($parts, static::translator()->transChoice($unit, $count, array(':count' => $count)));
|
482 |
-
}
|
483 |
-
}
|
484 |
-
|
485 |
-
return implode(' ', $parts);
|
486 |
-
}
|
487 |
-
|
488 |
-
/**
|
489 |
-
* Format the instance as a string using the forHumans() function.
|
490 |
-
*
|
491 |
-
* @return string
|
492 |
-
*/
|
493 |
-
public function __toString()
|
494 |
-
{
|
495 |
-
return $this->forHumans();
|
496 |
-
}
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Add the passed interval to the current instance
|
500 |
-
*
|
501 |
-
* @param DateInterval $interval
|
502 |
-
*
|
503 |
-
* @return static
|
504 |
-
*/
|
505 |
-
public function add(DateInterval $interval)
|
506 |
-
{
|
507 |
-
$sign = $interval->invert === 1 ? -1 : 1;
|
508 |
-
|
509 |
-
if (static::wasCreatedFromDiff($interval)) {
|
510 |
-
$this->dayz += $interval->days * $sign;
|
511 |
-
} else {
|
512 |
-
$this->years += $interval->y * $sign;
|
513 |
-
$this->months += $interval->m * $sign;
|
514 |
-
$this->dayz += $interval->d * $sign;
|
515 |
-
$this->hours += $interval->h * $sign;
|
516 |
-
$this->minutes += $interval->i * $sign;
|
517 |
-
$this->seconds += $interval->s * $sign;
|
518 |
-
}
|
519 |
-
|
520 |
-
return $this;
|
521 |
-
}
|
522 |
-
|
523 |
-
/**
|
524 |
-
* Get the interval_spec string
|
525 |
-
*
|
526 |
-
* @return string
|
527 |
-
*/
|
528 |
-
public function spec()
|
529 |
-
{
|
530 |
-
$date = array_filter(array(
|
531 |
-
static::PERIOD_YEARS => $this->y,
|
532 |
-
static::PERIOD_MONTHS => $this->m,
|
533 |
-
static::PERIOD_DAYS => $this->d,
|
534 |
-
));
|
535 |
-
|
536 |
-
$time = array_filter(array(
|
537 |
-
static::PERIOD_HOURS => $this->h,
|
538 |
-
static::PERIOD_MINUTES => $this->i,
|
539 |
-
static::PERIOD_SECONDS => $this->s,
|
540 |
-
));
|
541 |
-
|
542 |
-
$specString = static::PERIOD_PREFIX;
|
543 |
-
|
544 |
-
foreach ($date as $key => $value) {
|
545 |
-
$specString .= $value.$key;
|
546 |
-
}
|
547 |
-
|
548 |
-
if (count($time) > 0) {
|
549 |
-
$specString .= static::PERIOD_TIME_PREFIX;
|
550 |
-
foreach ($time as $key => $value) {
|
551 |
-
$specString .= $value.$key;
|
552 |
-
}
|
553 |
-
}
|
554 |
-
|
555 |
-
return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString;
|
556 |
-
}
|
557 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Carbon;
|
13 |
+
|
14 |
+
use DateInterval;
|
15 |
+
use InvalidArgumentException;
|
16 |
+
use Symfony\Component\Translation\Loader\ArrayLoader;
|
17 |
+
use Symfony\Component\Translation\Translator;
|
18 |
+
use Symfony\Component\Translation\TranslatorInterface;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* A simple API extension for DateInterval.
|
22 |
+
* The implementation provides helpers to handle weeks but only days are saved.
|
23 |
+
* Weeks are calculated based on the total days of the current instance.
|
24 |
+
*
|
25 |
+
* @property int $years Total years of the current interval.
|
26 |
+
* @property int $months Total months of the current interval.
|
27 |
+
* @property int $weeks Total weeks of the current interval calculated from the days.
|
28 |
+
* @property int $dayz Total days of the current interval (weeks * 7 + days).
|
29 |
+
* @property int $hours Total hours of the current interval.
|
30 |
+
* @property int $minutes Total minutes of the current interval.
|
31 |
+
* @property int $seconds Total seconds of the current interval.
|
32 |
+
* @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
|
33 |
+
* @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks
|
34 |
+
*
|
35 |
+
* @method static CarbonInterval years($years = 1) Create instance specifying a number of years.
|
36 |
+
* @method static CarbonInterval year($years = 1) Alias for years()
|
37 |
+
* @method static CarbonInterval months($months = 1) Create instance specifying a number of months.
|
38 |
+
* @method static CarbonInterval month($months = 1) Alias for months()
|
39 |
+
* @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks.
|
40 |
+
* @method static CarbonInterval week($weeks = 1) Alias for weeks()
|
41 |
+
* @method static CarbonInterval days($days = 1) Create instance specifying a number of days.
|
42 |
+
* @method static CarbonInterval dayz($days = 1) Alias for days()
|
43 |
+
* @method static CarbonInterval day($days = 1) Alias for days()
|
44 |
+
* @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours.
|
45 |
+
* @method static CarbonInterval hour($hours = 1) Alias for hours()
|
46 |
+
* @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes.
|
47 |
+
* @method static CarbonInterval minute($minutes = 1) Alias for minutes()
|
48 |
+
* @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds.
|
49 |
+
* @method static CarbonInterval second($seconds = 1) Alias for seconds()
|
50 |
+
* @method CarbonInterval years() years($years = 1) Set the years portion of the current interval.
|
51 |
+
* @method CarbonInterval year() year($years = 1) Alias for years().
|
52 |
+
* @method CarbonInterval months() months($months = 1) Set the months portion of the current interval.
|
53 |
+
* @method CarbonInterval month() month($months = 1) Alias for months().
|
54 |
+
* @method CarbonInterval weeks() weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value.
|
55 |
+
* @method CarbonInterval week() week($weeks = 1) Alias for weeks().
|
56 |
+
* @method CarbonInterval days() days($days = 1) Set the days portion of the current interval.
|
57 |
+
* @method CarbonInterval dayz() dayz($days = 1) Alias for days().
|
58 |
+
* @method CarbonInterval day() day($days = 1) Alias for days().
|
59 |
+
* @method CarbonInterval hours() hours($hours = 1) Set the hours portion of the current interval.
|
60 |
+
* @method CarbonInterval hour() hour($hours = 1) Alias for hours().
|
61 |
+
* @method CarbonInterval minutes() minutes($minutes = 1) Set the minutes portion of the current interval.
|
62 |
+
* @method CarbonInterval minute() minute($minutes = 1) Alias for minutes().
|
63 |
+
* @method CarbonInterval seconds() seconds($seconds = 1) Set the seconds portion of the current interval.
|
64 |
+
* @method CarbonInterval second() second($seconds = 1) Alias for seconds().
|
65 |
+
*/
|
66 |
+
class CarbonInterval extends DateInterval
|
67 |
+
{
|
68 |
+
/**
|
69 |
+
* Interval spec period designators
|
70 |
+
*/
|
71 |
+
const PERIOD_PREFIX = 'P';
|
72 |
+
const PERIOD_YEARS = 'Y';
|
73 |
+
const PERIOD_MONTHS = 'M';
|
74 |
+
const PERIOD_DAYS = 'D';
|
75 |
+
const PERIOD_TIME_PREFIX = 'T';
|
76 |
+
const PERIOD_HOURS = 'H';
|
77 |
+
const PERIOD_MINUTES = 'M';
|
78 |
+
const PERIOD_SECONDS = 'S';
|
79 |
+
|
80 |
+
/**
|
81 |
+
* A translator to ... er ... translate stuff
|
82 |
+
*
|
83 |
+
* @var \Symfony\Component\Translation\TranslatorInterface
|
84 |
+
*/
|
85 |
+
protected static $translator;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Before PHP 5.4.20/5.5.4 instead of FALSE days will be set to -99999 when the interval instance
|
89 |
+
* was created by DateTime:diff().
|
90 |
+
*/
|
91 |
+
const PHP_DAYS_FALSE = -99999;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Determine if the interval was created via DateTime:diff() or not.
|
95 |
+
*
|
96 |
+
* @param DateInterval $interval
|
97 |
+
*
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
private static function wasCreatedFromDiff(DateInterval $interval)
|
101 |
+
{
|
102 |
+
return $interval->days !== false && $interval->days !== static::PHP_DAYS_FALSE;
|
103 |
+
}
|
104 |
+
|
105 |
+
///////////////////////////////////////////////////////////////////
|
106 |
+
//////////////////////////// CONSTRUCTORS /////////////////////////
|
107 |
+
///////////////////////////////////////////////////////////////////
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Create a new CarbonInterval instance.
|
111 |
+
*
|
112 |
+
* @param int $years
|
113 |
+
* @param int $months
|
114 |
+
* @param int $weeks
|
115 |
+
* @param int $days
|
116 |
+
* @param int $hours
|
117 |
+
* @param int $minutes
|
118 |
+
* @param int $seconds
|
119 |
+
*/
|
120 |
+
public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
|
121 |
+
{
|
122 |
+
$spec = static::PERIOD_PREFIX;
|
123 |
+
|
124 |
+
$spec .= $years > 0 ? $years.static::PERIOD_YEARS : '';
|
125 |
+
$spec .= $months > 0 ? $months.static::PERIOD_MONTHS : '';
|
126 |
+
|
127 |
+
$specDays = 0;
|
128 |
+
$specDays += $weeks > 0 ? $weeks * Carbon::DAYS_PER_WEEK : 0;
|
129 |
+
$specDays += $days > 0 ? $days : 0;
|
130 |
+
|
131 |
+
$spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : '';
|
132 |
+
|
133 |
+
if ($hours > 0 || $minutes > 0 || $seconds > 0) {
|
134 |
+
$spec .= static::PERIOD_TIME_PREFIX;
|
135 |
+
$spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : '';
|
136 |
+
$spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : '';
|
137 |
+
$spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : '';
|
138 |
+
}
|
139 |
+
|
140 |
+
if ($spec === static::PERIOD_PREFIX) {
|
141 |
+
// Allow the zero interval.
|
142 |
+
$spec .= '0'.static::PERIOD_YEARS;
|
143 |
+
}
|
144 |
+
|
145 |
+
parent::__construct($spec);
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Create a new CarbonInterval instance from specific values.
|
150 |
+
* This is an alias for the constructor that allows better fluent
|
151 |
+
* syntax as it allows you to do CarbonInterval::create(1)->fn() rather than
|
152 |
+
* (new CarbonInterval(1))->fn().
|
153 |
+
*
|
154 |
+
* @param int $years
|
155 |
+
* @param int $months
|
156 |
+
* @param int $weeks
|
157 |
+
* @param int $days
|
158 |
+
* @param int $hours
|
159 |
+
* @param int $minutes
|
160 |
+
* @param int $seconds
|
161 |
+
*
|
162 |
+
* @return static
|
163 |
+
*/
|
164 |
+
public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null)
|
165 |
+
{
|
166 |
+
return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds);
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Provide static helpers to create instances. Allows CarbonInterval::years(3).
|
171 |
+
*
|
172 |
+
* Note: This is done using the magic method to allow static and instance methods to
|
173 |
+
* have the same names.
|
174 |
+
*
|
175 |
+
* @param string $name
|
176 |
+
* @param array $args
|
177 |
+
*
|
178 |
+
* @return static
|
179 |
+
*/
|
180 |
+
public static function __callStatic($name, $args)
|
181 |
+
{
|
182 |
+
$arg = count($args) === 0 ? 1 : $args[0];
|
183 |
+
|
184 |
+
switch ($name) {
|
185 |
+
case 'years':
|
186 |
+
case 'year':
|
187 |
+
return new static($arg);
|
188 |
+
|
189 |
+
case 'months':
|
190 |
+
case 'month':
|
191 |
+
return new static(null, $arg);
|
192 |
+
|
193 |
+
case 'weeks':
|
194 |
+
case 'week':
|
195 |
+
return new static(null, null, $arg);
|
196 |
+
|
197 |
+
case 'days':
|
198 |
+
case 'dayz':
|
199 |
+
case 'day':
|
200 |
+
return new static(null, null, null, $arg);
|
201 |
+
|
202 |
+
case 'hours':
|
203 |
+
case 'hour':
|
204 |
+
return new static(null, null, null, null, $arg);
|
205 |
+
|
206 |
+
case 'minutes':
|
207 |
+
case 'minute':
|
208 |
+
return new static(null, null, null, null, null, $arg);
|
209 |
+
|
210 |
+
case 'seconds':
|
211 |
+
case 'second':
|
212 |
+
return new static(null, null, null, null, null, null, $arg);
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Create a CarbonInterval instance from a DateInterval one. Can not instance
|
218 |
+
* DateInterval objects created from DateTime::diff() as you can't externally
|
219 |
+
* set the $days field.
|
220 |
+
*
|
221 |
+
* @param DateInterval $di
|
222 |
+
*
|
223 |
+
* @throws \InvalidArgumentException
|
224 |
+
*
|
225 |
+
* @return static
|
226 |
+
*/
|
227 |
+
public static function instance(DateInterval $di)
|
228 |
+
{
|
229 |
+
if (static::wasCreatedFromDiff($di)) {
|
230 |
+
throw new InvalidArgumentException('Can not instance a DateInterval object created from DateTime::diff().');
|
231 |
+
}
|
232 |
+
|
233 |
+
$instance = new static($di->y, $di->m, 0, $di->d, $di->h, $di->i, $di->s);
|
234 |
+
$instance->invert = $di->invert;
|
235 |
+
$instance->days = $di->days;
|
236 |
+
|
237 |
+
return $instance;
|
238 |
+
}
|
239 |
+
|
240 |
+
///////////////////////////////////////////////////////////////////
|
241 |
+
/////////////////////// LOCALIZATION //////////////////////////////
|
242 |
+
///////////////////////////////////////////////////////////////////
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Initialize the translator instance if necessary.
|
246 |
+
*
|
247 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
248 |
+
*/
|
249 |
+
protected static function translator()
|
250 |
+
{
|
251 |
+
if (static::$translator === null) {
|
252 |
+
static::$translator = new Translator('en');
|
253 |
+
static::$translator->addLoader('array', new ArrayLoader());
|
254 |
+
static::setLocale('en');
|
255 |
+
}
|
256 |
+
|
257 |
+
return static::$translator;
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* Get the translator instance in use
|
262 |
+
*
|
263 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
264 |
+
*/
|
265 |
+
public static function getTranslator()
|
266 |
+
{
|
267 |
+
return static::translator();
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Set the translator instance to use
|
272 |
+
*
|
273 |
+
* @param TranslatorInterface $translator
|
274 |
+
*/
|
275 |
+
public static function setTranslator(TranslatorInterface $translator)
|
276 |
+
{
|
277 |
+
static::$translator = $translator;
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Get the current translator locale
|
282 |
+
*
|
283 |
+
* @return string
|
284 |
+
*/
|
285 |
+
public static function getLocale()
|
286 |
+
{
|
287 |
+
return static::translator()->getLocale();
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Set the current translator locale
|
292 |
+
*
|
293 |
+
* @param string $locale
|
294 |
+
*/
|
295 |
+
public static function setLocale($locale)
|
296 |
+
{
|
297 |
+
static::translator()->setLocale($locale);
|
298 |
+
|
299 |
+
// Ensure the locale has been loaded.
|
300 |
+
static::translator()->addResource('array', require __DIR__.'/Lang/'.$locale.'.php', $locale);
|
301 |
+
}
|
302 |
+
|
303 |
+
///////////////////////////////////////////////////////////////////
|
304 |
+
///////////////////////// GETTERS AND SETTERS /////////////////////
|
305 |
+
///////////////////////////////////////////////////////////////////
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Get a part of the CarbonInterval object
|
309 |
+
*
|
310 |
+
* @param string $name
|
311 |
+
*
|
312 |
+
* @throws \InvalidArgumentException
|
313 |
+
*
|
314 |
+
* @return int
|
315 |
+
*/
|
316 |
+
public function __get($name)
|
317 |
+
{
|
318 |
+
switch ($name) {
|
319 |
+
case 'years':
|
320 |
+
return $this->y;
|
321 |
+
|
322 |
+
case 'months':
|
323 |
+
return $this->m;
|
324 |
+
|
325 |
+
case 'dayz':
|
326 |
+
return $this->d;
|
327 |
+
|
328 |
+
case 'hours':
|
329 |
+
return $this->h;
|
330 |
+
|
331 |
+
case 'minutes':
|
332 |
+
return $this->i;
|
333 |
+
|
334 |
+
case 'seconds':
|
335 |
+
return $this->s;
|
336 |
+
|
337 |
+
case 'weeks':
|
338 |
+
return (int) floor($this->d / Carbon::DAYS_PER_WEEK);
|
339 |
+
|
340 |
+
case 'daysExcludeWeeks':
|
341 |
+
case 'dayzExcludeWeeks':
|
342 |
+
return $this->d % Carbon::DAYS_PER_WEEK;
|
343 |
+
|
344 |
+
default:
|
345 |
+
throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Set a part of the CarbonInterval object
|
351 |
+
*
|
352 |
+
* @param string $name
|
353 |
+
* @param int $val
|
354 |
+
*
|
355 |
+
* @throws \InvalidArgumentException
|
356 |
+
*/
|
357 |
+
public function __set($name, $val)
|
358 |
+
{
|
359 |
+
switch ($name) {
|
360 |
+
case 'years':
|
361 |
+
$this->y = $val;
|
362 |
+
break;
|
363 |
+
|
364 |
+
case 'months':
|
365 |
+
$this->m = $val;
|
366 |
+
break;
|
367 |
+
|
368 |
+
case 'weeks':
|
369 |
+
$this->d = $val * Carbon::DAYS_PER_WEEK;
|
370 |
+
break;
|
371 |
+
|
372 |
+
case 'dayz':
|
373 |
+
$this->d = $val;
|
374 |
+
break;
|
375 |
+
|
376 |
+
case 'hours':
|
377 |
+
$this->h = $val;
|
378 |
+
break;
|
379 |
+
|
380 |
+
case 'minutes':
|
381 |
+
$this->i = $val;
|
382 |
+
break;
|
383 |
+
|
384 |
+
case 'seconds':
|
385 |
+
$this->s = $val;
|
386 |
+
break;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Allow setting of weeks and days to be cumulative.
|
392 |
+
*
|
393 |
+
* @param int $weeks Number of weeks to set
|
394 |
+
* @param int $days Number of days to set
|
395 |
+
*
|
396 |
+
* @return static
|
397 |
+
*/
|
398 |
+
public function weeksAndDays($weeks, $days)
|
399 |
+
{
|
400 |
+
$this->dayz = ($weeks * Carbon::DAYS_PER_WEEK) + $days;
|
401 |
+
|
402 |
+
return $this;
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day().
|
407 |
+
*
|
408 |
+
* Note: This is done using the magic method to allow static and instance methods to
|
409 |
+
* have the same names.
|
410 |
+
*
|
411 |
+
* @param string $name
|
412 |
+
* @param array $args
|
413 |
+
*
|
414 |
+
* @return static
|
415 |
+
*/
|
416 |
+
public function __call($name, $args)
|
417 |
+
{
|
418 |
+
$arg = count($args) === 0 ? 1 : $args[0];
|
419 |
+
|
420 |
+
switch ($name) {
|
421 |
+
case 'years':
|
422 |
+
case 'year':
|
423 |
+
$this->years = $arg;
|
424 |
+
break;
|
425 |
+
|
426 |
+
case 'months':
|
427 |
+
case 'month':
|
428 |
+
$this->months = $arg;
|
429 |
+
break;
|
430 |
+
|
431 |
+
case 'weeks':
|
432 |
+
case 'week':
|
433 |
+
$this->dayz = $arg * Carbon::DAYS_PER_WEEK;
|
434 |
+
break;
|
435 |
+
|
436 |
+
case 'days':
|
437 |
+
case 'dayz':
|
438 |
+
case 'day':
|
439 |
+
$this->dayz = $arg;
|
440 |
+
break;
|
441 |
+
|
442 |
+
case 'hours':
|
443 |
+
case 'hour':
|
444 |
+
$this->hours = $arg;
|
445 |
+
break;
|
446 |
+
|
447 |
+
case 'minutes':
|
448 |
+
case 'minute':
|
449 |
+
$this->minutes = $arg;
|
450 |
+
break;
|
451 |
+
|
452 |
+
case 'seconds':
|
453 |
+
case 'second':
|
454 |
+
$this->seconds = $arg;
|
455 |
+
break;
|
456 |
+
}
|
457 |
+
|
458 |
+
return $this;
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* Get the current interval in a human readable format in the current locale.
|
463 |
+
*
|
464 |
+
* @return string
|
465 |
+
*/
|
466 |
+
public function forHumans()
|
467 |
+
{
|
468 |
+
$periods = array(
|
469 |
+
'year' => $this->years,
|
470 |
+
'month' => $this->months,
|
471 |
+
'week' => $this->weeks,
|
472 |
+
'day' => $this->daysExcludeWeeks,
|
473 |
+
'hour' => $this->hours,
|
474 |
+
'minute' => $this->minutes,
|
475 |
+
'second' => $this->seconds,
|
476 |
+
);
|
477 |
+
|
478 |
+
$parts = array();
|
479 |
+
foreach ($periods as $unit => $count) {
|
480 |
+
if ($count > 0) {
|
481 |
+
array_push($parts, static::translator()->transChoice($unit, $count, array(':count' => $count)));
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
return implode(' ', $parts);
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* Format the instance as a string using the forHumans() function.
|
490 |
+
*
|
491 |
+
* @return string
|
492 |
+
*/
|
493 |
+
public function __toString()
|
494 |
+
{
|
495 |
+
return $this->forHumans();
|
496 |
+
}
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Add the passed interval to the current instance
|
500 |
+
*
|
501 |
+
* @param DateInterval $interval
|
502 |
+
*
|
503 |
+
* @return static
|
504 |
+
*/
|
505 |
+
public function add(DateInterval $interval)
|
506 |
+
{
|
507 |
+
$sign = $interval->invert === 1 ? -1 : 1;
|
508 |
+
|
509 |
+
if (static::wasCreatedFromDiff($interval)) {
|
510 |
+
$this->dayz += $interval->days * $sign;
|
511 |
+
} else {
|
512 |
+
$this->years += $interval->y * $sign;
|
513 |
+
$this->months += $interval->m * $sign;
|
514 |
+
$this->dayz += $interval->d * $sign;
|
515 |
+
$this->hours += $interval->h * $sign;
|
516 |
+
$this->minutes += $interval->i * $sign;
|
517 |
+
$this->seconds += $interval->s * $sign;
|
518 |
+
}
|
519 |
+
|
520 |
+
return $this;
|
521 |
+
}
|
522 |
+
|
523 |
+
/**
|
524 |
+
* Get the interval_spec string
|
525 |
+
*
|
526 |
+
* @return string
|
527 |
+
*/
|
528 |
+
public function spec()
|
529 |
+
{
|
530 |
+
$date = array_filter(array(
|
531 |
+
static::PERIOD_YEARS => $this->y,
|
532 |
+
static::PERIOD_MONTHS => $this->m,
|
533 |
+
static::PERIOD_DAYS => $this->d,
|
534 |
+
));
|
535 |
+
|
536 |
+
$time = array_filter(array(
|
537 |
+
static::PERIOD_HOURS => $this->h,
|
538 |
+
static::PERIOD_MINUTES => $this->i,
|
539 |
+
static::PERIOD_SECONDS => $this->s,
|
540 |
+
));
|
541 |
+
|
542 |
+
$specString = static::PERIOD_PREFIX;
|
543 |
+
|
544 |
+
foreach ($date as $key => $value) {
|
545 |
+
$specString .= $value.$key;
|
546 |
+
}
|
547 |
+
|
548 |
+
if (count($time) > 0) {
|
549 |
+
$specString .= static::PERIOD_TIME_PREFIX;
|
550 |
+
foreach ($time as $key => $value) {
|
551 |
+
$specString .= $value.$key;
|
552 |
+
}
|
553 |
+
}
|
554 |
+
|
555 |
+
return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString;
|
556 |
+
}
|
557 |
+
}
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Exceptions/InvalidDateException.php
RENAMED
@@ -1,67 +1,67 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Carbon\Exceptions;
|
13 |
-
|
14 |
-
use Exception;
|
15 |
-
use InvalidArgumentException;
|
16 |
-
|
17 |
-
class InvalidDateException extends InvalidArgumentException
|
18 |
-
{
|
19 |
-
/**
|
20 |
-
* The invalid field.
|
21 |
-
*
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $field;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* The invalid value.
|
28 |
-
*
|
29 |
-
* @var mixed
|
30 |
-
*/
|
31 |
-
private $value;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Constructor.
|
35 |
-
*
|
36 |
-
* @param string $field
|
37 |
-
* @param mixed $value
|
38 |
-
* @param int $code
|
39 |
-
* @param \Exception|null $previous
|
40 |
-
*/
|
41 |
-
public function __construct($field, $value, $code = 0, Exception $previous = null)
|
42 |
-
{
|
43 |
-
$this->field = $field;
|
44 |
-
$this->value = $value;
|
45 |
-
parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous);
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Get the invalid field.
|
50 |
-
*
|
51 |
-
* @return string
|
52 |
-
*/
|
53 |
-
public function getField()
|
54 |
-
{
|
55 |
-
return $this->field;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Get the invalid value.
|
60 |
-
*
|
61 |
-
* @return mixed
|
62 |
-
*/
|
63 |
-
public function getValue()
|
64 |
-
{
|
65 |
-
return $this->value;
|
66 |
-
}
|
67 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Carbon\Exceptions;
|
13 |
+
|
14 |
+
use Exception;
|
15 |
+
use InvalidArgumentException;
|
16 |
+
|
17 |
+
class InvalidDateException extends InvalidArgumentException
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* The invalid field.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
private $field;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The invalid value.
|
28 |
+
*
|
29 |
+
* @var mixed
|
30 |
+
*/
|
31 |
+
private $value;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*
|
36 |
+
* @param string $field
|
37 |
+
* @param mixed $value
|
38 |
+
* @param int $code
|
39 |
+
* @param \Exception|null $previous
|
40 |
+
*/
|
41 |
+
public function __construct($field, $value, $code = 0, Exception $previous = null)
|
42 |
+
{
|
43 |
+
$this->field = $field;
|
44 |
+
$this->value = $value;
|
45 |
+
parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get the invalid field.
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getField()
|
54 |
+
{
|
55 |
+
return $this->field;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get the invalid value.
|
60 |
+
*
|
61 |
+
* @return mixed
|
62 |
+
*/
|
63 |
+
public function getValue()
|
64 |
+
{
|
65 |
+
return $this->value;
|
66 |
+
}
|
67 |
+
}
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/af.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 jaar|:count jare',
|
14 |
-
'y' => '1 jaar|:count jare',
|
15 |
-
'month' => '1 maand|:count maande',
|
16 |
-
'm' => '1 maand|:count maande',
|
17 |
-
'week' => '1 week|:count weke',
|
18 |
-
'w' => '1 week|:count weke',
|
19 |
-
'day' => '1 dag|:count dae',
|
20 |
-
'd' => '1 dag|:count dae',
|
21 |
-
'hour' => '1 uur|:count ure',
|
22 |
-
'h' => '1 uur|:count ure',
|
23 |
-
'minute' => '1 minuut|:count minute',
|
24 |
-
'min' => '1 minuut|:count minute',
|
25 |
-
'second' => '1 sekond|:count sekondes',
|
26 |
-
's' => '1 sekond|:count sekondes',
|
27 |
-
'ago' => ':time terug',
|
28 |
-
'from_now' => ':time van nou af',
|
29 |
-
'after' => ':time na',
|
30 |
-
'before' => ':time voor',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 jaar|:count jare',
|
14 |
+
'y' => '1 jaar|:count jare',
|
15 |
+
'month' => '1 maand|:count maande',
|
16 |
+
'm' => '1 maand|:count maande',
|
17 |
+
'week' => '1 week|:count weke',
|
18 |
+
'w' => '1 week|:count weke',
|
19 |
+
'day' => '1 dag|:count dae',
|
20 |
+
'd' => '1 dag|:count dae',
|
21 |
+
'hour' => '1 uur|:count ure',
|
22 |
+
'h' => '1 uur|:count ure',
|
23 |
+
'minute' => '1 minuut|:count minute',
|
24 |
+
'min' => '1 minuut|:count minute',
|
25 |
+
'second' => '1 sekond|:count sekondes',
|
26 |
+
's' => '1 sekond|:count sekondes',
|
27 |
+
'ago' => ':time terug',
|
28 |
+
'from_now' => ':time van nou af',
|
29 |
+
'after' => ':time na',
|
30 |
+
'before' => ':time voor',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ar.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
14 |
-
'y' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
15 |
-
'month' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
16 |
-
'm' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
17 |
-
'week' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
18 |
-
'w' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
19 |
-
'day' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
20 |
-
'd' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
21 |
-
'hour' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
22 |
-
'h' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
23 |
-
'minute' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
24 |
-
'min' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
25 |
-
'second' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
26 |
-
's' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
27 |
-
'ago' => 'منذ :time',
|
28 |
-
'from_now' => 'من الآن :time',
|
29 |
-
'after' => 'بعد :time',
|
30 |
-
'before' => 'قبل :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
14 |
+
'y' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
15 |
+
'month' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
16 |
+
'm' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
17 |
+
'week' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
18 |
+
'w' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
19 |
+
'day' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
20 |
+
'd' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
21 |
+
'hour' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
22 |
+
'h' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
23 |
+
'minute' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
24 |
+
'min' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
25 |
+
'second' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
26 |
+
's' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
27 |
+
'ago' => 'منذ :time',
|
28 |
+
'from_now' => 'من الآن :time',
|
29 |
+
'after' => 'بعد :time',
|
30 |
+
'before' => 'قبل :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/az.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count il',
|
14 |
-
'y' => ':count il',
|
15 |
-
'month' => ':count ay',
|
16 |
-
'm' => ':count ay',
|
17 |
-
'week' => ':count həftə',
|
18 |
-
'w' => ':count həftə',
|
19 |
-
'day' => ':count gün',
|
20 |
-
'd' => ':count gün',
|
21 |
-
'hour' => ':count saat',
|
22 |
-
'h' => ':count saat',
|
23 |
-
'minute' => ':count dəqiqə',
|
24 |
-
'min' => ':count dəqiqə',
|
25 |
-
'second' => ':count saniyə',
|
26 |
-
's' => ':count saniyə',
|
27 |
-
'ago' => ':time öncə',
|
28 |
-
'from_now' => ':time sonra',
|
29 |
-
'after' => ':time sonra',
|
30 |
-
'before' => ':time öncə',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count il',
|
14 |
+
'y' => ':count il',
|
15 |
+
'month' => ':count ay',
|
16 |
+
'm' => ':count ay',
|
17 |
+
'week' => ':count həftə',
|
18 |
+
'w' => ':count həftə',
|
19 |
+
'day' => ':count gün',
|
20 |
+
'd' => ':count gün',
|
21 |
+
'hour' => ':count saat',
|
22 |
+
'h' => ':count saat',
|
23 |
+
'minute' => ':count dəqiqə',
|
24 |
+
'min' => ':count dəqiqə',
|
25 |
+
'second' => ':count saniyə',
|
26 |
+
's' => ':count saniyə',
|
27 |
+
'ago' => ':time öncə',
|
28 |
+
'from_now' => ':time sonra',
|
29 |
+
'after' => ':time sonra',
|
30 |
+
'before' => ':time öncə',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/bg.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 година|:count години',
|
14 |
-
'y' => '1 година|:count години',
|
15 |
-
'month' => '1 месец|:count месеца',
|
16 |
-
'm' => '1 месец|:count месеца',
|
17 |
-
'week' => '1 седмица|:count седмици',
|
18 |
-
'w' => '1 седмица|:count седмици',
|
19 |
-
'day' => '1 ден|:count дни',
|
20 |
-
'd' => '1 ден|:count дни',
|
21 |
-
'hour' => '1 час|:count часа',
|
22 |
-
'h' => '1 час|:count часа',
|
23 |
-
'minute' => '1 минута|:count минути',
|
24 |
-
'm' => '1 минута|:count минути',
|
25 |
-
'second' => '1 секунда|:count секунди',
|
26 |
-
's' => '1 секунда|:count секунди',
|
27 |
-
'ago' => 'преди :time',
|
28 |
-
'from_now' => ':time от сега',
|
29 |
-
'after' => 'след :time',
|
30 |
-
'before' => 'преди :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 година|:count години',
|
14 |
+
'y' => '1 година|:count години',
|
15 |
+
'month' => '1 месец|:count месеца',
|
16 |
+
'm' => '1 месец|:count месеца',
|
17 |
+
'week' => '1 седмица|:count седмици',
|
18 |
+
'w' => '1 седмица|:count седмици',
|
19 |
+
'day' => '1 ден|:count дни',
|
20 |
+
'd' => '1 ден|:count дни',
|
21 |
+
'hour' => '1 час|:count часа',
|
22 |
+
'h' => '1 час|:count часа',
|
23 |
+
'minute' => '1 минута|:count минути',
|
24 |
+
'm' => '1 минута|:count минути',
|
25 |
+
'second' => '1 секунда|:count секунди',
|
26 |
+
's' => '1 секунда|:count секунди',
|
27 |
+
'ago' => 'преди :time',
|
28 |
+
'from_now' => ':time от сега',
|
29 |
+
'after' => 'след :time',
|
30 |
+
'before' => 'преди :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/bn.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '১ বছর|:count বছর',
|
14 |
-
'y' => '১ বছর|:count বছর',
|
15 |
-
'month' => '১ মাস|:count মাস',
|
16 |
-
'm' => '১ মাস|:count মাস',
|
17 |
-
'week' => '১ সপ্তাহ|:count সপ্তাহ',
|
18 |
-
'w' => '১ সপ্তাহ|:count সপ্তাহ',
|
19 |
-
'day' => '১ দিন|:count দিন',
|
20 |
-
'd' => '১ দিন|:count দিন',
|
21 |
-
'hour' => '১ ঘন্টা|:count ঘন্টা',
|
22 |
-
'h' => '১ ঘন্টা|:count ঘন্টা',
|
23 |
-
'minute' => '১ মিনিট|:count মিনিট',
|
24 |
-
'min' => '১ মিনিট|:count মিনিট',
|
25 |
-
'second' => '১ সেকেন্ড|:count সেকেন্ড',
|
26 |
-
's' => '১ সেকেন্ড|:count সেকেন্ড',
|
27 |
-
'ago' => ':time পূর্বে',
|
28 |
-
'from_now' => 'এখন থেকে :time',
|
29 |
-
'after' => ':time পরে',
|
30 |
-
'before' => ':time আগে',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '১ বছর|:count বছর',
|
14 |
+
'y' => '১ বছর|:count বছর',
|
15 |
+
'month' => '১ মাস|:count মাস',
|
16 |
+
'm' => '১ মাস|:count মাস',
|
17 |
+
'week' => '১ সপ্তাহ|:count সপ্তাহ',
|
18 |
+
'w' => '১ সপ্তাহ|:count সপ্তাহ',
|
19 |
+
'day' => '১ দিন|:count দিন',
|
20 |
+
'd' => '১ দিন|:count দিন',
|
21 |
+
'hour' => '১ ঘন্টা|:count ঘন্টা',
|
22 |
+
'h' => '১ ঘন্টা|:count ঘন্টা',
|
23 |
+
'minute' => '১ মিনিট|:count মিনিট',
|
24 |
+
'min' => '১ মিনিট|:count মিনিট',
|
25 |
+
'second' => '১ সেকেন্ড|:count সেকেন্ড',
|
26 |
+
's' => '১ সেকেন্ড|:count সেকেন্ড',
|
27 |
+
'ago' => ':time পূর্বে',
|
28 |
+
'from_now' => 'এখন থেকে :time',
|
29 |
+
'after' => ':time পরে',
|
30 |
+
'before' => ':time আগে',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ca.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 any|:count anys',
|
14 |
-
'y' => '1 any|:count anys',
|
15 |
-
'month' => '1 mes|:count mesos',
|
16 |
-
'm' => '1 mes|:count mesos',
|
17 |
-
'week' => '1 setmana|:count setmanes',
|
18 |
-
'w' => '1 setmana|:count setmanes',
|
19 |
-
'day' => '1 dia|:count dies',
|
20 |
-
'd' => '1 dia|:count dies',
|
21 |
-
'hour' => '1 hora|:count hores',
|
22 |
-
'h' => '1 hora|:count hores',
|
23 |
-
'minute' => '1 minut|:count minuts',
|
24 |
-
'min' => '1 minut|:count minuts',
|
25 |
-
'second' => '1 segon|:count segons',
|
26 |
-
's' => '1 segon|:count segons',
|
27 |
-
'ago' => 'fa :time',
|
28 |
-
'from_now' => 'dins de :time',
|
29 |
-
'after' => ':time després',
|
30 |
-
'before' => ':time abans',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 any|:count anys',
|
14 |
+
'y' => '1 any|:count anys',
|
15 |
+
'month' => '1 mes|:count mesos',
|
16 |
+
'm' => '1 mes|:count mesos',
|
17 |
+
'week' => '1 setmana|:count setmanes',
|
18 |
+
'w' => '1 setmana|:count setmanes',
|
19 |
+
'day' => '1 dia|:count dies',
|
20 |
+
'd' => '1 dia|:count dies',
|
21 |
+
'hour' => '1 hora|:count hores',
|
22 |
+
'h' => '1 hora|:count hores',
|
23 |
+
'minute' => '1 minut|:count minuts',
|
24 |
+
'min' => '1 minut|:count minuts',
|
25 |
+
'second' => '1 segon|:count segons',
|
26 |
+
's' => '1 segon|:count segons',
|
27 |
+
'ago' => 'fa :time',
|
28 |
+
'from_now' => 'dins de :time',
|
29 |
+
'after' => ':time després',
|
30 |
+
'before' => ':time abans',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/cs.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 rok|:count roky|:count let',
|
14 |
-
'y' => '1 rok|:count roky|:count let',
|
15 |
-
'month' => '1 měsíc|:count měsíce|:count měsíců',
|
16 |
-
'm' => '1 měsíc|:count měsíce|:count měsíců',
|
17 |
-
'week' => '1 týden|:count týdny|:count týdnů',
|
18 |
-
'w' => '1 týden|:count týdny|:count týdnů',
|
19 |
-
'day' => '1 den|:count dny|:count dní',
|
20 |
-
'd' => '1 den|:count dny|:count dní',
|
21 |
-
'hour' => '1 hodinu|:count hodiny|:count hodin',
|
22 |
-
'h' => '1 hodinu|:count hodiny|:count hodin',
|
23 |
-
'minute' => '1 minutu|:count minuty|:count minut',
|
24 |
-
'min' => '1 minutu|:count minuty|:count minut',
|
25 |
-
'second' => '1 sekundu|:count sekundy|:count sekund',
|
26 |
-
's' => '1 sekundu|:count sekundy|:count sekund',
|
27 |
-
'ago' => ':time nazpět',
|
28 |
-
'from_now' => 'za :time',
|
29 |
-
'after' => ':time později',
|
30 |
-
'before' => ':time předtím',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 rok|:count roky|:count let',
|
14 |
+
'y' => '1 rok|:count roky|:count let',
|
15 |
+
'month' => '1 měsíc|:count měsíce|:count měsíců',
|
16 |
+
'm' => '1 měsíc|:count měsíce|:count měsíců',
|
17 |
+
'week' => '1 týden|:count týdny|:count týdnů',
|
18 |
+
'w' => '1 týden|:count týdny|:count týdnů',
|
19 |
+
'day' => '1 den|:count dny|:count dní',
|
20 |
+
'd' => '1 den|:count dny|:count dní',
|
21 |
+
'hour' => '1 hodinu|:count hodiny|:count hodin',
|
22 |
+
'h' => '1 hodinu|:count hodiny|:count hodin',
|
23 |
+
'minute' => '1 minutu|:count minuty|:count minut',
|
24 |
+
'min' => '1 minutu|:count minuty|:count minut',
|
25 |
+
'second' => '1 sekundu|:count sekundy|:count sekund',
|
26 |
+
's' => '1 sekundu|:count sekundy|:count sekund',
|
27 |
+
'ago' => ':time nazpět',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time později',
|
30 |
+
'before' => ':time předtím',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/da.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 år|:count år',
|
14 |
-
'y' => '1 år|:count år',
|
15 |
-
'month' => '1 måned|:count måneder',
|
16 |
-
'm' => '1 måned|:count måneder',
|
17 |
-
'week' => '1 uge|:count uger',
|
18 |
-
'w' => '1 uge|:count uger',
|
19 |
-
'day' => '1 dag|:count dage',
|
20 |
-
'd' => '1 dag|:count dage',
|
21 |
-
'hour' => '1 time|:count timer',
|
22 |
-
'h' => '1 time|:count timer',
|
23 |
-
'minute' => '1 minut|:count minutter',
|
24 |
-
'min' => '1 minut|:count minutter',
|
25 |
-
'second' => '1 sekund|:count sekunder',
|
26 |
-
's' => '1 sekund|:count sekunder',
|
27 |
-
'ago' => ':time siden',
|
28 |
-
'from_now' => 'om :time',
|
29 |
-
'after' => ':time efter',
|
30 |
-
'before' => ':time før',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 måned|:count måneder',
|
16 |
+
'm' => '1 måned|:count måneder',
|
17 |
+
'week' => '1 uge|:count uger',
|
18 |
+
'w' => '1 uge|:count uger',
|
19 |
+
'day' => '1 dag|:count dage',
|
20 |
+
'd' => '1 dag|:count dage',
|
21 |
+
'hour' => '1 time|:count timer',
|
22 |
+
'h' => '1 time|:count timer',
|
23 |
+
'minute' => '1 minut|:count minutter',
|
24 |
+
'min' => '1 minut|:count minutter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time siden',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time efter',
|
30 |
+
'before' => ':time før',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/de.php
RENAMED
@@ -1,40 +1,40 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 Jahr|:count Jahre',
|
14 |
-
'y' => '1J|:countJ',
|
15 |
-
'month' => '1 Monat|:count Monate',
|
16 |
-
'm' => '1Mon|:countMon',
|
17 |
-
'week' => '1 Woche|:count Wochen',
|
18 |
-
'w' => '1Wo|:countWo',
|
19 |
-
'day' => '1 Tag|:count Tage',
|
20 |
-
'd' => '1Tg|:countTg',
|
21 |
-
'hour' => '1 Stunde|:count Stunden',
|
22 |
-
'h' => '1Std|:countStd',
|
23 |
-
'minute' => '1 Minute|:count Minuten',
|
24 |
-
'min' => '1Min|:countMin',
|
25 |
-
'second' => '1 Sekunde|:count Sekunden',
|
26 |
-
's' => '1Sek|:countSek',
|
27 |
-
'ago' => 'vor :time',
|
28 |
-
'from_now' => 'in :time',
|
29 |
-
'after' => ':time später',
|
30 |
-
'before' => ':time zuvor',
|
31 |
-
|
32 |
-
'year_from_now' => '1 Jahr|:count Jahren',
|
33 |
-
'month_from_now' => '1 Monat|:count Monaten',
|
34 |
-
'week_from_now' => '1 Woche|:count Wochen',
|
35 |
-
'day_from_now' => '1 Tag|:count Tagen',
|
36 |
-
'year_ago' => '1 Jahr|:count Jahren',
|
37 |
-
'month_ago' => '1 Monat|:count Monaten',
|
38 |
-
'week_ago' => '1 Woche|:count Wochen',
|
39 |
-
'day_ago' => '1 Tag|:count Tagen',
|
40 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 Jahr|:count Jahre',
|
14 |
+
'y' => '1J|:countJ',
|
15 |
+
'month' => '1 Monat|:count Monate',
|
16 |
+
'm' => '1Mon|:countMon',
|
17 |
+
'week' => '1 Woche|:count Wochen',
|
18 |
+
'w' => '1Wo|:countWo',
|
19 |
+
'day' => '1 Tag|:count Tage',
|
20 |
+
'd' => '1Tg|:countTg',
|
21 |
+
'hour' => '1 Stunde|:count Stunden',
|
22 |
+
'h' => '1Std|:countStd',
|
23 |
+
'minute' => '1 Minute|:count Minuten',
|
24 |
+
'min' => '1Min|:countMin',
|
25 |
+
'second' => '1 Sekunde|:count Sekunden',
|
26 |
+
's' => '1Sek|:countSek',
|
27 |
+
'ago' => 'vor :time',
|
28 |
+
'from_now' => 'in :time',
|
29 |
+
'after' => ':time später',
|
30 |
+
'before' => ':time zuvor',
|
31 |
+
|
32 |
+
'year_from_now' => '1 Jahr|:count Jahren',
|
33 |
+
'month_from_now' => '1 Monat|:count Monaten',
|
34 |
+
'week_from_now' => '1 Woche|:count Wochen',
|
35 |
+
'day_from_now' => '1 Tag|:count Tagen',
|
36 |
+
'year_ago' => '1 Jahr|:count Jahren',
|
37 |
+
'month_ago' => '1 Monat|:count Monaten',
|
38 |
+
'week_ago' => '1 Woche|:count Wochen',
|
39 |
+
'day_ago' => '1 Tag|:count Tagen',
|
40 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/el.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 χρόνος|:count χρόνια',
|
14 |
-
'y' => '1 χρόνος|:count χρόνια',
|
15 |
-
'month' => '1 μήνας|:count μήνες',
|
16 |
-
'm' => '1 μήνας|:count μήνες',
|
17 |
-
'week' => '1 εβδομάδα|:count εβδομάδες',
|
18 |
-
'w' => '1 εβδομάδα|:count εβδομάδες',
|
19 |
-
'day' => '1 μέρα|:count μέρες',
|
20 |
-
'd' => '1 μέρα|:count μέρες',
|
21 |
-
'hour' => '1 ώρα|:count ώρες',
|
22 |
-
'h' => '1 ώρα|:count ώρες',
|
23 |
-
'minute' => '1 λεπτό|:count λεπτά',
|
24 |
-
'min' => '1 λεπτό|:count λεπτά',
|
25 |
-
'second' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
26 |
-
's' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
27 |
-
'ago' => 'πρίν απο :time',
|
28 |
-
'from_now' => 'σε :time απο τώρα',
|
29 |
-
'after' => ':time μετά',
|
30 |
-
'before' => ':time πρίν',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 χρόνος|:count χρόνια',
|
14 |
+
'y' => '1 χρόνος|:count χρόνια',
|
15 |
+
'month' => '1 μήνας|:count μήνες',
|
16 |
+
'm' => '1 μήνας|:count μήνες',
|
17 |
+
'week' => '1 εβδομάδα|:count εβδομάδες',
|
18 |
+
'w' => '1 εβδομάδα|:count εβδομάδες',
|
19 |
+
'day' => '1 μέρα|:count μέρες',
|
20 |
+
'd' => '1 μέρα|:count μέρες',
|
21 |
+
'hour' => '1 ώρα|:count ώρες',
|
22 |
+
'h' => '1 ώρα|:count ώρες',
|
23 |
+
'minute' => '1 λεπτό|:count λεπτά',
|
24 |
+
'min' => '1 λεπτό|:count λεπτά',
|
25 |
+
'second' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
26 |
+
's' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
27 |
+
'ago' => 'πρίν απο :time',
|
28 |
+
'from_now' => 'σε :time απο τώρα',
|
29 |
+
'after' => ':time μετά',
|
30 |
+
'before' => ':time πρίν',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/en.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 year|:count years',
|
14 |
-
'y' => '1yr|:countyrs',
|
15 |
-
'month' => '1 month|:count months',
|
16 |
-
'm' => '1mo|:countmos',
|
17 |
-
'week' => '1 week|:count weeks',
|
18 |
-
'w' => '1w|:countw',
|
19 |
-
'day' => '1 day|:count days',
|
20 |
-
'd' => '1d|:countd',
|
21 |
-
'hour' => '1 hour|:count hours',
|
22 |
-
'h' => '1h|:counth',
|
23 |
-
'minute' => '1 minute|:count minutes',
|
24 |
-
'min' => '1m|:countm',
|
25 |
-
'second' => '1 second|:count seconds',
|
26 |
-
's' => '1s|:counts',
|
27 |
-
'ago' => ':time ago',
|
28 |
-
'from_now' => ':time from now',
|
29 |
-
'after' => ':time after',
|
30 |
-
'before' => ':time before',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 year|:count years',
|
14 |
+
'y' => '1yr|:countyrs',
|
15 |
+
'month' => '1 month|:count months',
|
16 |
+
'm' => '1mo|:countmos',
|
17 |
+
'week' => '1 week|:count weeks',
|
18 |
+
'w' => '1w|:countw',
|
19 |
+
'day' => '1 day|:count days',
|
20 |
+
'd' => '1d|:countd',
|
21 |
+
'hour' => '1 hour|:count hours',
|
22 |
+
'h' => '1h|:counth',
|
23 |
+
'minute' => '1 minute|:count minutes',
|
24 |
+
'min' => '1m|:countm',
|
25 |
+
'second' => '1 second|:count seconds',
|
26 |
+
's' => '1s|:counts',
|
27 |
+
'ago' => ':time ago',
|
28 |
+
'from_now' => ':time from now',
|
29 |
+
'after' => ':time after',
|
30 |
+
'before' => ':time before',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/eo.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 jaro|:count jaroj',
|
14 |
-
'y' => '1 jaro|:count jaroj',
|
15 |
-
'month' => '1 monato|:count monatoj',
|
16 |
-
'm' => '1 monato|:count monatoj',
|
17 |
-
'week' => '1 semajno|:count semajnoj',
|
18 |
-
'w' => '1 semajno|:count semajnoj',
|
19 |
-
'day' => '1 tago|:count tagoj',
|
20 |
-
'd' => '1 tago|:count tagoj',
|
21 |
-
'hour' => '1 horo|:count horoj',
|
22 |
-
'h' => '1 horo|:count horoj',
|
23 |
-
'minute' => '1 minuto|:count minutoj',
|
24 |
-
'min' => '1 minuto|:count minutoj',
|
25 |
-
'second' => '1 sekundo|:count sekundoj',
|
26 |
-
's' => '1 sekundo|:count sekundoj',
|
27 |
-
'ago' => 'antaŭ :time',
|
28 |
-
'from_now' => 'je :time',
|
29 |
-
'after' => ':time poste',
|
30 |
-
'before' => ':time antaŭe',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 jaro|:count jaroj',
|
14 |
+
'y' => '1 jaro|:count jaroj',
|
15 |
+
'month' => '1 monato|:count monatoj',
|
16 |
+
'm' => '1 monato|:count monatoj',
|
17 |
+
'week' => '1 semajno|:count semajnoj',
|
18 |
+
'w' => '1 semajno|:count semajnoj',
|
19 |
+
'day' => '1 tago|:count tagoj',
|
20 |
+
'd' => '1 tago|:count tagoj',
|
21 |
+
'hour' => '1 horo|:count horoj',
|
22 |
+
'h' => '1 horo|:count horoj',
|
23 |
+
'minute' => '1 minuto|:count minutoj',
|
24 |
+
'min' => '1 minuto|:count minutoj',
|
25 |
+
'second' => '1 sekundo|:count sekundoj',
|
26 |
+
's' => '1 sekundo|:count sekundoj',
|
27 |
+
'ago' => 'antaŭ :time',
|
28 |
+
'from_now' => 'je :time',
|
29 |
+
'after' => ':time poste',
|
30 |
+
'before' => ':time antaŭe',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/es.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 año|:count años',
|
14 |
-
'y' => '1 año|:count años',
|
15 |
-
'month' => '1 mes|:count meses',
|
16 |
-
'm' => '1 mes|:count meses',
|
17 |
-
'week' => '1 semana|:count semanas',
|
18 |
-
'w' => '1 semana|:count semanas',
|
19 |
-
'day' => '1 día|:count días',
|
20 |
-
'd' => '1 día|:count días',
|
21 |
-
'hour' => '1 hora|:count horas',
|
22 |
-
'h' => '1 hora|:count horas',
|
23 |
-
'minute' => '1 minuto|:count minutos',
|
24 |
-
'min' => '1 minuto|:count minutos',
|
25 |
-
'second' => '1 segundo|:count segundos',
|
26 |
-
's' => '1 segundo|:count segundos',
|
27 |
-
'ago' => 'hace :time',
|
28 |
-
'from_now' => 'dentro de :time',
|
29 |
-
'after' => ':time después',
|
30 |
-
'before' => ':time antes',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 año|:count años',
|
14 |
+
'y' => '1 año|:count años',
|
15 |
+
'month' => '1 mes|:count meses',
|
16 |
+
'm' => '1 mes|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 día|:count días',
|
20 |
+
'd' => '1 día|:count días',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => 'hace :time',
|
28 |
+
'from_now' => 'dentro de :time',
|
29 |
+
'after' => ':time después',
|
30 |
+
'before' => ':time antes',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/et.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 aasta|:count aastat',
|
14 |
-
'y' => '1 aasta|:count aastat',
|
15 |
-
'month' => '1 kuu|:count kuud',
|
16 |
-
'm' => '1 kuu|:count kuud',
|
17 |
-
'week' => '1 nädal|:count nädalat',
|
18 |
-
'w' => '1 nädal|:count nädalat',
|
19 |
-
'day' => '1 päev|:count päeva',
|
20 |
-
'd' => '1 päev|:count päeva',
|
21 |
-
'hour' => '1 tund|:count tundi',
|
22 |
-
'h' => '1 tund|:count tundi',
|
23 |
-
'minute' => '1 minut|:count minutit',
|
24 |
-
'min' => '1 minut|:count minutit',
|
25 |
-
'second' => '1 sekund|:count sekundit',
|
26 |
-
's' => '1 sekund|:count sekundit',
|
27 |
-
'ago' => ':time tagasi',
|
28 |
-
'from_now' => ':time pärast',
|
29 |
-
'after' => ':time pärast',
|
30 |
-
'before' => ':time enne',
|
31 |
-
'year_from_now' => ':count aasta',
|
32 |
-
'month_from_now' => ':count kuu',
|
33 |
-
'week_from_now' => ':count nädala',
|
34 |
-
'day_from_now' => ':count päeva',
|
35 |
-
'hour_from_now' => ':count tunni',
|
36 |
-
'minute_from_now' => ':count minuti',
|
37 |
-
'second_from_now' => ':count sekundi',
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 aasta|:count aastat',
|
14 |
+
'y' => '1 aasta|:count aastat',
|
15 |
+
'month' => '1 kuu|:count kuud',
|
16 |
+
'm' => '1 kuu|:count kuud',
|
17 |
+
'week' => '1 nädal|:count nädalat',
|
18 |
+
'w' => '1 nädal|:count nädalat',
|
19 |
+
'day' => '1 päev|:count päeva',
|
20 |
+
'd' => '1 päev|:count päeva',
|
21 |
+
'hour' => '1 tund|:count tundi',
|
22 |
+
'h' => '1 tund|:count tundi',
|
23 |
+
'minute' => '1 minut|:count minutit',
|
24 |
+
'min' => '1 minut|:count minutit',
|
25 |
+
'second' => '1 sekund|:count sekundit',
|
26 |
+
's' => '1 sekund|:count sekundit',
|
27 |
+
'ago' => ':time tagasi',
|
28 |
+
'from_now' => ':time pärast',
|
29 |
+
'after' => ':time pärast',
|
30 |
+
'before' => ':time enne',
|
31 |
+
'year_from_now' => ':count aasta',
|
32 |
+
'month_from_now' => ':count kuu',
|
33 |
+
'week_from_now' => ':count nädala',
|
34 |
+
'day_from_now' => ':count päeva',
|
35 |
+
'hour_from_now' => ':count tunni',
|
36 |
+
'minute_from_now' => ':count minuti',
|
37 |
+
'second_from_now' => ':count sekundi',
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/eu.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => 'Urte 1|:count urte',
|
14 |
-
'y' => 'Urte 1|:count urte',
|
15 |
-
'month' => 'Hile 1|:count hile',
|
16 |
-
'm' => 'Hile 1|:count hile',
|
17 |
-
'week' => 'Aste 1|:count aste',
|
18 |
-
'w' => 'Aste 1|:count aste',
|
19 |
-
'day' => 'Egun 1|:count egun',
|
20 |
-
'd' => 'Egun 1|:count egun',
|
21 |
-
'hour' => 'Ordu 1|:count ordu',
|
22 |
-
'h' => 'Ordu 1|:count ordu',
|
23 |
-
'minute' => 'Minutu 1|:count minutu',
|
24 |
-
'min' => 'Minutu 1|:count minutu',
|
25 |
-
'second' => 'Segundu 1|:count segundu',
|
26 |
-
's' => 'Segundu 1|:count segundu',
|
27 |
-
'ago' => 'Orain dela :time',
|
28 |
-
'from_now' => ':time barru',
|
29 |
-
'after' => ':time geroago',
|
30 |
-
'before' => ':time lehenago',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => 'Urte 1|:count urte',
|
14 |
+
'y' => 'Urte 1|:count urte',
|
15 |
+
'month' => 'Hile 1|:count hile',
|
16 |
+
'm' => 'Hile 1|:count hile',
|
17 |
+
'week' => 'Aste 1|:count aste',
|
18 |
+
'w' => 'Aste 1|:count aste',
|
19 |
+
'day' => 'Egun 1|:count egun',
|
20 |
+
'd' => 'Egun 1|:count egun',
|
21 |
+
'hour' => 'Ordu 1|:count ordu',
|
22 |
+
'h' => 'Ordu 1|:count ordu',
|
23 |
+
'minute' => 'Minutu 1|:count minutu',
|
24 |
+
'min' => 'Minutu 1|:count minutu',
|
25 |
+
'second' => 'Segundu 1|:count segundu',
|
26 |
+
's' => 'Segundu 1|:count segundu',
|
27 |
+
'ago' => 'Orain dela :time',
|
28 |
+
'from_now' => ':time barru',
|
29 |
+
'after' => ':time geroago',
|
30 |
+
'before' => ':time lehenago',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fa.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count سال',
|
14 |
-
'y' => ':count سال',
|
15 |
-
'month' => ':count ماه',
|
16 |
-
'm' => ':count ماه',
|
17 |
-
'week' => ':count هفته',
|
18 |
-
'w' => ':count هفته',
|
19 |
-
'day' => ':count روز',
|
20 |
-
'd' => ':count روز',
|
21 |
-
'hour' => ':count ساعت',
|
22 |
-
'h' => ':count ساعت',
|
23 |
-
'minute' => ':count دقیقه',
|
24 |
-
'min' => ':count دقیقه',
|
25 |
-
'second' => ':count ثانیه',
|
26 |
-
's' => ':count ثانیه',
|
27 |
-
'ago' => ':time پیش',
|
28 |
-
'from_now' => ':time بعد',
|
29 |
-
'after' => ':time پس از',
|
30 |
-
'before' => ':time پیش از',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count سال',
|
14 |
+
'y' => ':count سال',
|
15 |
+
'month' => ':count ماه',
|
16 |
+
'm' => ':count ماه',
|
17 |
+
'week' => ':count هفته',
|
18 |
+
'w' => ':count هفته',
|
19 |
+
'day' => ':count روز',
|
20 |
+
'd' => ':count روز',
|
21 |
+
'hour' => ':count ساعت',
|
22 |
+
'h' => ':count ساعت',
|
23 |
+
'minute' => ':count دقیقه',
|
24 |
+
'min' => ':count دقیقه',
|
25 |
+
'second' => ':count ثانیه',
|
26 |
+
's' => ':count ثانیه',
|
27 |
+
'ago' => ':time پیش',
|
28 |
+
'from_now' => ':time بعد',
|
29 |
+
'after' => ':time پس از',
|
30 |
+
'before' => ':time پیش از',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fi.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 vuosi|:count vuotta',
|
14 |
-
'y' => '1 vuosi|:count vuotta',
|
15 |
-
'month' => '1 kuukausi|:count kuukautta',
|
16 |
-
'm' => '1 kuukausi|:count kuukautta',
|
17 |
-
'week' => '1 viikko|:count viikkoa',
|
18 |
-
'w' => '1 viikko|:count viikkoa',
|
19 |
-
'day' => '1 päivä|:count päivää',
|
20 |
-
'd' => '1 päivä|:count päivää',
|
21 |
-
'hour' => '1 tunti|:count tuntia',
|
22 |
-
'h' => '1 tunti|:count tuntia',
|
23 |
-
'minute' => '1 minuutti|:count minuuttia',
|
24 |
-
'min' => '1 minuutti|:count minuuttia',
|
25 |
-
'second' => '1 sekunti|:count sekuntia',
|
26 |
-
's' => '1 sekunti|:count sekuntia',
|
27 |
-
'ago' => ':time sitten',
|
28 |
-
'from_now' => ':time tästä hetkestä',
|
29 |
-
'after' => ':time sen jälkeen',
|
30 |
-
'before' => ':time ennen',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 vuosi|:count vuotta',
|
14 |
+
'y' => '1 vuosi|:count vuotta',
|
15 |
+
'month' => '1 kuukausi|:count kuukautta',
|
16 |
+
'm' => '1 kuukausi|:count kuukautta',
|
17 |
+
'week' => '1 viikko|:count viikkoa',
|
18 |
+
'w' => '1 viikko|:count viikkoa',
|
19 |
+
'day' => '1 päivä|:count päivää',
|
20 |
+
'd' => '1 päivä|:count päivää',
|
21 |
+
'hour' => '1 tunti|:count tuntia',
|
22 |
+
'h' => '1 tunti|:count tuntia',
|
23 |
+
'minute' => '1 minuutti|:count minuuttia',
|
24 |
+
'min' => '1 minuutti|:count minuuttia',
|
25 |
+
'second' => '1 sekunti|:count sekuntia',
|
26 |
+
's' => '1 sekunti|:count sekuntia',
|
27 |
+
'ago' => ':time sitten',
|
28 |
+
'from_now' => ':time tästä hetkestä',
|
29 |
+
'after' => ':time sen jälkeen',
|
30 |
+
'before' => ':time ennen',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fo.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 ár|:count ár',
|
14 |
-
'y' => '1 ár|:count ár',
|
15 |
-
'month' => '1 mánaður|:count mánaðir',
|
16 |
-
'm' => '1 mánaður|:count mánaðir',
|
17 |
-
'week' => '1 vika|:count vikur',
|
18 |
-
'w' => '1 vika|:count vikur',
|
19 |
-
'day' => '1 dag|:count dagar',
|
20 |
-
'd' => '1 dag|:count dagar',
|
21 |
-
'hour' => '1 tími|:count tímar',
|
22 |
-
'h' => '1 tími|:count tímar',
|
23 |
-
'minute' => '1 minutt|:count minuttir',
|
24 |
-
'min' => '1 minutt|:count minuttir',
|
25 |
-
'second' => '1 sekund|:count sekundir',
|
26 |
-
's' => '1 sekund|:count sekundir',
|
27 |
-
'ago' => ':time síðan',
|
28 |
-
'from_now' => 'um :time',
|
29 |
-
'after' => ':time aftaná',
|
30 |
-
'before' => ':time áðrenn',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ár|:count ár',
|
14 |
+
'y' => '1 ár|:count ár',
|
15 |
+
'month' => '1 mánaður|:count mánaðir',
|
16 |
+
'm' => '1 mánaður|:count mánaðir',
|
17 |
+
'week' => '1 vika|:count vikur',
|
18 |
+
'w' => '1 vika|:count vikur',
|
19 |
+
'day' => '1 dag|:count dagar',
|
20 |
+
'd' => '1 dag|:count dagar',
|
21 |
+
'hour' => '1 tími|:count tímar',
|
22 |
+
'h' => '1 tími|:count tímar',
|
23 |
+
'minute' => '1 minutt|:count minuttir',
|
24 |
+
'min' => '1 minutt|:count minuttir',
|
25 |
+
'second' => '1 sekund|:count sekundir',
|
26 |
+
's' => '1 sekund|:count sekundir',
|
27 |
+
'ago' => ':time síðan',
|
28 |
+
'from_now' => 'um :time',
|
29 |
+
'after' => ':time aftaná',
|
30 |
+
'before' => ':time áðrenn',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/fr.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 an|:count ans',
|
14 |
-
'y' => '1 an|:count ans',
|
15 |
-
'month' => ':count mois',
|
16 |
-
'm' => ':count mois',
|
17 |
-
'week' => '1 semaine|:count semaines',
|
18 |
-
'w' => '1 semaine|:count semaines',
|
19 |
-
'day' => '1 jour|:count jours',
|
20 |
-
'd' => '1 jour|:count jours',
|
21 |
-
'hour' => '1 heure|:count heures',
|
22 |
-
'h' => '1 heure|:count heures',
|
23 |
-
'minute' => '1 minute|:count minutes',
|
24 |
-
'min' => '1 minute|:count minutes',
|
25 |
-
'second' => '1 seconde|:count secondes',
|
26 |
-
's' => '1 seconde|:count secondes',
|
27 |
-
'ago' => 'il y a :time',
|
28 |
-
'from_now' => 'dans :time',
|
29 |
-
'after' => ':time après',
|
30 |
-
'before' => ':time avant',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 an|:count ans',
|
14 |
+
'y' => '1 an|:count ans',
|
15 |
+
'month' => ':count mois',
|
16 |
+
'm' => ':count mois',
|
17 |
+
'week' => '1 semaine|:count semaines',
|
18 |
+
'w' => '1 semaine|:count semaines',
|
19 |
+
'day' => '1 jour|:count jours',
|
20 |
+
'd' => '1 jour|:count jours',
|
21 |
+
'hour' => '1 heure|:count heures',
|
22 |
+
'h' => '1 heure|:count heures',
|
23 |
+
'minute' => '1 minute|:count minutes',
|
24 |
+
'min' => '1 minute|:count minutes',
|
25 |
+
'second' => '1 seconde|:count secondes',
|
26 |
+
's' => '1 seconde|:count secondes',
|
27 |
+
'ago' => 'il y a :time',
|
28 |
+
'from_now' => 'dans :time',
|
29 |
+
'after' => ':time après',
|
30 |
+
'before' => ':time avant',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/gl.php
RENAMED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 ano|:count anos',
|
14 |
-
'month' => '1 mes|:count meses',
|
15 |
-
'week' => '1 semana|:count semanas',
|
16 |
-
'day' => '1 día|:count días',
|
17 |
-
'hour' => '1 hora|:count horas',
|
18 |
-
'minute' => '1 minuto|:count minutos',
|
19 |
-
'second' => '1 segundo|:count segundos',
|
20 |
-
'ago' => 'fai :time',
|
21 |
-
'from_now' => 'dentro de :time',
|
22 |
-
'after' => ':time despois',
|
23 |
-
'before' => ':time antes',
|
24 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'month' => '1 mes|:count meses',
|
15 |
+
'week' => '1 semana|:count semanas',
|
16 |
+
'day' => '1 día|:count días',
|
17 |
+
'hour' => '1 hora|:count horas',
|
18 |
+
'minute' => '1 minuto|:count minutos',
|
19 |
+
'second' => '1 segundo|:count segundos',
|
20 |
+
'ago' => 'fai :time',
|
21 |
+
'from_now' => 'dentro de :time',
|
22 |
+
'after' => ':time despois',
|
23 |
+
'before' => ':time antes',
|
24 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/he.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => 'שנה|{2}שנתיים|:count שנים',
|
14 |
-
'y' => 'שנה|{2}שנתיים|:count שנים',
|
15 |
-
'month' => 'חודש|{2}חודשיים|:count חודשים',
|
16 |
-
'm' => 'חודש|{2}חודשיים|:count חודשים',
|
17 |
-
'week' => 'שבוע|{2}שבועיים|:count שבועות',
|
18 |
-
'w' => 'שבוע|{2}שבועיים|:count שבועות',
|
19 |
-
'day' => 'יום|{2}יומיים|:count ימים',
|
20 |
-
'd' => 'יום|{2}יומיים|:count ימים',
|
21 |
-
'hour' => 'שעה|{2}שעתיים|:count שעות',
|
22 |
-
'h' => 'שעה|{2}שעתיים|:count שעות',
|
23 |
-
'minute' => 'דקה|{2}דקותיים|:count דקות',
|
24 |
-
'min' => 'דקה|{2}דקותיים|:count דקות',
|
25 |
-
'second' => 'שניה|:count שניות',
|
26 |
-
's' => 'שניה|:count שניות',
|
27 |
-
'ago' => 'לפני :time',
|
28 |
-
'from_now' => 'בעוד :time',
|
29 |
-
'after' => 'אחרי :time',
|
30 |
-
'before' => 'לפני :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => 'שנה|{2}שנתיים|:count שנים',
|
14 |
+
'y' => 'שנה|{2}שנתיים|:count שנים',
|
15 |
+
'month' => 'חודש|{2}חודשיים|:count חודשים',
|
16 |
+
'm' => 'חודש|{2}חודשיים|:count חודשים',
|
17 |
+
'week' => 'שבוע|{2}שבועיים|:count שבועות',
|
18 |
+
'w' => 'שבוע|{2}שבועיים|:count שבועות',
|
19 |
+
'day' => 'יום|{2}יומיים|:count ימים',
|
20 |
+
'd' => 'יום|{2}יומיים|:count ימים',
|
21 |
+
'hour' => 'שעה|{2}שעתיים|:count שעות',
|
22 |
+
'h' => 'שעה|{2}שעתיים|:count שעות',
|
23 |
+
'minute' => 'דקה|{2}דקותיים|:count דקות',
|
24 |
+
'min' => 'דקה|{2}דקותיים|:count דקות',
|
25 |
+
'second' => 'שניה|:count שניות',
|
26 |
+
's' => 'שניה|:count שניות',
|
27 |
+
'ago' => 'לפני :time',
|
28 |
+
'from_now' => 'בעוד :time',
|
29 |
+
'after' => 'אחרי :time',
|
30 |
+
'before' => 'לפני :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hr.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count godinu|:count godine|:count godina',
|
14 |
-
'y' => ':count godinu|:count godine|:count godina',
|
15 |
-
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
|
16 |
-
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
|
17 |
-
'week' => ':count tjedan|:count tjedna|:count tjedana',
|
18 |
-
'w' => ':count tjedan|:count tjedna|:count tjedana',
|
19 |
-
'day' => ':count dan|:count dana|:count dana',
|
20 |
-
'd' => ':count dan|:count dana|:count dana',
|
21 |
-
'hour' => ':count sat|:count sata|:count sati',
|
22 |
-
'h' => ':count sat|:count sata|:count sati',
|
23 |
-
'minute' => ':count minutu|:count minute |:count minuta',
|
24 |
-
'min' => ':count minutu|:count minute |:count minuta',
|
25 |
-
'second' => ':count sekundu|:count sekunde|:count sekundi',
|
26 |
-
's' => ':count sekundu|:count sekunde|:count sekundi',
|
27 |
-
'ago' => 'prije :time',
|
28 |
-
'from_now' => 'za :time',
|
29 |
-
'after' => 'za :time',
|
30 |
-
'before' => 'prije :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count godinu|:count godine|:count godina',
|
14 |
+
'y' => ':count godinu|:count godine|:count godina',
|
15 |
+
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
|
16 |
+
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
|
17 |
+
'week' => ':count tjedan|:count tjedna|:count tjedana',
|
18 |
+
'w' => ':count tjedan|:count tjedna|:count tjedana',
|
19 |
+
'day' => ':count dan|:count dana|:count dana',
|
20 |
+
'd' => ':count dan|:count dana|:count dana',
|
21 |
+
'hour' => ':count sat|:count sata|:count sati',
|
22 |
+
'h' => ':count sat|:count sata|:count sati',
|
23 |
+
'minute' => ':count minutu|:count minute |:count minuta',
|
24 |
+
'min' => ':count minutu|:count minute |:count minuta',
|
25 |
+
'second' => ':count sekundu|:count sekunde|:count sekundi',
|
26 |
+
's' => ':count sekundu|:count sekunde|:count sekundi',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => 'za :time',
|
30 |
+
'before' => 'prije :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hu.php
RENAMED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count év',
|
14 |
-
'y' => ':count év',
|
15 |
-
'month' => ':count hónap',
|
16 |
-
'm' => ':count hónap',
|
17 |
-
'week' => ':count hét',
|
18 |
-
'w' => ':count hét',
|
19 |
-
'day' => ':count nap',
|
20 |
-
'd' => ':count nap',
|
21 |
-
'hour' => ':count óra',
|
22 |
-
'h' => ':count óra',
|
23 |
-
'minute' => ':count perc',
|
24 |
-
'min' => ':count perc',
|
25 |
-
'second' => ':count másodperc',
|
26 |
-
's' => ':count másodperc',
|
27 |
-
'ago' => ':time',
|
28 |
-
'from_now' => ':time múlva',
|
29 |
-
'after' => ':time később',
|
30 |
-
'before' => ':time korábban',
|
31 |
-
'year_ago' => ':count éve',
|
32 |
-
'month_ago' => ':count hónapja',
|
33 |
-
'week_ago' => ':count hete',
|
34 |
-
'day_ago' => ':count napja',
|
35 |
-
'hour_ago' => ':count órája',
|
36 |
-
'minute_ago' => ':count perce',
|
37 |
-
'second_ago' => ':count másodperce',
|
38 |
-
'year_after' => ':count évvel',
|
39 |
-
'month_after' => ':count hónappal',
|
40 |
-
'week_after' => ':count héttel',
|
41 |
-
'day_after' => ':count nappal',
|
42 |
-
'hour_after' => ':count órával',
|
43 |
-
'minute_after' => ':count perccel',
|
44 |
-
'second_after' => ':count másodperccel',
|
45 |
-
'year_before' => ':count évvel',
|
46 |
-
'month_before' => ':count hónappal',
|
47 |
-
'week_before' => ':count héttel',
|
48 |
-
'day_before' => ':count nappal',
|
49 |
-
'hour_before' => ':count órával',
|
50 |
-
'minute_before' => ':count perccel',
|
51 |
-
'second_before' => ':count másodperccel',
|
52 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count év',
|
14 |
+
'y' => ':count év',
|
15 |
+
'month' => ':count hónap',
|
16 |
+
'm' => ':count hónap',
|
17 |
+
'week' => ':count hét',
|
18 |
+
'w' => ':count hét',
|
19 |
+
'day' => ':count nap',
|
20 |
+
'd' => ':count nap',
|
21 |
+
'hour' => ':count óra',
|
22 |
+
'h' => ':count óra',
|
23 |
+
'minute' => ':count perc',
|
24 |
+
'min' => ':count perc',
|
25 |
+
'second' => ':count másodperc',
|
26 |
+
's' => ':count másodperc',
|
27 |
+
'ago' => ':time',
|
28 |
+
'from_now' => ':time múlva',
|
29 |
+
'after' => ':time később',
|
30 |
+
'before' => ':time korábban',
|
31 |
+
'year_ago' => ':count éve',
|
32 |
+
'month_ago' => ':count hónapja',
|
33 |
+
'week_ago' => ':count hete',
|
34 |
+
'day_ago' => ':count napja',
|
35 |
+
'hour_ago' => ':count órája',
|
36 |
+
'minute_ago' => ':count perce',
|
37 |
+
'second_ago' => ':count másodperce',
|
38 |
+
'year_after' => ':count évvel',
|
39 |
+
'month_after' => ':count hónappal',
|
40 |
+
'week_after' => ':count héttel',
|
41 |
+
'day_after' => ':count nappal',
|
42 |
+
'hour_after' => ':count órával',
|
43 |
+
'minute_after' => ':count perccel',
|
44 |
+
'second_after' => ':count másodperccel',
|
45 |
+
'year_before' => ':count évvel',
|
46 |
+
'month_before' => ':count hónappal',
|
47 |
+
'week_before' => ':count héttel',
|
48 |
+
'day_before' => ':count nappal',
|
49 |
+
'hour_before' => ':count órával',
|
50 |
+
'minute_before' => ':count perccel',
|
51 |
+
'second_before' => ':count másodperccel',
|
52 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/hy.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count տարի',
|
14 |
-
'y' => ':count տարի',
|
15 |
-
'month' => ':count ամիս',
|
16 |
-
'm' => ':count ամիս',
|
17 |
-
'week' => ':count շաբաթ',
|
18 |
-
'w' => ':count շաբաթ',
|
19 |
-
'day' => ':count օր',
|
20 |
-
'd' => ':count օր',
|
21 |
-
'hour' => ':count ժամ',
|
22 |
-
'h' => ':count ժամ',
|
23 |
-
'minute' => ':count րոպե',
|
24 |
-
'min' => ':count րոպե',
|
25 |
-
'second' => ':count վայրկյան',
|
26 |
-
's' => ':count վայրկյան',
|
27 |
-
'ago' => ':time առաջ',
|
28 |
-
'from_now' => ':time հետո',
|
29 |
-
'after' => ':time հետո',
|
30 |
-
'before' => ':time առաջ',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count տարի',
|
14 |
+
'y' => ':count տարի',
|
15 |
+
'month' => ':count ամիս',
|
16 |
+
'm' => ':count ամիս',
|
17 |
+
'week' => ':count շաբաթ',
|
18 |
+
'w' => ':count շաբաթ',
|
19 |
+
'day' => ':count օր',
|
20 |
+
'd' => ':count օր',
|
21 |
+
'hour' => ':count ժամ',
|
22 |
+
'h' => ':count ժամ',
|
23 |
+
'minute' => ':count րոպե',
|
24 |
+
'min' => ':count րոպե',
|
25 |
+
'second' => ':count վայրկյան',
|
26 |
+
's' => ':count վայրկյան',
|
27 |
+
'ago' => ':time առաջ',
|
28 |
+
'from_now' => ':time հետո',
|
29 |
+
'after' => ':time հետո',
|
30 |
+
'before' => ':time առաջ',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/id.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count tahun',
|
14 |
-
'y' => ':count tahun',
|
15 |
-
'month' => ':count bulan',
|
16 |
-
'm' => ':count bulan',
|
17 |
-
'week' => ':count minggu',
|
18 |
-
'w' => ':count minggu',
|
19 |
-
'day' => ':count hari',
|
20 |
-
'd' => ':count hari',
|
21 |
-
'hour' => ':count jam',
|
22 |
-
'h' => ':count jam',
|
23 |
-
'minute' => ':count menit',
|
24 |
-
'min' => ':count menit',
|
25 |
-
'second' => ':count detik',
|
26 |
-
's' => ':count detik',
|
27 |
-
'ago' => ':time yang lalu',
|
28 |
-
'from_now' => ':time dari sekarang',
|
29 |
-
'after' => ':time setelah',
|
30 |
-
'before' => ':time sebelum',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count tahun',
|
14 |
+
'y' => ':count tahun',
|
15 |
+
'month' => ':count bulan',
|
16 |
+
'm' => ':count bulan',
|
17 |
+
'week' => ':count minggu',
|
18 |
+
'w' => ':count minggu',
|
19 |
+
'day' => ':count hari',
|
20 |
+
'd' => ':count hari',
|
21 |
+
'hour' => ':count jam',
|
22 |
+
'h' => ':count jam',
|
23 |
+
'minute' => ':count menit',
|
24 |
+
'min' => ':count menit',
|
25 |
+
'second' => ':count detik',
|
26 |
+
's' => ':count detik',
|
27 |
+
'ago' => ':time yang lalu',
|
28 |
+
'from_now' => ':time dari sekarang',
|
29 |
+
'after' => ':time setelah',
|
30 |
+
'before' => ':time sebelum',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/it.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 anno|:count anni',
|
14 |
-
'y' => '1 anno|:count anni',
|
15 |
-
'month' => '1 mese|:count mesi',
|
16 |
-
'm' => '1 mese|:count mesi',
|
17 |
-
'week' => '1 settimana|:count settimane',
|
18 |
-
'w' => '1 settimana|:count settimane',
|
19 |
-
'day' => '1 giorno|:count giorni',
|
20 |
-
'd' => '1 giorno|:count giorni',
|
21 |
-
'hour' => '1 ora|:count ore',
|
22 |
-
'h' => '1 ora|:count ore',
|
23 |
-
'minute' => '1 minuto|:count minuti',
|
24 |
-
'min' => '1 minuto|:count minuti',
|
25 |
-
'second' => '1 secondo|:count secondi',
|
26 |
-
's' => '1 secondo|:count secondi',
|
27 |
-
'ago' => ':time fa',
|
28 |
-
'from_now' => ':time da adesso',
|
29 |
-
'after' => ':time dopo',
|
30 |
-
'before' => ':time prima',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 anno|:count anni',
|
14 |
+
'y' => '1 anno|:count anni',
|
15 |
+
'month' => '1 mese|:count mesi',
|
16 |
+
'm' => '1 mese|:count mesi',
|
17 |
+
'week' => '1 settimana|:count settimane',
|
18 |
+
'w' => '1 settimana|:count settimane',
|
19 |
+
'day' => '1 giorno|:count giorni',
|
20 |
+
'd' => '1 giorno|:count giorni',
|
21 |
+
'hour' => '1 ora|:count ore',
|
22 |
+
'h' => '1 ora|:count ore',
|
23 |
+
'minute' => '1 minuto|:count minuti',
|
24 |
+
'min' => '1 minuto|:count minuti',
|
25 |
+
'second' => '1 secondo|:count secondi',
|
26 |
+
's' => '1 secondo|:count secondi',
|
27 |
+
'ago' => ':time fa',
|
28 |
+
'from_now' => ':time da adesso',
|
29 |
+
'after' => ':time dopo',
|
30 |
+
'before' => ':time prima',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ja.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count 年',
|
14 |
-
'y' => ':count 年',
|
15 |
-
'month' => ':count ヶ月',
|
16 |
-
'm' => ':count ヶ月',
|
17 |
-
'week' => ':count 週間',
|
18 |
-
'w' => ':count 週間',
|
19 |
-
'day' => ':count 日',
|
20 |
-
'd' => ':count 日',
|
21 |
-
'hour' => ':count 時間',
|
22 |
-
'h' => ':count 時間',
|
23 |
-
'minute' => ':count 分',
|
24 |
-
'min' => ':count 分',
|
25 |
-
'second' => ':count 秒',
|
26 |
-
's' => ':count 秒',
|
27 |
-
'ago' => ':time 前',
|
28 |
-
'from_now' => '今から :time',
|
29 |
-
'after' => ':time 後',
|
30 |
-
'before' => ':time 前',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count 年',
|
14 |
+
'y' => ':count 年',
|
15 |
+
'month' => ':count ヶ月',
|
16 |
+
'm' => ':count ヶ月',
|
17 |
+
'week' => ':count 週間',
|
18 |
+
'w' => ':count 週間',
|
19 |
+
'day' => ':count 日',
|
20 |
+
'd' => ':count 日',
|
21 |
+
'hour' => ':count 時間',
|
22 |
+
'h' => ':count 時間',
|
23 |
+
'minute' => ':count 分',
|
24 |
+
'min' => ':count 分',
|
25 |
+
'second' => ':count 秒',
|
26 |
+
's' => ':count 秒',
|
27 |
+
'ago' => ':time 前',
|
28 |
+
'from_now' => '今から :time',
|
29 |
+
'after' => ':time 後',
|
30 |
+
'before' => ':time 前',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ka.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count წლის',
|
14 |
-
'y' => ':count წლის',
|
15 |
-
'month' => ':count თვის',
|
16 |
-
'm' => ':count თვის',
|
17 |
-
'week' => ':count კვირის',
|
18 |
-
'w' => ':count კვირის',
|
19 |
-
'day' => ':count დღის',
|
20 |
-
'd' => ':count დღის',
|
21 |
-
'hour' => ':count საათის',
|
22 |
-
'h' => ':count საათის',
|
23 |
-
'minute' => ':count წუთის',
|
24 |
-
'min' => ':count წუთის',
|
25 |
-
'second' => ':count წამის',
|
26 |
-
's' => ':count წამის',
|
27 |
-
'ago' => ':time უკან',
|
28 |
-
'from_now' => ':time შემდეგ',
|
29 |
-
'after' => ':time შემდეგ',
|
30 |
-
'before' => ':time უკან',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count წლის',
|
14 |
+
'y' => ':count წლის',
|
15 |
+
'month' => ':count თვის',
|
16 |
+
'm' => ':count თვის',
|
17 |
+
'week' => ':count კვირის',
|
18 |
+
'w' => ':count კვირის',
|
19 |
+
'day' => ':count დღის',
|
20 |
+
'd' => ':count დღის',
|
21 |
+
'hour' => ':count საათის',
|
22 |
+
'h' => ':count საათის',
|
23 |
+
'minute' => ':count წუთის',
|
24 |
+
'min' => ':count წუთის',
|
25 |
+
'second' => ':count წამის',
|
26 |
+
's' => ':count წამის',
|
27 |
+
'ago' => ':time უკან',
|
28 |
+
'from_now' => ':time შემდეგ',
|
29 |
+
'after' => ':time შემდეგ',
|
30 |
+
'before' => ':time უკან',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/km.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count ឆ្នាំ',
|
14 |
-
'y' => ':count ឆ្នាំ',
|
15 |
-
'month' => ':count ខែ',
|
16 |
-
'm' => ':count ខែ',
|
17 |
-
'week' => ':count សប្ដាហ៍',
|
18 |
-
'w' => ':count សប្ដាហ៍',
|
19 |
-
'day' => ':count ថ្ងៃ',
|
20 |
-
'd' => ':count ថ្ងៃ',
|
21 |
-
'hour' => ':count ម៉ោង',
|
22 |
-
'h' => ':count ម៉ោង',
|
23 |
-
'minute' => ':count នាទី',
|
24 |
-
'min' => ':count នាទី',
|
25 |
-
'second' => ':count វិនាទី',
|
26 |
-
's' => ':count វិនាទី',
|
27 |
-
'ago' => ':timeមុន',
|
28 |
-
'from_now' => ':timeពីឥឡូវ',
|
29 |
-
'after' => 'នៅក្រោយ :time',
|
30 |
-
'before' => 'នៅមុន :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count ឆ្នាំ',
|
14 |
+
'y' => ':count ឆ្នាំ',
|
15 |
+
'month' => ':count ខែ',
|
16 |
+
'm' => ':count ខែ',
|
17 |
+
'week' => ':count សប្ដាហ៍',
|
18 |
+
'w' => ':count សប្ដាហ៍',
|
19 |
+
'day' => ':count ថ្ងៃ',
|
20 |
+
'd' => ':count ថ្ងៃ',
|
21 |
+
'hour' => ':count ម៉ោង',
|
22 |
+
'h' => ':count ម៉ោង',
|
23 |
+
'minute' => ':count នាទី',
|
24 |
+
'min' => ':count នាទី',
|
25 |
+
'second' => ':count វិនាទី',
|
26 |
+
's' => ':count វិនាទី',
|
27 |
+
'ago' => ':timeមុន',
|
28 |
+
'from_now' => ':timeពីឥឡូវ',
|
29 |
+
'after' => 'នៅក្រោយ :time',
|
30 |
+
'before' => 'នៅមុន :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ko.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count 년',
|
14 |
-
'y' => ':count 년',
|
15 |
-
'month' => ':count 개월',
|
16 |
-
'm' => ':count 개월',
|
17 |
-
'week' => ':count 주일',
|
18 |
-
'w' => ':count 주일',
|
19 |
-
'day' => ':count 일',
|
20 |
-
'd' => ':count 일',
|
21 |
-
'hour' => ':count 시간',
|
22 |
-
'h' => ':count 시간',
|
23 |
-
'minute' => ':count 분',
|
24 |
-
'min' => ':count 분',
|
25 |
-
'second' => ':count 초',
|
26 |
-
's' => ':count 초',
|
27 |
-
'ago' => ':time 전',
|
28 |
-
'from_now' => ':time 후',
|
29 |
-
'after' => ':time 뒤',
|
30 |
-
'before' => ':time 앞',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count 년',
|
14 |
+
'y' => ':count 년',
|
15 |
+
'month' => ':count 개월',
|
16 |
+
'm' => ':count 개월',
|
17 |
+
'week' => ':count 주일',
|
18 |
+
'w' => ':count 주일',
|
19 |
+
'day' => ':count 일',
|
20 |
+
'd' => ':count 일',
|
21 |
+
'hour' => ':count 시간',
|
22 |
+
'h' => ':count 시간',
|
23 |
+
'minute' => ':count 분',
|
24 |
+
'min' => ':count 분',
|
25 |
+
'second' => ':count 초',
|
26 |
+
's' => ':count 초',
|
27 |
+
'ago' => ':time 전',
|
28 |
+
'from_now' => ':time 후',
|
29 |
+
'after' => ':time 뒤',
|
30 |
+
'before' => ':time 앞',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/lt.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count metus|:count metus|:count metų',
|
14 |
-
'y' => ':count metus|:count metus|:count metų',
|
15 |
-
'month' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
16 |
-
'm' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
17 |
-
'week' => ':count savaitę|:count savaites|:count savaičių',
|
18 |
-
'w' => ':count savaitę|:count savaites|:count savaičių',
|
19 |
-
'day' => ':count dieną|:count dienas|:count dienų',
|
20 |
-
'd' => ':count dieną|:count dienas|:count dienų',
|
21 |
-
'hour' => ':count valandą|:count valandas|:count valandų',
|
22 |
-
'h' => ':count valandą|:count valandas|:count valandų',
|
23 |
-
'minute' => ':count minutę|:count minutes|:count minučių',
|
24 |
-
'min' => ':count minutę|:count minutes|:count minučių',
|
25 |
-
'second' => ':count sekundę|:count sekundes|:count sekundžių',
|
26 |
-
's' => ':count sekundę|:count sekundes|:count sekundžių',
|
27 |
-
'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių',
|
28 |
-
'minute_from_now' => ':count minutės|:count minučių|:count minučių',
|
29 |
-
'hour_from_now' => ':count valandos|:count valandų|:count valandų',
|
30 |
-
'day_from_now' => ':count dienos|:count dienų|:count dienų',
|
31 |
-
'week_from_now' => ':count savaitės|:count savaičių|:count savaičių',
|
32 |
-
'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių',
|
33 |
-
'year_from_now' => ':count metų',
|
34 |
-
'ago' => 'prieš :time',
|
35 |
-
'from_now' => 'už :time',
|
36 |
-
'after' => 'po :time',
|
37 |
-
'before' => ':time nuo dabar',
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count metus|:count metus|:count metų',
|
14 |
+
'y' => ':count metus|:count metus|:count metų',
|
15 |
+
'month' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
16 |
+
'm' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
17 |
+
'week' => ':count savaitę|:count savaites|:count savaičių',
|
18 |
+
'w' => ':count savaitę|:count savaites|:count savaičių',
|
19 |
+
'day' => ':count dieną|:count dienas|:count dienų',
|
20 |
+
'd' => ':count dieną|:count dienas|:count dienų',
|
21 |
+
'hour' => ':count valandą|:count valandas|:count valandų',
|
22 |
+
'h' => ':count valandą|:count valandas|:count valandų',
|
23 |
+
'minute' => ':count minutę|:count minutes|:count minučių',
|
24 |
+
'min' => ':count minutę|:count minutes|:count minučių',
|
25 |
+
'second' => ':count sekundę|:count sekundes|:count sekundžių',
|
26 |
+
's' => ':count sekundę|:count sekundes|:count sekundžių',
|
27 |
+
'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių',
|
28 |
+
'minute_from_now' => ':count minutės|:count minučių|:count minučių',
|
29 |
+
'hour_from_now' => ':count valandos|:count valandų|:count valandų',
|
30 |
+
'day_from_now' => ':count dienos|:count dienų|:count dienų',
|
31 |
+
'week_from_now' => ':count savaitės|:count savaičių|:count savaičių',
|
32 |
+
'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių',
|
33 |
+
'year_from_now' => ':count metų',
|
34 |
+
'ago' => 'prieš :time',
|
35 |
+
'from_now' => 'už :time',
|
36 |
+
'after' => 'po :time',
|
37 |
+
'before' => ':time nuo dabar',
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/lv.php
RENAMED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '0 gadiem|:count gada|:count gadiem',
|
14 |
-
'y' => '0 gadiem|:count gada|:count gadiem',
|
15 |
-
'month' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
16 |
-
'm' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
17 |
-
'week' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
18 |
-
'w' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
19 |
-
'day' => '0 dienām|:count dienas|:count dienām',
|
20 |
-
'd' => '0 dienām|:count dienas|:count dienām',
|
21 |
-
'hour' => '0 stundām|:count stundas|:count stundām',
|
22 |
-
'h' => '0 stundām|:count stundas|:count stundām',
|
23 |
-
'minute' => '0 minūtēm|:count minūtes|:count minūtēm',
|
24 |
-
'min' => '0 minūtēm|:count minūtes|:count minūtēm',
|
25 |
-
'second' => '0 sekundēm|:count sekundes|:count sekundēm',
|
26 |
-
's' => '0 sekundēm|:count sekundes|:count sekundēm',
|
27 |
-
'ago' => 'pirms :time',
|
28 |
-
'from_now' => 'pēc :time',
|
29 |
-
'after' => ':time vēlāk',
|
30 |
-
'before' => ':time pirms',
|
31 |
-
|
32 |
-
'year_after' => '0 gadus|:count gadu|:count gadus',
|
33 |
-
'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
34 |
-
'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
35 |
-
'day_after' => '0 dienas|:count dienu|:count dienas',
|
36 |
-
'hour_after' => '0 stundas|:count stundu|:count stundas',
|
37 |
-
'minute_after' => '0 minūtes|:count minūti|:count minūtes',
|
38 |
-
'second_after' => '0 sekundes|:count sekundi|:count sekundes',
|
39 |
-
|
40 |
-
'year_before' => '0 gadus|:count gadu|:count gadus',
|
41 |
-
'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
42 |
-
'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
43 |
-
'day_before' => '0 dienas|:count dienu|:count dienas',
|
44 |
-
'hour_before' => '0 stundas|:count stundu|:count stundas',
|
45 |
-
'minute_before' => '0 minūtes|:count minūti|:count minūtes',
|
46 |
-
'second_before' => '0 sekundes|:count sekundi|:count sekundes',
|
47 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '0 gadiem|:count gada|:count gadiem',
|
14 |
+
'y' => '0 gadiem|:count gada|:count gadiem',
|
15 |
+
'month' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
16 |
+
'm' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
17 |
+
'week' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
18 |
+
'w' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
19 |
+
'day' => '0 dienām|:count dienas|:count dienām',
|
20 |
+
'd' => '0 dienām|:count dienas|:count dienām',
|
21 |
+
'hour' => '0 stundām|:count stundas|:count stundām',
|
22 |
+
'h' => '0 stundām|:count stundas|:count stundām',
|
23 |
+
'minute' => '0 minūtēm|:count minūtes|:count minūtēm',
|
24 |
+
'min' => '0 minūtēm|:count minūtes|:count minūtēm',
|
25 |
+
'second' => '0 sekundēm|:count sekundes|:count sekundēm',
|
26 |
+
's' => '0 sekundēm|:count sekundes|:count sekundēm',
|
27 |
+
'ago' => 'pirms :time',
|
28 |
+
'from_now' => 'pēc :time',
|
29 |
+
'after' => ':time vēlāk',
|
30 |
+
'before' => ':time pirms',
|
31 |
+
|
32 |
+
'year_after' => '0 gadus|:count gadu|:count gadus',
|
33 |
+
'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
34 |
+
'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
35 |
+
'day_after' => '0 dienas|:count dienu|:count dienas',
|
36 |
+
'hour_after' => '0 stundas|:count stundu|:count stundas',
|
37 |
+
'minute_after' => '0 minūtes|:count minūti|:count minūtes',
|
38 |
+
'second_after' => '0 sekundes|:count sekundi|:count sekundes',
|
39 |
+
|
40 |
+
'year_before' => '0 gadus|:count gadu|:count gadus',
|
41 |
+
'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
42 |
+
'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
43 |
+
'day_before' => '0 dienas|:count dienu|:count dienas',
|
44 |
+
'hour_before' => '0 stundas|:count stundu|:count stundas',
|
45 |
+
'minute_before' => '0 minūtes|:count minūti|:count minūtes',
|
46 |
+
'second_before' => '0 sekundes|:count sekundi|:count sekundes',
|
47 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/mk.php
RENAMED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 година|:count години',
|
14 |
-
'month' => '1 месец|:count месеци',
|
15 |
-
'week' => '1 седмица|:count седмици',
|
16 |
-
'day' => '1 ден|:count дена',
|
17 |
-
'hour' => '1 час|:count часа',
|
18 |
-
'minute' => '1 минута|:count минути',
|
19 |
-
'second' => '1 секунда|:count секунди',
|
20 |
-
'ago' => 'пред :time',
|
21 |
-
'from_now' => ':time од сега',
|
22 |
-
'after' => 'по :time',
|
23 |
-
'before' => 'пред :time',
|
24 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 година|:count години',
|
14 |
+
'month' => '1 месец|:count месеци',
|
15 |
+
'week' => '1 седмица|:count седмици',
|
16 |
+
'day' => '1 ден|:count дена',
|
17 |
+
'hour' => '1 час|:count часа',
|
18 |
+
'minute' => '1 минута|:count минути',
|
19 |
+
'second' => '1 секунда|:count секунди',
|
20 |
+
'ago' => 'пред :time',
|
21 |
+
'from_now' => ':time од сега',
|
22 |
+
'after' => 'по :time',
|
23 |
+
'before' => 'пред :time',
|
24 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ms.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count tahun',
|
14 |
-
'y' => ':count tahun',
|
15 |
-
'month' => ':count bulan',
|
16 |
-
'm' => ':count bulan',
|
17 |
-
'week' => ':count minggu',
|
18 |
-
'w' => ':count minggu',
|
19 |
-
'day' => ':count hari',
|
20 |
-
'd' => ':count hari',
|
21 |
-
'hour' => ':count jam',
|
22 |
-
'h' => ':count jam',
|
23 |
-
'minute' => ':count minit',
|
24 |
-
'min' => ':count minit',
|
25 |
-
'second' => ':count saat',
|
26 |
-
's' => ':count saat',
|
27 |
-
'ago' => ':time yang lalu',
|
28 |
-
'from_now' => ':time dari sekarang',
|
29 |
-
'after' => ':time selepas',
|
30 |
-
'before' => ':time sebelum',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count tahun',
|
14 |
+
'y' => ':count tahun',
|
15 |
+
'month' => ':count bulan',
|
16 |
+
'm' => ':count bulan',
|
17 |
+
'week' => ':count minggu',
|
18 |
+
'w' => ':count minggu',
|
19 |
+
'day' => ':count hari',
|
20 |
+
'd' => ':count hari',
|
21 |
+
'hour' => ':count jam',
|
22 |
+
'h' => ':count jam',
|
23 |
+
'minute' => ':count minit',
|
24 |
+
'min' => ':count minit',
|
25 |
+
'second' => ':count saat',
|
26 |
+
's' => ':count saat',
|
27 |
+
'ago' => ':time yang lalu',
|
28 |
+
'from_now' => ':time dari sekarang',
|
29 |
+
'after' => ':time selepas',
|
30 |
+
'before' => ':time sebelum',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/nl.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count jaar',
|
14 |
-
'y' => ':count jaar',
|
15 |
-
'month' => '1 maand|:count maanden',
|
16 |
-
'm' => '1 maand|:count maanden',
|
17 |
-
'week' => '1 week|:count weken',
|
18 |
-
'w' => '1 week|:count weken',
|
19 |
-
'day' => '1 dag|:count dagen',
|
20 |
-
'd' => '1 dag|:count dagen',
|
21 |
-
'hour' => ':count uur',
|
22 |
-
'h' => ':count uur',
|
23 |
-
'minute' => '1 minuut|:count minuten',
|
24 |
-
'min' => '1 minuut|:count minuten',
|
25 |
-
'second' => '1 seconde|:count seconden',
|
26 |
-
's' => '1 seconde|:count seconden',
|
27 |
-
'ago' => ':time geleden',
|
28 |
-
'from_now' => 'over :time',
|
29 |
-
'after' => ':time later',
|
30 |
-
'before' => ':time eerder',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count jaar',
|
14 |
+
'y' => ':count jaar',
|
15 |
+
'month' => '1 maand|:count maanden',
|
16 |
+
'm' => '1 maand|:count maanden',
|
17 |
+
'week' => '1 week|:count weken',
|
18 |
+
'w' => '1 week|:count weken',
|
19 |
+
'day' => '1 dag|:count dagen',
|
20 |
+
'd' => '1 dag|:count dagen',
|
21 |
+
'hour' => ':count uur',
|
22 |
+
'h' => ':count uur',
|
23 |
+
'minute' => '1 minuut|:count minuten',
|
24 |
+
'min' => '1 minuut|:count minuten',
|
25 |
+
'second' => '1 seconde|:count seconden',
|
26 |
+
's' => '1 seconde|:count seconden',
|
27 |
+
'ago' => ':time geleden',
|
28 |
+
'from_now' => 'over :time',
|
29 |
+
'after' => ':time later',
|
30 |
+
'before' => ':time eerder',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/no.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 år|:count år',
|
14 |
-
'y' => '1 år|:count år',
|
15 |
-
'month' => '1 måned|:count måneder',
|
16 |
-
'm' => '1 måned|:count måneder',
|
17 |
-
'week' => '1 uke|:count uker',
|
18 |
-
'w' => '1 uke|:count uker',
|
19 |
-
'day' => '1 dag|:count dager',
|
20 |
-
'd' => '1 dag|:count dager',
|
21 |
-
'hour' => '1 time|:count timer',
|
22 |
-
'h' => '1 time|:count timer',
|
23 |
-
'minute' => '1 minutt|:count minutter',
|
24 |
-
'min' => '1 minutt|:count minutter',
|
25 |
-
'second' => '1 sekund|:count sekunder',
|
26 |
-
's' => '1 sekund|:count sekunder',
|
27 |
-
'ago' => ':time siden',
|
28 |
-
'from_now' => 'om :time',
|
29 |
-
'after' => ':time etter',
|
30 |
-
'before' => ':time før',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 måned|:count måneder',
|
16 |
+
'm' => '1 måned|:count måneder',
|
17 |
+
'week' => '1 uke|:count uker',
|
18 |
+
'w' => '1 uke|:count uker',
|
19 |
+
'day' => '1 dag|:count dager',
|
20 |
+
'd' => '1 dag|:count dager',
|
21 |
+
'hour' => '1 time|:count timer',
|
22 |
+
'h' => '1 time|:count timer',
|
23 |
+
'minute' => '1 minutt|:count minutter',
|
24 |
+
'min' => '1 minutt|:count minutter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time siden',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time etter',
|
30 |
+
'before' => ':time før',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pl.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 rok|:count lata|:count lat',
|
14 |
-
'y' => '1 rok|:count lata|:count lat',
|
15 |
-
'month' => '1 miesiąc|:count miesiące|:count miesięcy',
|
16 |
-
'm' => '1 miesiąc|:count miesiące|:count miesięcy',
|
17 |
-
'week' => '1 tydzień|:count tygodnie|:count tygodni',
|
18 |
-
'w' => '1 tydzień|:count tygodnie|:count tygodni',
|
19 |
-
'day' => '1 dzień|:count dni|:count dni',
|
20 |
-
'd' => '1 dzień|:count dni|:count dni',
|
21 |
-
'hour' => '1 godzina|:count godziny|:count godzin',
|
22 |
-
'h' => '1 godzina|:count godziny|:count godzin',
|
23 |
-
'minute' => '1 minuta|:count minuty|:count minut',
|
24 |
-
'min' => '1 minuta|:count minuty|:count minut',
|
25 |
-
'second' => '1 sekunda|:count sekundy|:count sekund',
|
26 |
-
's' => '1 sekunda|:count sekundy|:count sekund',
|
27 |
-
'ago' => ':time temu',
|
28 |
-
'from_now' => ':time od teraz',
|
29 |
-
'after' => ':time przed',
|
30 |
-
'before' => ':time po',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 rok|:count lata|:count lat',
|
14 |
+
'y' => '1 rok|:count lata|:count lat',
|
15 |
+
'month' => '1 miesiąc|:count miesiące|:count miesięcy',
|
16 |
+
'm' => '1 miesiąc|:count miesiące|:count miesięcy',
|
17 |
+
'week' => '1 tydzień|:count tygodnie|:count tygodni',
|
18 |
+
'w' => '1 tydzień|:count tygodnie|:count tygodni',
|
19 |
+
'day' => '1 dzień|:count dni|:count dni',
|
20 |
+
'd' => '1 dzień|:count dni|:count dni',
|
21 |
+
'hour' => '1 godzina|:count godziny|:count godzin',
|
22 |
+
'h' => '1 godzina|:count godziny|:count godzin',
|
23 |
+
'minute' => '1 minuta|:count minuty|:count minut',
|
24 |
+
'min' => '1 minuta|:count minuty|:count minut',
|
25 |
+
'second' => '1 sekunda|:count sekundy|:count sekund',
|
26 |
+
's' => '1 sekunda|:count sekundy|:count sekund',
|
27 |
+
'ago' => ':time temu',
|
28 |
+
'from_now' => ':time od teraz',
|
29 |
+
'after' => ':time przed',
|
30 |
+
'before' => ':time po',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pt.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 ano|:count anos',
|
14 |
-
'y' => '1 ano|:count anos',
|
15 |
-
'month' => '1 mês|:count meses',
|
16 |
-
'm' => '1 mês|:count meses',
|
17 |
-
'week' => '1 semana|:count semanas',
|
18 |
-
'w' => '1 semana|:count semanas',
|
19 |
-
'day' => '1 dia|:count dias',
|
20 |
-
'd' => '1 dia|:count dias',
|
21 |
-
'hour' => '1 hora|:count horas',
|
22 |
-
'h' => '1 hora|:count horas',
|
23 |
-
'minute' => '1 minuto|:count minutos',
|
24 |
-
'min' => '1 minuto|:count minutos',
|
25 |
-
'second' => '1 segundo|:count segundos',
|
26 |
-
's' => '1 segundo|:count segundos',
|
27 |
-
'ago' => ':time atrás',
|
28 |
-
'from_now' => 'em :time',
|
29 |
-
'after' => ':time depois',
|
30 |
-
'before' => ':time antes',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'y' => '1 ano|:count anos',
|
15 |
+
'month' => '1 mês|:count meses',
|
16 |
+
'm' => '1 mês|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 dia|:count dias',
|
20 |
+
'd' => '1 dia|:count dias',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => ':time atrás',
|
28 |
+
'from_now' => 'em :time',
|
29 |
+
'after' => ':time depois',
|
30 |
+
'before' => ':time antes',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/pt_BR.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 ano|:count anos',
|
14 |
-
'y' => '1 ano|:count anos',
|
15 |
-
'month' => '1 mês|:count meses',
|
16 |
-
'm' => '1 mês|:count meses',
|
17 |
-
'week' => '1 semana|:count semanas',
|
18 |
-
'w' => '1 semana|:count semanas',
|
19 |
-
'day' => '1 dia|:count dias',
|
20 |
-
'd' => '1 dia|:count dias',
|
21 |
-
'hour' => '1 hora|:count horas',
|
22 |
-
'h' => '1 hora|:count horas',
|
23 |
-
'minute' => '1 minuto|:count minutos',
|
24 |
-
'min' => '1 minuto|:count minutos',
|
25 |
-
'second' => '1 segundo|:count segundos',
|
26 |
-
's' => '1 segundo|:count segundos',
|
27 |
-
'ago' => 'há :time',
|
28 |
-
'from_now' => 'em :time',
|
29 |
-
'after' => 'após :time',
|
30 |
-
'before' => ':time atrás',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'y' => '1 ano|:count anos',
|
15 |
+
'month' => '1 mês|:count meses',
|
16 |
+
'm' => '1 mês|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 dia|:count dias',
|
20 |
+
'd' => '1 dia|:count dias',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => 'há :time',
|
28 |
+
'from_now' => 'em :time',
|
29 |
+
'after' => 'após :time',
|
30 |
+
'before' => ':time atrás',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ro.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => 'un an|:count ani|:count ani',
|
14 |
-
'y' => 'un an|:count ani|:count ani',
|
15 |
-
'month' => 'o lună|:count luni|:count luni',
|
16 |
-
'm' => 'o lună|:count luni|:count luni',
|
17 |
-
'week' => 'o săptămână|:count săptămâni|:count săptămâni',
|
18 |
-
'w' => 'o săptămână|:count săptămâni|:count săptămâni',
|
19 |
-
'day' => 'o zi|:count zile|:count zile',
|
20 |
-
'd' => 'o zi|:count zile|:count zile',
|
21 |
-
'hour' => 'o oră|:count ore|:count ore',
|
22 |
-
'h' => 'o oră|:count ore|:count ore',
|
23 |
-
'minute' => 'un minut|:count minute|:count minute',
|
24 |
-
'min' => 'un minut|:count minute|:count minute',
|
25 |
-
'second' => 'o secundă|:count secunde|:count secunde',
|
26 |
-
's' => 'o secundă|:count secunde|:count secunde',
|
27 |
-
'ago' => 'acum :time',
|
28 |
-
'from_now' => ':time de acum',
|
29 |
-
'after' => 'peste :time',
|
30 |
-
'before' => 'acum :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => 'un an|:count ani|:count ani',
|
14 |
+
'y' => 'un an|:count ani|:count ani',
|
15 |
+
'month' => 'o lună|:count luni|:count luni',
|
16 |
+
'm' => 'o lună|:count luni|:count luni',
|
17 |
+
'week' => 'o săptămână|:count săptămâni|:count săptămâni',
|
18 |
+
'w' => 'o săptămână|:count săptămâni|:count săptămâni',
|
19 |
+
'day' => 'o zi|:count zile|:count zile',
|
20 |
+
'd' => 'o zi|:count zile|:count zile',
|
21 |
+
'hour' => 'o oră|:count ore|:count ore',
|
22 |
+
'h' => 'o oră|:count ore|:count ore',
|
23 |
+
'minute' => 'un minut|:count minute|:count minute',
|
24 |
+
'min' => 'un minut|:count minute|:count minute',
|
25 |
+
'second' => 'o secundă|:count secunde|:count secunde',
|
26 |
+
's' => 'o secundă|:count secunde|:count secunde',
|
27 |
+
'ago' => 'acum :time',
|
28 |
+
'from_now' => ':time de acum',
|
29 |
+
'after' => 'peste :time',
|
30 |
+
'before' => 'acum :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ru.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count год|:count года|:count лет',
|
14 |
-
'y' => ':count год|:count года|:count лет',
|
15 |
-
'month' => ':count месяц|:count месяца|:count месяцев',
|
16 |
-
'm' => ':count месяц|:count месяца|:count месяцев',
|
17 |
-
'week' => ':count неделю|:count недели|:count недель',
|
18 |
-
'w' => ':count неделю|:count недели|:count недель',
|
19 |
-
'day' => ':count день|:count дня|:count дней',
|
20 |
-
'd' => ':count день|:count дня|:count дней',
|
21 |
-
'hour' => ':count час|:count часа|:count часов',
|
22 |
-
'h' => ':count час|:count часа|:count часов',
|
23 |
-
'minute' => ':count минуту|:count минуты|:count минут',
|
24 |
-
'min' => ':count минуту|:count минуты|:count минут',
|
25 |
-
'second' => ':count секунду|:count секунды|:count секунд',
|
26 |
-
's' => ':count секунду|:count секунды|:count секунд',
|
27 |
-
'ago' => ':time назад',
|
28 |
-
'from_now' => 'через :time',
|
29 |
-
'after' => ':time после',
|
30 |
-
'before' => ':time до',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count год|:count года|:count лет',
|
14 |
+
'y' => ':count год|:count года|:count лет',
|
15 |
+
'month' => ':count месяц|:count месяца|:count месяцев',
|
16 |
+
'm' => ':count месяц|:count месяца|:count месяцев',
|
17 |
+
'week' => ':count неделю|:count недели|:count недель',
|
18 |
+
'w' => ':count неделю|:count недели|:count недель',
|
19 |
+
'day' => ':count день|:count дня|:count дней',
|
20 |
+
'd' => ':count день|:count дня|:count дней',
|
21 |
+
'hour' => ':count час|:count часа|:count часов',
|
22 |
+
'h' => ':count час|:count часа|:count часов',
|
23 |
+
'minute' => ':count минуту|:count минуты|:count минут',
|
24 |
+
'min' => ':count минуту|:count минуты|:count минут',
|
25 |
+
'second' => ':count секунду|:count секунды|:count секунд',
|
26 |
+
's' => ':count секунду|:count секунды|:count секунд',
|
27 |
+
'ago' => ':time назад',
|
28 |
+
'from_now' => 'через :time',
|
29 |
+
'after' => ':time после',
|
30 |
+
'before' => ':time до',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sk.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => 'rok|:count roky|:count rokov',
|
14 |
-
'y' => 'rok|:count roky|:count rokov',
|
15 |
-
'month' => 'mesiac|:count mesiace|:count mesiacov',
|
16 |
-
'm' => 'mesiac|:count mesiace|:count mesiacov',
|
17 |
-
'week' => 'týždeň|:count týždne|:count týždňov',
|
18 |
-
'w' => 'týždeň|:count týždne|:count týždňov',
|
19 |
-
'day' => 'deň|:count dni|:count dní',
|
20 |
-
'd' => 'deň|:count dni|:count dní',
|
21 |
-
'hour' => 'hodinu|:count hodiny|:count hodín',
|
22 |
-
'h' => 'hodinu|:count hodiny|:count hodín',
|
23 |
-
'minute' => 'minútu|:count minúty|:count minút',
|
24 |
-
'min' => 'minútu|:count minúty|:count minút',
|
25 |
-
'second' => 'sekundu|:count sekundy|:count sekúnd',
|
26 |
-
's' => 'sekundu|:count sekundy|:count sekúnd',
|
27 |
-
'ago' => 'pred :time',
|
28 |
-
'from_now' => 'za :time',
|
29 |
-
'after' => ':time neskôr',
|
30 |
-
'before' => ':time predtým',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => 'rok|:count roky|:count rokov',
|
14 |
+
'y' => 'rok|:count roky|:count rokov',
|
15 |
+
'month' => 'mesiac|:count mesiace|:count mesiacov',
|
16 |
+
'm' => 'mesiac|:count mesiace|:count mesiacov',
|
17 |
+
'week' => 'týždeň|:count týždne|:count týždňov',
|
18 |
+
'w' => 'týždeň|:count týždne|:count týždňov',
|
19 |
+
'day' => 'deň|:count dni|:count dní',
|
20 |
+
'd' => 'deň|:count dni|:count dní',
|
21 |
+
'hour' => 'hodinu|:count hodiny|:count hodín',
|
22 |
+
'h' => 'hodinu|:count hodiny|:count hodín',
|
23 |
+
'minute' => 'minútu|:count minúty|:count minút',
|
24 |
+
'min' => 'minútu|:count minúty|:count minút',
|
25 |
+
'second' => 'sekundu|:count sekundy|:count sekúnd',
|
26 |
+
's' => 'sekundu|:count sekundy|:count sekúnd',
|
27 |
+
'ago' => 'pred :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time neskôr',
|
30 |
+
'before' => ':time predtým',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sl.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count leto|:count leti|:count leta|:count let',
|
14 |
-
'y' => ':count leto|:count leti|:count leta|:count let',
|
15 |
-
'month' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
16 |
-
'm' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
17 |
-
'week' => ':count teden|:count tedna|:count tedne|:count tednov',
|
18 |
-
'w' => ':count teden|:count tedna|:count tedne|:count tednov',
|
19 |
-
'day' => ':count dan|:count dni|:count dni|:count dni',
|
20 |
-
'd' => ':count dan|:count dni|:count dni|:count dni',
|
21 |
-
'hour' => ':count uro|:count uri|:count ure|:count ur',
|
22 |
-
'h' => ':count uro|:count uri|:count ure|:count ur',
|
23 |
-
'minute' => ':count minuto|:count minuti|:count minute|:count minut',
|
24 |
-
'min' => ':count minuto|:count minuti|:count minute|:count minut',
|
25 |
-
'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
26 |
-
's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
27 |
-
'year_ago' => ':count letom|:count leti|:count leti|:count leti',
|
28 |
-
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
|
29 |
-
'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni',
|
30 |
-
'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
|
31 |
-
'hour_ago' => ':count uro|:count urama|:count urami|:count urami',
|
32 |
-
'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami',
|
33 |
-
'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami',
|
34 |
-
'ago' => 'pred :time',
|
35 |
-
'from_now' => 'čez :time',
|
36 |
-
'after' => 'čez :time',
|
37 |
-
'before' => 'pred :time',
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count leto|:count leti|:count leta|:count let',
|
14 |
+
'y' => ':count leto|:count leti|:count leta|:count let',
|
15 |
+
'month' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
16 |
+
'm' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
17 |
+
'week' => ':count teden|:count tedna|:count tedne|:count tednov',
|
18 |
+
'w' => ':count teden|:count tedna|:count tedne|:count tednov',
|
19 |
+
'day' => ':count dan|:count dni|:count dni|:count dni',
|
20 |
+
'd' => ':count dan|:count dni|:count dni|:count dni',
|
21 |
+
'hour' => ':count uro|:count uri|:count ure|:count ur',
|
22 |
+
'h' => ':count uro|:count uri|:count ure|:count ur',
|
23 |
+
'minute' => ':count minuto|:count minuti|:count minute|:count minut',
|
24 |
+
'min' => ':count minuto|:count minuti|:count minute|:count minut',
|
25 |
+
'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
26 |
+
's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
27 |
+
'year_ago' => ':count letom|:count leti|:count leti|:count leti',
|
28 |
+
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
|
29 |
+
'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni',
|
30 |
+
'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
|
31 |
+
'hour_ago' => ':count uro|:count urama|:count urami|:count urami',
|
32 |
+
'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami',
|
33 |
+
'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami',
|
34 |
+
'ago' => 'pred :time',
|
35 |
+
'from_now' => 'čez :time',
|
36 |
+
'after' => 'čez :time',
|
37 |
+
'before' => 'pred :time',
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sq.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 vit|:count vjet',
|
14 |
-
'y' => '1 vit|:count vjet',
|
15 |
-
'month' => '1 muaj|:count muaj',
|
16 |
-
'm' => '1 muaj|:count muaj',
|
17 |
-
'week' => '1 javë|:count javë',
|
18 |
-
'w' => '1 javë|:count javë',
|
19 |
-
'day' => '1 ditë|:count ditë',
|
20 |
-
'd' => '1 ditë|:count ditë',
|
21 |
-
'hour' => '1 orë|:count orë',
|
22 |
-
'h' => '1 orë|:count orë',
|
23 |
-
'minute' => '1 minutë|:count minuta',
|
24 |
-
'min' => '1 minutë|:count minuta',
|
25 |
-
'second' => '1 sekondë|:count sekonda',
|
26 |
-
's' => '1 sekondë|:count sekonda',
|
27 |
-
'ago' => ':time më parë',
|
28 |
-
'from_now' => ':time nga tani',
|
29 |
-
'after' => ':time pas',
|
30 |
-
'before' => ':time para',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 vit|:count vjet',
|
14 |
+
'y' => '1 vit|:count vjet',
|
15 |
+
'month' => '1 muaj|:count muaj',
|
16 |
+
'm' => '1 muaj|:count muaj',
|
17 |
+
'week' => '1 javë|:count javë',
|
18 |
+
'w' => '1 javë|:count javë',
|
19 |
+
'day' => '1 ditë|:count ditë',
|
20 |
+
'd' => '1 ditë|:count ditë',
|
21 |
+
'hour' => '1 orë|:count orë',
|
22 |
+
'h' => '1 orë|:count orë',
|
23 |
+
'minute' => '1 minutë|:count minuta',
|
24 |
+
'min' => '1 minutë|:count minuta',
|
25 |
+
'second' => '1 sekondë|:count sekonda',
|
26 |
+
's' => '1 sekondë|:count sekonda',
|
27 |
+
'ago' => ':time më parë',
|
28 |
+
'from_now' => ':time nga tani',
|
29 |
+
'after' => ':time pas',
|
30 |
+
'before' => ':time para',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count godina|:count godine|:count godina',
|
14 |
-
'y' => ':count godina|:count godine|:count godina',
|
15 |
-
'month' => ':count mesec|:count meseca|:count meseci',
|
16 |
-
'm' => ':count mesec|:count meseca|:count meseci',
|
17 |
-
'week' => ':count nedelja|:count nedelje|:count nedelja',
|
18 |
-
'w' => ':count nedelja|:count nedelje|:count nedelja',
|
19 |
-
'day' => ':count dan|:count dana|:count dana',
|
20 |
-
'd' => ':count dan|:count dana|:count dana',
|
21 |
-
'hour' => ':count sat|:count sata|:count sati',
|
22 |
-
'h' => ':count sat|:count sata|:count sati',
|
23 |
-
'minute' => ':count minut|:count minuta |:count minuta',
|
24 |
-
'min' => ':count minut|:count minuta |:count minuta',
|
25 |
-
'second' => ':count sekund|:count sekunde|:count sekunde',
|
26 |
-
's' => ':count sekund|:count sekunde|:count sekunde',
|
27 |
-
'ago' => 'pre :time',
|
28 |
-
'from_now' => ':time od sada',
|
29 |
-
'after' => 'nakon :time',
|
30 |
-
'before' => 'pre :time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count godina|:count godine|:count godina',
|
14 |
+
'y' => ':count godina|:count godine|:count godina',
|
15 |
+
'month' => ':count mesec|:count meseca|:count meseci',
|
16 |
+
'm' => ':count mesec|:count meseca|:count meseci',
|
17 |
+
'week' => ':count nedelja|:count nedelje|:count nedelja',
|
18 |
+
'w' => ':count nedelja|:count nedelje|:count nedelja',
|
19 |
+
'day' => ':count dan|:count dana|:count dana',
|
20 |
+
'd' => ':count dan|:count dana|:count dana',
|
21 |
+
'hour' => ':count sat|:count sata|:count sati',
|
22 |
+
'h' => ':count sat|:count sata|:count sati',
|
23 |
+
'minute' => ':count minut|:count minuta |:count minuta',
|
24 |
+
'min' => ':count minut|:count minuta |:count minuta',
|
25 |
+
'second' => ':count sekund|:count sekunde|:count sekunde',
|
26 |
+
's' => ':count sekund|:count sekunde|:count sekunde',
|
27 |
+
'ago' => 'pre :time',
|
28 |
+
'from_now' => ':time od sada',
|
29 |
+
'after' => 'nakon :time',
|
30 |
+
'before' => 'pre :time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_Cyrl_ME.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година',
|
14 |
-
'y' => ':count г.',
|
15 |
-
'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци',
|
16 |
-
'm' => ':count мј.',
|
17 |
-
'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља',
|
18 |
-
'w' => ':count нед.',
|
19 |
-
'day' => '{1,21,31} :count дан|[2,Inf[ :count дана',
|
20 |
-
'd' => ':count д.',
|
21 |
-
'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати',
|
22 |
-
'h' => ':count ч.',
|
23 |
-
'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута',
|
24 |
-
'min' => ':count мин.',
|
25 |
-
'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди',
|
26 |
-
's' => ':count сек.',
|
27 |
-
'ago' => 'прије :time',
|
28 |
-
'from_now' => 'за :time',
|
29 |
-
'after' => ':time након',
|
30 |
-
'before' => ':time прије',
|
31 |
-
|
32 |
-
'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
33 |
-
'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
34 |
-
|
35 |
-
'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
36 |
-
'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
37 |
-
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година',
|
14 |
+
'y' => ':count г.',
|
15 |
+
'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци',
|
16 |
+
'm' => ':count мј.',
|
17 |
+
'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља',
|
18 |
+
'w' => ':count нед.',
|
19 |
+
'day' => '{1,21,31} :count дан|[2,Inf[ :count дана',
|
20 |
+
'd' => ':count д.',
|
21 |
+
'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати',
|
22 |
+
'h' => ':count ч.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута',
|
24 |
+
'min' => ':count мин.',
|
25 |
+
'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди',
|
26 |
+
's' => ':count сек.',
|
27 |
+
'ago' => 'прије :time',
|
28 |
+
'from_now' => 'за :time',
|
29 |
+
'after' => ':time након',
|
30 |
+
'before' => ':time прије',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
36 |
+
'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
37 |
+
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_Latn_ME.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
-
'y' => ':count g.',
|
15 |
-
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
-
'm' => ':count mj.',
|
17 |
-
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
-
'w' => ':count ned.',
|
19 |
-
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
-
'd' => ':count d.',
|
21 |
-
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
-
'h' => ':count č.',
|
23 |
-
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
-
'min' => ':count min.',
|
25 |
-
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
-
's' => ':count sek.',
|
27 |
-
'ago' => 'prije :time',
|
28 |
-
'from_now' => 'za :time',
|
29 |
-
'after' => ':time nakon',
|
30 |
-
'before' => ':time prije',
|
31 |
-
|
32 |
-
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
-
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
-
|
35 |
-
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
-
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
-
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
+
'y' => ':count g.',
|
15 |
+
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
+
'm' => ':count mj.',
|
17 |
+
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
+
'w' => ':count ned.',
|
19 |
+
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
+
'd' => ':count d.',
|
21 |
+
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
+
'h' => ':count č.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
+
'min' => ':count min.',
|
25 |
+
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
+
's' => ':count sek.',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time nakon',
|
30 |
+
'before' => ':time prije',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
+
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
+
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sr_ME.php
RENAMED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
-
'y' => ':count g.',
|
15 |
-
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
-
'm' => ':count mj.',
|
17 |
-
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
-
'w' => ':count ned.',
|
19 |
-
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
-
'd' => ':count d.',
|
21 |
-
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
-
'h' => ':count č.',
|
23 |
-
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
-
'min' => ':count min.',
|
25 |
-
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
-
's' => ':count sek.',
|
27 |
-
'ago' => 'prije :time',
|
28 |
-
'from_now' => 'za :time',
|
29 |
-
'after' => ':time nakon',
|
30 |
-
'before' => ':time prije',
|
31 |
-
|
32 |
-
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
-
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
-
|
35 |
-
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
-
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
-
|
38 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
+
'y' => ':count g.',
|
15 |
+
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
+
'm' => ':count mj.',
|
17 |
+
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
+
'w' => ':count ned.',
|
19 |
+
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
+
'd' => ':count d.',
|
21 |
+
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
+
'h' => ':count č.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
+
'min' => ':count min.',
|
25 |
+
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
+
's' => ':count sek.',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time nakon',
|
30 |
+
'before' => ':time prije',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
+
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
+
|
38 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/sv.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 år|:count år',
|
14 |
-
'y' => '1 år|:count år',
|
15 |
-
'month' => '1 månad|:count månader',
|
16 |
-
'm' => '1 månad|:count månader',
|
17 |
-
'week' => '1 vecka|:count veckor',
|
18 |
-
'w' => '1 vecka|:count veckor',
|
19 |
-
'day' => '1 dag|:count dagar',
|
20 |
-
'd' => '1 dag|:count dagar',
|
21 |
-
'hour' => '1 timme|:count timmar',
|
22 |
-
'h' => '1 timme|:count timmar',
|
23 |
-
'minute' => '1 minut|:count minuter',
|
24 |
-
'min' => '1 minut|:count minuter',
|
25 |
-
'second' => '1 sekund|:count sekunder',
|
26 |
-
's' => '1 sekund|:count sekunder',
|
27 |
-
'ago' => ':time sedan',
|
28 |
-
'from_now' => 'om :time',
|
29 |
-
'after' => ':time efter',
|
30 |
-
'before' => ':time före',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 månad|:count månader',
|
16 |
+
'm' => '1 månad|:count månader',
|
17 |
+
'week' => '1 vecka|:count veckor',
|
18 |
+
'w' => '1 vecka|:count veckor',
|
19 |
+
'day' => '1 dag|:count dagar',
|
20 |
+
'd' => '1 dag|:count dagar',
|
21 |
+
'hour' => '1 timme|:count timmar',
|
22 |
+
'h' => '1 timme|:count timmar',
|
23 |
+
'minute' => '1 minut|:count minuter',
|
24 |
+
'min' => '1 minut|:count minuter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time sedan',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time efter',
|
30 |
+
'before' => ':time före',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/th.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => '1 ปี|:count ปี',
|
14 |
-
'y' => '1 ปี|:count ปี',
|
15 |
-
'month' => '1 เดือน|:count เดือน',
|
16 |
-
'm' => '1 เดือน|:count เดือน',
|
17 |
-
'week' => '1 สัปดาห์|:count สัปดาห์',
|
18 |
-
'w' => '1 สัปดาห์|:count สัปดาห์',
|
19 |
-
'day' => '1 วัน|:count วัน',
|
20 |
-
'd' => '1 วัน|:count วัน',
|
21 |
-
'hour' => '1 ชั่วโมง|:count ชั่วโมง',
|
22 |
-
'h' => '1 ชั่วโมง|:count ชั่วโมง',
|
23 |
-
'minute' => '1 นาที|:count นาที',
|
24 |
-
'min' => '1 นาที|:count นาที',
|
25 |
-
'second' => '1 วินาที|:count วินาที',
|
26 |
-
's' => '1 วินาที|:count วินาที',
|
27 |
-
'ago' => ':time ที่แล้ว',
|
28 |
-
'from_now' => ':time จากนี้',
|
29 |
-
'after' => 'หลัง:time',
|
30 |
-
'before' => 'ก่อน:time',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ปี|:count ปี',
|
14 |
+
'y' => '1 ปี|:count ปี',
|
15 |
+
'month' => '1 เดือน|:count เดือน',
|
16 |
+
'm' => '1 เดือน|:count เดือน',
|
17 |
+
'week' => '1 สัปดาห์|:count สัปดาห์',
|
18 |
+
'w' => '1 สัปดาห์|:count สัปดาห์',
|
19 |
+
'day' => '1 วัน|:count วัน',
|
20 |
+
'd' => '1 วัน|:count วัน',
|
21 |
+
'hour' => '1 ชั่วโมง|:count ชั่วโมง',
|
22 |
+
'h' => '1 ชั่วโมง|:count ชั่วโมง',
|
23 |
+
'minute' => '1 นาที|:count นาที',
|
24 |
+
'min' => '1 นาที|:count นาที',
|
25 |
+
'second' => '1 วินาที|:count วินาที',
|
26 |
+
's' => '1 วินาที|:count วินาที',
|
27 |
+
'ago' => ':time ที่แล้ว',
|
28 |
+
'from_now' => ':time จากนี้',
|
29 |
+
'after' => 'หลัง:time',
|
30 |
+
'before' => 'ก่อน:time',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/tr.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count yıl',
|
14 |
-
'y' => ':count yıl',
|
15 |
-
'month' => ':count ay',
|
16 |
-
'm' => ':count ay',
|
17 |
-
'week' => ':count hafta',
|
18 |
-
'w' => ':count hafta',
|
19 |
-
'day' => ':count gün',
|
20 |
-
'd' => ':count gün',
|
21 |
-
'hour' => ':count saat',
|
22 |
-
'h' => ':count saat',
|
23 |
-
'minute' => ':count dakika',
|
24 |
-
'min' => ':count dakika',
|
25 |
-
'second' => ':count saniye',
|
26 |
-
's' => ':count saniye',
|
27 |
-
'ago' => ':time önce',
|
28 |
-
'from_now' => ':time sonra',
|
29 |
-
'after' => ':time sonra',
|
30 |
-
'before' => ':time önce',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count yıl',
|
14 |
+
'y' => ':count yıl',
|
15 |
+
'month' => ':count ay',
|
16 |
+
'm' => ':count ay',
|
17 |
+
'week' => ':count hafta',
|
18 |
+
'w' => ':count hafta',
|
19 |
+
'day' => ':count gün',
|
20 |
+
'd' => ':count gün',
|
21 |
+
'hour' => ':count saat',
|
22 |
+
'h' => ':count saat',
|
23 |
+
'minute' => ':count dakika',
|
24 |
+
'min' => ':count dakika',
|
25 |
+
'second' => ':count saniye',
|
26 |
+
's' => ':count saniye',
|
27 |
+
'ago' => ':time önce',
|
28 |
+
'from_now' => ':time sonra',
|
29 |
+
'after' => ':time sonra',
|
30 |
+
'before' => ':time önce',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/uk.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count рік|:count роки|:count років',
|
14 |
-
'y' => ':count рік|:count роки|:count років',
|
15 |
-
'month' => ':count місяць|:count місяці|:count місяців',
|
16 |
-
'm' => ':count місяць|:count місяці|:count місяців',
|
17 |
-
'week' => ':count тиждень|:count тижні|:count тижнів',
|
18 |
-
'w' => ':count тиждень|:count тижні|:count тижнів',
|
19 |
-
'day' => ':count день|:count дні|:count днів',
|
20 |
-
'd' => ':count день|:count дні|:count днів',
|
21 |
-
'hour' => ':count година|:count години|:count годин',
|
22 |
-
'h' => ':count година|:count години|:count годин',
|
23 |
-
'minute' => ':count хвилину|:count хвилини|:count хвилин',
|
24 |
-
'min' => ':count хвилину|:count хвилини|:count хвилин',
|
25 |
-
'second' => ':count секунду|:count секунди|:count секунд',
|
26 |
-
's' => ':count секунду|:count секунди|:count секунд',
|
27 |
-
'ago' => ':time назад',
|
28 |
-
'from_now' => 'через :time',
|
29 |
-
'after' => ':time після',
|
30 |
-
'before' => ':time до',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count рік|:count роки|:count років',
|
14 |
+
'y' => ':count рік|:count роки|:count років',
|
15 |
+
'month' => ':count місяць|:count місяці|:count місяців',
|
16 |
+
'm' => ':count місяць|:count місяці|:count місяців',
|
17 |
+
'week' => ':count тиждень|:count тижні|:count тижнів',
|
18 |
+
'w' => ':count тиждень|:count тижні|:count тижнів',
|
19 |
+
'day' => ':count день|:count дні|:count днів',
|
20 |
+
'd' => ':count день|:count дні|:count днів',
|
21 |
+
'hour' => ':count година|:count години|:count годин',
|
22 |
+
'h' => ':count година|:count години|:count годин',
|
23 |
+
'minute' => ':count хвилину|:count хвилини|:count хвилин',
|
24 |
+
'min' => ':count хвилину|:count хвилини|:count хвилин',
|
25 |
+
'second' => ':count секунду|:count секунди|:count секунд',
|
26 |
+
's' => ':count секунду|:count секунди|:count секунд',
|
27 |
+
'ago' => ':time назад',
|
28 |
+
'from_now' => 'через :time',
|
29 |
+
'after' => ':time після',
|
30 |
+
'before' => ':time до',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/ur.php
RENAMED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count سال',
|
14 |
-
'month' => ':count ماه',
|
15 |
-
'week' => ':count ہفتے',
|
16 |
-
'day' => ':count روز',
|
17 |
-
'hour' => ':count گھنٹے',
|
18 |
-
'minute' => ':count منٹ',
|
19 |
-
'second' => ':count سیکنڈ',
|
20 |
-
'ago' => ':time پہلے',
|
21 |
-
'from_now' => ':time بعد',
|
22 |
-
'after' => ':time بعد',
|
23 |
-
'before' => ':time پہلے',
|
24 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count سال',
|
14 |
+
'month' => ':count ماه',
|
15 |
+
'week' => ':count ہفتے',
|
16 |
+
'day' => ':count روز',
|
17 |
+
'hour' => ':count گھنٹے',
|
18 |
+
'minute' => ':count منٹ',
|
19 |
+
'second' => ':count سیکنڈ',
|
20 |
+
'ago' => ':time پہلے',
|
21 |
+
'from_now' => ':time بعد',
|
22 |
+
'after' => ':time بعد',
|
23 |
+
'before' => ':time پہلے',
|
24 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/uz.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count yil|:count yil|:count yil',
|
14 |
-
'y' => ':count yil|:count yil|:count yil',
|
15 |
-
'month' => ':count oy|:count oy|:count oylar',
|
16 |
-
'm' => ':count oy|:count oy|:count oylar',
|
17 |
-
'week' => ':count hafta|:count hafta|:count hafta',
|
18 |
-
'w' => ':count hafta|:count hafta|:count hafta',
|
19 |
-
'day' => ':count kun|:count kun|:count kun',
|
20 |
-
'd' => ':count kun|:count kun|:count kun',
|
21 |
-
'hour' => ':count soat|:count soat|:count soat',
|
22 |
-
'h' => ':count soat|:count soat|:count soat',
|
23 |
-
'minute' => ':count minut|:count minut|:count minut',
|
24 |
-
'min' => ':count minut|:count minut|:count minut',
|
25 |
-
'second' => ':count sekund|:count sekund|:count sekund',
|
26 |
-
's' => ':count sekund|:count sekund|:count sekund',
|
27 |
-
'ago' => ':time avval',
|
28 |
-
'from_now' => ':time keyin',
|
29 |
-
'after' => ':time keyin',
|
30 |
-
'before' => ':time oldin',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count yil|:count yil|:count yil',
|
14 |
+
'y' => ':count yil|:count yil|:count yil',
|
15 |
+
'month' => ':count oy|:count oy|:count oylar',
|
16 |
+
'm' => ':count oy|:count oy|:count oylar',
|
17 |
+
'week' => ':count hafta|:count hafta|:count hafta',
|
18 |
+
'w' => ':count hafta|:count hafta|:count hafta',
|
19 |
+
'day' => ':count kun|:count kun|:count kun',
|
20 |
+
'd' => ':count kun|:count kun|:count kun',
|
21 |
+
'hour' => ':count soat|:count soat|:count soat',
|
22 |
+
'h' => ':count soat|:count soat|:count soat',
|
23 |
+
'minute' => ':count minut|:count minut|:count minut',
|
24 |
+
'min' => ':count minut|:count minut|:count minut',
|
25 |
+
'second' => ':count sekund|:count sekund|:count sekund',
|
26 |
+
's' => ':count sekund|:count sekund|:count sekund',
|
27 |
+
'ago' => ':time avval',
|
28 |
+
'from_now' => ':time keyin',
|
29 |
+
'after' => ':time keyin',
|
30 |
+
'before' => ':time oldin',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/vi.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count năm',
|
14 |
-
'y' => ':count năm',
|
15 |
-
'month' => ':count tháng',
|
16 |
-
'm' => ':count tháng',
|
17 |
-
'week' => ':count tuần',
|
18 |
-
'w' => ':count tuần',
|
19 |
-
'day' => ':count ngày',
|
20 |
-
'd' => ':count ngày',
|
21 |
-
'hour' => ':count giờ',
|
22 |
-
'h' => ':count giờ',
|
23 |
-
'minute' => ':count phút',
|
24 |
-
'min' => ':count phút',
|
25 |
-
'second' => ':count giây',
|
26 |
-
's' => ':count giây',
|
27 |
-
'ago' => ':time trước',
|
28 |
-
'from_now' => ':time từ bây giờ',
|
29 |
-
'after' => ':time sau',
|
30 |
-
'before' => ':time trước',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count năm',
|
14 |
+
'y' => ':count năm',
|
15 |
+
'month' => ':count tháng',
|
16 |
+
'm' => ':count tháng',
|
17 |
+
'week' => ':count tuần',
|
18 |
+
'w' => ':count tuần',
|
19 |
+
'day' => ':count ngày',
|
20 |
+
'd' => ':count ngày',
|
21 |
+
'hour' => ':count giờ',
|
22 |
+
'h' => ':count giờ',
|
23 |
+
'minute' => ':count phút',
|
24 |
+
'min' => ':count phút',
|
25 |
+
'second' => ':count giây',
|
26 |
+
's' => ':count giây',
|
27 |
+
'ago' => ':time trước',
|
28 |
+
'from_now' => ':time từ bây giờ',
|
29 |
+
'after' => ':time sau',
|
30 |
+
'before' => ':time trước',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/zh.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count年',
|
14 |
-
'y' => ':count年',
|
15 |
-
'month' => ':count个月',
|
16 |
-
'm' => ':count个月',
|
17 |
-
'week' => ':count周',
|
18 |
-
'w' => ':count周',
|
19 |
-
'day' => ':count天',
|
20 |
-
'd' => ':count天',
|
21 |
-
'hour' => ':count小时',
|
22 |
-
'h' => ':count小时',
|
23 |
-
'minute' => ':count分钟',
|
24 |
-
'min' => ':count分钟',
|
25 |
-
'second' => ':count秒',
|
26 |
-
's' => ':count秒',
|
27 |
-
'ago' => ':time前',
|
28 |
-
'from_now' => '距现在:time',
|
29 |
-
'after' => ':time后',
|
30 |
-
'before' => ':time前',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count年',
|
14 |
+
'y' => ':count年',
|
15 |
+
'month' => ':count个月',
|
16 |
+
'm' => ':count个月',
|
17 |
+
'week' => ':count周',
|
18 |
+
'w' => ':count周',
|
19 |
+
'day' => ':count天',
|
20 |
+
'd' => ':count天',
|
21 |
+
'hour' => ':count小时',
|
22 |
+
'h' => ':count小时',
|
23 |
+
'minute' => ':count分钟',
|
24 |
+
'min' => ':count分钟',
|
25 |
+
'second' => ':count秒',
|
26 |
+
's' => ':count秒',
|
27 |
+
'ago' => ':time前',
|
28 |
+
'from_now' => '距现在:time',
|
29 |
+
'after' => ':time后',
|
30 |
+
'before' => ':time前',
|
31 |
+
);
|
src/common/lib/{Carbon → vendor/nesbot/carbon/src/Carbon}/Lang/zh_TW.php
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Carbon package.
|
5 |
-
*
|
6 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
return array(
|
13 |
-
'year' => ':count 年',
|
14 |
-
'y' => ':count 年',
|
15 |
-
'month' => ':count 月',
|
16 |
-
'm' => ':count 月',
|
17 |
-
'week' => ':count 周',
|
18 |
-
'w' => ':count 周',
|
19 |
-
'day' => ':count 天',
|
20 |
-
'd' => ':count 天',
|
21 |
-
'hour' => ':count 小時',
|
22 |
-
'h' => ':count 小時',
|
23 |
-
'minute' => ':count 分鐘',
|
24 |
-
'min' => ':count 分鐘',
|
25 |
-
'second' => ':count 秒',
|
26 |
-
's' => ':count 秒',
|
27 |
-
'ago' => ':time前',
|
28 |
-
'from_now' => '距現在 :time',
|
29 |
-
'after' => ':time後',
|
30 |
-
'before' => ':time前',
|
31 |
-
);
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count 年',
|
14 |
+
'y' => ':count 年',
|
15 |
+
'month' => ':count 月',
|
16 |
+
'm' => ':count 月',
|
17 |
+
'week' => ':count 周',
|
18 |
+
'w' => ':count 周',
|
19 |
+
'day' => ':count 天',
|
20 |
+
'd' => ':count 天',
|
21 |
+
'hour' => ':count 小時',
|
22 |
+
'h' => ':count 小時',
|
23 |
+
'minute' => ':count 分鐘',
|
24 |
+
'min' => ':count 分鐘',
|
25 |
+
'second' => ':count 秒',
|
26 |
+
's' => ':count 秒',
|
27 |
+
'ago' => ':time前',
|
28 |
+
'from_now' => '距現在 :time',
|
29 |
+
'after' => ':time後',
|
30 |
+
'before' => ':time前',
|
31 |
+
);
|
src/common/lib/vendor/symfony/polyfill-mbstring/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2014-2016 Fabien Potencier
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
8 |
+
to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in all
|
11 |
+
copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
src/common/lib/vendor/symfony/polyfill-mbstring/Mbstring.php
ADDED
@@ -0,0 +1,664 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Polyfill\Mbstring;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
|
16 |
+
*
|
17 |
+
* Implemented:
|
18 |
+
* - mb_chr - Returns a specific character from its Unicode code point
|
19 |
+
* - mb_convert_encoding - Convert character encoding
|
20 |
+
* - mb_convert_variables - Convert character code in variable(s)
|
21 |
+
* - mb_decode_mimeheader - Decode string in MIME header field
|
22 |
+
* - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED
|
23 |
+
* - mb_convert_case - Perform case folding on a string
|
24 |
+
* - mb_get_info - Get internal settings of mbstring
|
25 |
+
* - mb_http_input - Detect HTTP input character encoding
|
26 |
+
* - mb_http_output - Set/Get HTTP output character encoding
|
27 |
+
* - mb_internal_encoding - Set/Get internal character encoding
|
28 |
+
* - mb_list_encodings - Returns an array of all supported encodings
|
29 |
+
* - mb_ord - Returns the Unicode code point of a character
|
30 |
+
* - mb_output_handler - Callback function converts character encoding in output buffer
|
31 |
+
* - mb_scrub - Replaces ill-formed byte sequences with substitute characters
|
32 |
+
* - mb_strlen - Get string length
|
33 |
+
* - mb_strpos - Find position of first occurrence of string in a string
|
34 |
+
* - mb_strrpos - Find position of last occurrence of a string in a string
|
35 |
+
* - mb_strtolower - Make a string lowercase
|
36 |
+
* - mb_strtoupper - Make a string uppercase
|
37 |
+
* - mb_substitute_character - Set/Get substitution character
|
38 |
+
* - mb_substr - Get part of string
|
39 |
+
* - mb_stripos - Finds position of first occurrence of a string within another, case insensitive
|
40 |
+
* - mb_stristr - Finds first occurrence of a string within another, case insensitive
|
41 |
+
* - mb_strrchr - Finds the last occurrence of a character in a string within another
|
42 |
+
* - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive
|
43 |
+
* - mb_strripos - Finds position of last occurrence of a string within another, case insensitive
|
44 |
+
* - mb_strstr - Finds first occurrence of a string within anothers
|
45 |
+
* - mb_strwidth - Return width of string
|
46 |
+
* - mb_substr_count - Count the number of substring occurrences
|
47 |
+
*
|
48 |
+
* Not implemented:
|
49 |
+
* - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
|
50 |
+
* - mb_decode_numericentity - Decode HTML numeric string reference to character
|
51 |
+
* - mb_encode_numericentity - Encode character to HTML numeric string reference
|
52 |
+
* - mb_ereg_* - Regular expression with multibyte support
|
53 |
+
* - mb_parse_str - Parse GET/POST/COOKIE data and set global variable
|
54 |
+
* - mb_preferred_mime_name - Get MIME charset string
|
55 |
+
* - mb_regex_encoding - Returns current encoding for multibyte regex as string
|
56 |
+
* - mb_regex_set_options - Set/Get the default options for mbregex functions
|
57 |
+
* - mb_send_mail - Send encoded mail
|
58 |
+
* - mb_split - Split multibyte string using regular expression
|
59 |
+
* - mb_strcut - Get part of string
|
60 |
+
* - mb_strimwidth - Get truncated string with specified width
|
61 |
+
*
|
62 |
+
* @author Nicolas Grekas <p@tchwork.com>
|
63 |
+
*
|
64 |
+
* @internal
|
65 |
+
*/
|
66 |
+
final class Mbstring
|
67 |
+
{
|
68 |
+
const MB_CASE_FOLD = PHP_INT_MAX;
|
69 |
+
|
70 |
+
private static $encodingList = array('ASCII', 'UTF-8');
|
71 |
+
private static $language = 'neutral';
|
72 |
+
private static $internalEncoding = 'UTF-8';
|
73 |
+
private static $caseFold = array(
|
74 |
+
array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"),
|
75 |
+
array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι'),
|
76 |
+
);
|
77 |
+
|
78 |
+
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
|
79 |
+
{
|
80 |
+
if (is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
|
81 |
+
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
|
82 |
+
} else {
|
83 |
+
$fromEncoding = self::getEncoding($fromEncoding);
|
84 |
+
}
|
85 |
+
|
86 |
+
$toEncoding = self::getEncoding($toEncoding);
|
87 |
+
|
88 |
+
if ('BASE64' === $fromEncoding) {
|
89 |
+
$s = base64_decode($s);
|
90 |
+
$fromEncoding = $toEncoding;
|
91 |
+
}
|
92 |
+
|
93 |
+
if ('BASE64' === $toEncoding) {
|
94 |
+
return base64_encode($s);
|
95 |
+
}
|
96 |
+
|
97 |
+
if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) {
|
98 |
+
if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) {
|
99 |
+
$fromEncoding = 'Windows-1252';
|
100 |
+
}
|
101 |
+
if ('UTF-8' !== $fromEncoding) {
|
102 |
+
$s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
|
103 |
+
}
|
104 |
+
|
105 |
+
return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
|
106 |
+
}
|
107 |
+
|
108 |
+
if ('HTML-ENTITIES' === $fromEncoding) {
|
109 |
+
$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
|
110 |
+
$fromEncoding = 'UTF-8';
|
111 |
+
}
|
112 |
+
|
113 |
+
return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
|
114 |
+
}
|
115 |
+
|
116 |
+
public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
|
117 |
+
{
|
118 |
+
$vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
|
119 |
+
|
120 |
+
$ok = true;
|
121 |
+
array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) {
|
122 |
+
if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
|
123 |
+
$ok = false;
|
124 |
+
}
|
125 |
+
});
|
126 |
+
|
127 |
+
return $ok ? $fromEncoding : false;
|
128 |
+
}
|
129 |
+
|
130 |
+
public static function mb_decode_mimeheader($s)
|
131 |
+
{
|
132 |
+
return iconv_mime_decode($s, 2, self::$internalEncoding);
|
133 |
+
}
|
134 |
+
|
135 |
+
public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
|
136 |
+
{
|
137 |
+
trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING);
|
138 |
+
}
|
139 |
+
|
140 |
+
public static function mb_convert_case($s, $mode, $encoding = null)
|
141 |
+
{
|
142 |
+
if ('' === $s .= '') {
|
143 |
+
return '';
|
144 |
+
}
|
145 |
+
|
146 |
+
$encoding = self::getEncoding($encoding);
|
147 |
+
|
148 |
+
if ('UTF-8' === $encoding) {
|
149 |
+
$encoding = null;
|
150 |
+
if (!preg_match('//u', $s)) {
|
151 |
+
$s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
|
152 |
+
}
|
153 |
+
} else {
|
154 |
+
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
155 |
+
}
|
156 |
+
|
157 |
+
if (MB_CASE_TITLE == $mode) {
|
158 |
+
$s = preg_replace_callback('/\b\p{Ll}/u', array(__CLASS__, 'title_case_upper'), $s);
|
159 |
+
$s = preg_replace_callback('/\B[\p{Lu}\p{Lt}]+/u', array(__CLASS__, 'title_case_lower'), $s);
|
160 |
+
} else {
|
161 |
+
if (MB_CASE_UPPER == $mode) {
|
162 |
+
static $upper = null;
|
163 |
+
if (null === $upper) {
|
164 |
+
$upper = self::getData('upperCase');
|
165 |
+
}
|
166 |
+
$map = $upper;
|
167 |
+
} else {
|
168 |
+
if (self::MB_CASE_FOLD === $mode) {
|
169 |
+
$s = str_replace(self::$caseFold[0], self::$caseFold[1], $s);
|
170 |
+
}
|
171 |
+
|
172 |
+
static $lower = null;
|
173 |
+
if (null === $lower) {
|
174 |
+
$lower = self::getData('lowerCase');
|
175 |
+
}
|
176 |
+
$map = $lower;
|
177 |
+
}
|
178 |
+
|
179 |
+
static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
|
180 |
+
|
181 |
+
$i = 0;
|
182 |
+
$len = strlen($s);
|
183 |
+
|
184 |
+
while ($i < $len) {
|
185 |
+
$ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
|
186 |
+
$uchr = substr($s, $i, $ulen);
|
187 |
+
$i += $ulen;
|
188 |
+
|
189 |
+
if (isset($map[$uchr])) {
|
190 |
+
$uchr = $map[$uchr];
|
191 |
+
$nlen = strlen($uchr);
|
192 |
+
|
193 |
+
if ($nlen == $ulen) {
|
194 |
+
$nlen = $i;
|
195 |
+
do {
|
196 |
+
$s[--$nlen] = $uchr[--$ulen];
|
197 |
+
} while ($ulen);
|
198 |
+
} else {
|
199 |
+
$s = substr_replace($s, $uchr, $i - $ulen, $ulen);
|
200 |
+
$len += $nlen - $ulen;
|
201 |
+
$i += $nlen - $ulen;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
if (null === $encoding) {
|
208 |
+
return $s;
|
209 |
+
}
|
210 |
+
|
211 |
+
return iconv('UTF-8', $encoding.'//IGNORE', $s);
|
212 |
+
}
|
213 |
+
|
214 |
+
public static function mb_internal_encoding($encoding = null)
|
215 |
+
{
|
216 |
+
if (null === $encoding) {
|
217 |
+
return self::$internalEncoding;
|
218 |
+
}
|
219 |
+
|
220 |
+
$encoding = self::getEncoding($encoding);
|
221 |
+
|
222 |
+
if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) {
|
223 |
+
self::$internalEncoding = $encoding;
|
224 |
+
|
225 |
+
return true;
|
226 |
+
}
|
227 |
+
|
228 |
+
return false;
|
229 |
+
}
|
230 |
+
|
231 |
+
public static function mb_language($lang = null)
|
232 |
+
{
|
233 |
+
if (null === $lang) {
|
234 |
+
return self::$language;
|
235 |
+
}
|
236 |
+
|
237 |
+
switch ($lang = strtolower($lang)) {
|
238 |
+
case 'uni':
|
239 |
+
case 'neutral':
|
240 |
+
self::$language = $lang;
|
241 |
+
|
242 |
+
return true;
|
243 |
+
}
|
244 |
+
|
245 |
+
return false;
|
246 |
+
}
|
247 |
+
|
248 |
+
public static function mb_list_encodings()
|
249 |
+
{
|
250 |
+
return array('UTF-8');
|
251 |
+
}
|
252 |
+
|
253 |
+
public static function mb_encoding_aliases($encoding)
|
254 |
+
{
|
255 |
+
switch (strtoupper($encoding)) {
|
256 |
+
case 'UTF8':
|
257 |
+
case 'UTF-8':
|
258 |
+
return array('utf8');
|
259 |
+
}
|
260 |
+
|
261 |
+
return false;
|
262 |
+
}
|
263 |
+
|
264 |
+
public static function mb_check_encoding($var = null, $encoding = null)
|
265 |
+
{
|
266 |
+
if (null === $encoding) {
|
267 |
+
if (null === $var) {
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
$encoding = self::$internalEncoding;
|
271 |
+
}
|
272 |
+
|
273 |
+
return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var);
|
274 |
+
}
|
275 |
+
|
276 |
+
public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
|
277 |
+
{
|
278 |
+
if (null === $encodingList) {
|
279 |
+
$encodingList = self::$encodingList;
|
280 |
+
} else {
|
281 |
+
if (!is_array($encodingList)) {
|
282 |
+
$encodingList = array_map('trim', explode(',', $encodingList));
|
283 |
+
}
|
284 |
+
$encodingList = array_map('strtoupper', $encodingList);
|
285 |
+
}
|
286 |
+
|
287 |
+
foreach ($encodingList as $enc) {
|
288 |
+
switch ($enc) {
|
289 |
+
case 'ASCII':
|
290 |
+
if (!preg_match('/[\x80-\xFF]/', $str)) {
|
291 |
+
return $enc;
|
292 |
+
}
|
293 |
+
break;
|
294 |
+
|
295 |
+
case 'UTF8':
|
296 |
+
case 'UTF-8':
|
297 |
+
if (preg_match('//u', $str)) {
|
298 |
+
return 'UTF-8';
|
299 |
+
}
|
300 |
+
break;
|
301 |
+
|
302 |
+
default:
|
303 |
+
if (0 === strncmp($enc, 'ISO-8859-', 9)) {
|
304 |
+
return $enc;
|
305 |
+
}
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
return false;
|
310 |
+
}
|
311 |
+
|
312 |
+
public static function mb_detect_order($encodingList = null)
|
313 |
+
{
|
314 |
+
if (null === $encodingList) {
|
315 |
+
return self::$encodingList;
|
316 |
+
}
|
317 |
+
|
318 |
+
if (!is_array($encodingList)) {
|
319 |
+
$encodingList = array_map('trim', explode(',', $encodingList));
|
320 |
+
}
|
321 |
+
$encodingList = array_map('strtoupper', $encodingList);
|
322 |
+
|
323 |
+
foreach ($encodingList as $enc) {
|
324 |
+
switch ($enc) {
|
325 |
+
default:
|
326 |
+
if (strncmp($enc, 'ISO-8859-', 9)) {
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
case 'ASCII':
|
330 |
+
case 'UTF8':
|
331 |
+
case 'UTF-8':
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
self::$encodingList = $encodingList;
|
336 |
+
|
337 |
+
return true;
|
338 |
+
}
|
339 |
+
|
340 |
+
public static function mb_strlen($s, $encoding = null)
|
341 |
+
{
|
342 |
+
$encoding = self::getEncoding($encoding);
|
343 |
+
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
344 |
+
return strlen($s);
|
345 |
+
}
|
346 |
+
|
347 |
+
return @iconv_strlen($s, $encoding);
|
348 |
+
}
|
349 |
+
|
350 |
+
public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
|
351 |
+
{
|
352 |
+
$encoding = self::getEncoding($encoding);
|
353 |
+
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
354 |
+
return strpos($haystack, $needle, $offset);
|
355 |
+
}
|
356 |
+
|
357 |
+
if ('' === $needle .= '') {
|
358 |
+
trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING);
|
359 |
+
|
360 |
+
return false;
|
361 |
+
}
|
362 |
+
|
363 |
+
return iconv_strpos($haystack, $needle, $offset, $encoding);
|
364 |
+
}
|
365 |
+
|
366 |
+
public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
|
367 |
+
{
|
368 |
+
$encoding = self::getEncoding($encoding);
|
369 |
+
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
370 |
+
return strrpos($haystack, $needle, $offset);
|
371 |
+
}
|
372 |
+
|
373 |
+
if ($offset != (int) $offset) {
|
374 |
+
$offset = 0;
|
375 |
+
} elseif ($offset = (int) $offset) {
|
376 |
+
if ($offset < 0) {
|
377 |
+
$haystack = self::mb_substr($haystack, 0, $offset, $encoding);
|
378 |
+
$offset = 0;
|
379 |
+
} else {
|
380 |
+
$haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
385 |
+
|
386 |
+
return false !== $pos ? $offset + $pos : false;
|
387 |
+
}
|
388 |
+
|
389 |
+
public static function mb_strtolower($s, $encoding = null)
|
390 |
+
{
|
391 |
+
return self::mb_convert_case($s, MB_CASE_LOWER, $encoding);
|
392 |
+
}
|
393 |
+
|
394 |
+
public static function mb_strtoupper($s, $encoding = null)
|
395 |
+
{
|
396 |
+
return self::mb_convert_case($s, MB_CASE_UPPER, $encoding);
|
397 |
+
}
|
398 |
+
|
399 |
+
public static function mb_substitute_character($c = null)
|
400 |
+
{
|
401 |
+
if (0 === strcasecmp($c, 'none')) {
|
402 |
+
return true;
|
403 |
+
}
|
404 |
+
|
405 |
+
return null !== $c ? false : 'none';
|
406 |
+
}
|
407 |
+
|
408 |
+
public static function mb_substr($s, $start, $length = null, $encoding = null)
|
409 |
+
{
|
410 |
+
$encoding = self::getEncoding($encoding);
|
411 |
+
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
412 |
+
return substr($s, $start, null === $length ? 2147483647 : $length);
|
413 |
+
}
|
414 |
+
|
415 |
+
if ($start < 0) {
|
416 |
+
$start = iconv_strlen($s, $encoding) + $start;
|
417 |
+
if ($start < 0) {
|
418 |
+
$start = 0;
|
419 |
+
}
|
420 |
+
}
|
421 |
+
|
422 |
+
if (null === $length) {
|
423 |
+
$length = 2147483647;
|
424 |
+
} elseif ($length < 0) {
|
425 |
+
$length = iconv_strlen($s, $encoding) + $length - $start;
|
426 |
+
if ($length < 0) {
|
427 |
+
return '';
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
return iconv_substr($s, $start, $length, $encoding).'';
|
432 |
+
}
|
433 |
+
|
434 |
+
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
|
435 |
+
{
|
436 |
+
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
437 |
+
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
438 |
+
|
439 |
+
return self::mb_strpos($haystack, $needle, $offset, $encoding);
|
440 |
+
}
|
441 |
+
|
442 |
+
public static function mb_stristr($haystack, $needle, $part = false, $encoding = null)
|
443 |
+
{
|
444 |
+
$pos = self::mb_stripos($haystack, $needle, 0, $encoding);
|
445 |
+
|
446 |
+
return self::getSubpart($pos, $part, $haystack, $encoding);
|
447 |
+
}
|
448 |
+
|
449 |
+
public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null)
|
450 |
+
{
|
451 |
+
$encoding = self::getEncoding($encoding);
|
452 |
+
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
453 |
+
return strrchr($haystack, $needle, $part);
|
454 |
+
}
|
455 |
+
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
456 |
+
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
457 |
+
|
458 |
+
return self::getSubpart($pos, $part, $haystack, $encoding);
|
459 |
+
}
|
460 |
+
|
461 |
+
public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null)
|
462 |
+
{
|
463 |
+
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
464 |
+
$pos = self::mb_strripos($haystack, $needle, $encoding);
|
465 |
+
|
466 |
+
return self::getSubpart($pos, $part, $haystack, $encoding);
|
467 |
+
}
|
468 |
+
|
469 |
+
public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
|
470 |
+
{
|
471 |
+
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
472 |
+
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
473 |
+
|
474 |
+
return self::mb_strrpos($haystack, $needle, $offset, $encoding);
|
475 |
+
}
|
476 |
+
|
477 |
+
public static function mb_strstr($haystack, $needle, $part = false, $encoding = null)
|
478 |
+
{
|
479 |
+
$pos = strpos($haystack, $needle);
|
480 |
+
if (false === $pos) {
|
481 |
+
return false;
|
482 |
+
}
|
483 |
+
if ($part) {
|
484 |
+
return substr($haystack, 0, $pos);
|
485 |
+
}
|
486 |
+
|
487 |
+
return substr($haystack, $pos);
|
488 |
+
}
|
489 |
+
|
490 |
+
public static function mb_get_info($type = 'all')
|
491 |
+
{
|
492 |
+
$info = array(
|
493 |
+
'internal_encoding' => self::$internalEncoding,
|
494 |
+
'http_output' => 'pass',
|
495 |
+
'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)',
|
496 |
+
'func_overload' => 0,
|
497 |
+
'func_overload_list' => 'no overload',
|
498 |
+
'mail_charset' => 'UTF-8',
|
499 |
+
'mail_header_encoding' => 'BASE64',
|
500 |
+
'mail_body_encoding' => 'BASE64',
|
501 |
+
'illegal_chars' => 0,
|
502 |
+
'encoding_translation' => 'Off',
|
503 |
+
'language' => self::$language,
|
504 |
+
'detect_order' => self::$encodingList,
|
505 |
+
'substitute_character' => 'none',
|
506 |
+
'strict_detection' => 'Off',
|
507 |
+
);
|
508 |
+
|
509 |
+
if ('all' === $type) {
|
510 |
+
return $info;
|
511 |
+
}
|
512 |
+
if (isset($info[$type])) {
|
513 |
+
return $info[$type];
|
514 |
+
}
|
515 |
+
|
516 |
+
return false;
|
517 |
+
}
|
518 |
+
|
519 |
+
public static function mb_http_input($type = '')
|
520 |
+
{
|
521 |
+
return false;
|
522 |
+
}
|
523 |
+
|
524 |
+
public static function mb_http_output($encoding = null)
|
525 |
+
{
|
526 |
+
return null !== $encoding ? 'pass' === $encoding : 'pass';
|
527 |
+
}
|
528 |
+
|
529 |
+
public static function mb_strwidth($s, $encoding = null)
|
530 |
+
{
|
531 |
+
$encoding = self::getEncoding($encoding);
|
532 |
+
|
533 |
+
if ('UTF-8' !== $encoding) {
|
534 |
+
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
535 |
+
}
|
536 |
+
|
537 |
+
$s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
|
538 |
+
|
539 |
+
return ($wide << 1) + iconv_strlen($s, 'UTF-8');
|
540 |
+
}
|
541 |
+
|
542 |
+
public static function mb_substr_count($haystack, $needle, $encoding = null)
|
543 |
+
{
|
544 |
+
return substr_count($haystack, $needle);
|
545 |
+
}
|
546 |
+
|
547 |
+
public static function mb_output_handler($contents, $status)
|
548 |
+
{
|
549 |
+
return $contents;
|
550 |
+
}
|
551 |
+
|
552 |
+
public static function mb_chr($code, $encoding = null)
|
553 |
+
{
|
554 |
+
if (0x80 > $code %= 0x200000) {
|
555 |
+
$s = chr($code);
|
556 |
+
} elseif (0x800 > $code) {
|
557 |
+
$s = chr(0xC0 | $code >> 6).chr(0x80 | $code & 0x3F);
|
558 |
+
} elseif (0x10000 > $code) {
|
559 |
+
$s = chr(0xE0 | $code >> 12).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F);
|
560 |
+
} else {
|
561 |
+
$s = chr(0xF0 | $code >> 18).chr(0x80 | $code >> 12 & 0x3F).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F);
|
562 |
+
}
|
563 |
+
|
564 |
+
if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
|
565 |
+
$s = mb_convert_encoding($s, $encoding, 'UTF-8');
|
566 |
+
}
|
567 |
+
|
568 |
+
return $s;
|
569 |
+
}
|
570 |
+
|
571 |
+
public static function mb_ord($s, $encoding = null)
|
572 |
+
{
|
573 |
+
if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
|
574 |
+
$s = mb_convert_encoding($s, 'UTF-8', $encoding);
|
575 |
+
}
|
576 |
+
|
577 |
+
$code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
|
578 |
+
if (0xF0 <= $code) {
|
579 |
+
return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
|
580 |
+
}
|
581 |
+
if (0xE0 <= $code) {
|
582 |
+
return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
|
583 |
+
}
|
584 |
+
if (0xC0 <= $code) {
|
585 |
+
return (($code - 0xC0) << 6) + $s[2] - 0x80;
|
586 |
+
}
|
587 |
+
|
588 |
+
return $code;
|
589 |
+
}
|
590 |
+
|
591 |
+
private static function getSubpart($pos, $part, $haystack, $encoding)
|
592 |
+
{
|
593 |
+
if (false === $pos) {
|
594 |
+
return false;
|
595 |
+
}
|
596 |
+
if ($part) {
|
597 |
+
return self::mb_substr($haystack, 0, $pos, $encoding);
|
598 |
+
}
|
599 |
+
|
600 |
+
return self::mb_substr($haystack, $pos, null, $encoding);
|
601 |
+
}
|
602 |
+
|
603 |
+
private static function html_encoding_callback($m)
|
604 |
+
{
|
605 |
+
$i = 1;
|
606 |
+
$entities = '';
|
607 |
+
$m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8'));
|
608 |
+
|
609 |
+
while (isset($m[$i])) {
|
610 |
+
if (0x80 > $m[$i]) {
|
611 |
+
$entities .= chr($m[$i++]);
|
612 |
+
continue;
|
613 |
+
}
|
614 |
+
if (0xF0 <= $m[$i]) {
|
615 |
+
$c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
|
616 |
+
} elseif (0xE0 <= $m[$i]) {
|
617 |
+
$c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
|
618 |
+
} else {
|
619 |
+
$c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80;
|
620 |
+
}
|
621 |
+
|
622 |
+
$entities .= '&#'.$c.';';
|
623 |
+
}
|
624 |
+
|
625 |
+
return $entities;
|
626 |
+
}
|
627 |
+
|
628 |
+
private static function title_case_lower($s)
|
629 |
+
{
|
630 |
+
return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8');
|
631 |
+
}
|
632 |
+
|
633 |
+
private static function title_case_upper($s)
|
634 |
+
{
|
635 |
+
return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8');
|
636 |
+
}
|
637 |
+
|
638 |
+
private static function getData($file)
|
639 |
+
{
|
640 |
+
if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) {
|
641 |
+
return require $file;
|
642 |
+
}
|
643 |
+
|
644 |
+
return false;
|
645 |
+
}
|
646 |
+
|
647 |
+
private static function getEncoding($encoding)
|
648 |
+
{
|
649 |
+
if (null === $encoding) {
|
650 |
+
return self::$internalEncoding;
|
651 |
+
}
|
652 |
+
|
653 |
+
$encoding = strtoupper($encoding);
|
654 |
+
|
655 |
+
if ('8BIT' === $encoding || 'BINARY' === $encoding) {
|
656 |
+
return 'CP850';
|
657 |
+
}
|
658 |
+
if ('UTF8' === $encoding) {
|
659 |
+
return 'UTF-8';
|
660 |
+
}
|
661 |
+
|
662 |
+
return $encoding;
|
663 |
+
}
|
664 |
+
}
|
src/common/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
ADDED
@@ -0,0 +1,1101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
static $data = array (
|
4 |
+
'A' => 'a',
|
5 |
+
'B' => 'b',
|
6 |
+
'C' => 'c',
|
7 |
+
'D' => 'd',
|
8 |
+
'E' => 'e',
|
9 |
+
'F' => 'f',
|
10 |
+
'G' => 'g',
|
11 |
+
'H' => 'h',
|
12 |
+
'I' => 'i',
|
13 |
+
'J' => 'j',
|
14 |
+
'K' => 'k',
|
15 |
+
'L' => 'l',
|
16 |
+
'M' => 'm',
|
17 |
+
'N' => 'n',
|
18 |
+
'O' => 'o',
|
19 |
+
'P' => 'p',
|
20 |
+
'Q' => 'q',
|
21 |
+
'R' => 'r',
|
22 |
+
'S' => 's',
|
23 |
+
'T' => 't',
|
24 |
+
'U' => 'u',
|
25 |
+
'V' => 'v',
|
26 |
+
'W' => 'w',
|
27 |
+
'X' => 'x',
|
28 |
+
'Y' => 'y',
|
29 |
+
'Z' => 'z',
|
30 |
+
'À' => 'à',
|
31 |
+
'Á' => 'á',
|
32 |
+
'Â' => 'â',
|
33 |
+
'Ã' => 'ã',
|
34 |
+
'Ä' => 'ä',
|
35 |
+
'Å' => 'å',
|
36 |
+
'Æ' => 'æ',
|
37 |
+
'Ç' => 'ç',
|
38 |
+
'È' => 'è',
|
39 |
+
'É' => 'é',
|
40 |
+
'Ê' => 'ê',
|
41 |
+
'Ë' => 'ë',
|
42 |
+
'Ì' => 'ì',
|
43 |
+
'Í' => 'í',
|
44 |
+
'Î' => 'î',
|
45 |
+
'Ï' => 'ï',
|
46 |
+
'Ð' => 'ð',
|
47 |
+
'Ñ' => 'ñ',
|
48 |
+
'Ò' => 'ò',
|
49 |
+
'Ó' => 'ó',
|
50 |
+
'Ô' => 'ô',
|
51 |
+
'Õ' => 'õ',
|
52 |
+
'Ö' => 'ö',
|
53 |
+
'Ø' => 'ø',
|
54 |
+
'Ù' => 'ù',
|
55 |
+
'Ú' => 'ú',
|
56 |
+
'Û' => 'û',
|
57 |
+
'Ü' => 'ü',
|
58 |
+
'Ý' => 'ý',
|
59 |
+
'Þ' => 'þ',
|
60 |
+
'Ā' => 'ā',
|
61 |
+
'Ă' => 'ă',
|
62 |
+
'Ą' => 'ą',
|
63 |
+
'Ć' => 'ć',
|
64 |
+
'Ĉ' => 'ĉ',
|
65 |
+
'Ċ' => 'ċ',
|
66 |
+
'Č' => 'č',
|
67 |
+
'Ď' => 'ď',
|
68 |
+
'Đ' => 'đ',
|
69 |
+
'Ē' => 'ē',
|
70 |
+
'Ĕ' => 'ĕ',
|
71 |
+
'Ė' => 'ė',
|
72 |
+
'Ę' => 'ę',
|
73 |
+
'Ě' => 'ě',
|
74 |
+
'Ĝ' => 'ĝ',
|
75 |
+
'Ğ' => 'ğ',
|
76 |
+
'Ġ' => 'ġ',
|
77 |
+
'Ģ' => 'ģ',
|
78 |
+
'Ĥ' => 'ĥ',
|
79 |
+
'Ħ' => 'ħ',
|
80 |
+
'Ĩ' => 'ĩ',
|
81 |
+
'Ī' => 'ī',
|
82 |
+
'Ĭ' => 'ĭ',
|
83 |
+
'Į' => 'į',
|
84 |
+
'İ' => 'i',
|
85 |
+
'IJ' => 'ij',
|
86 |
+
'Ĵ' => 'ĵ',
|
87 |
+
'Ķ' => 'ķ',
|
88 |
+
'Ĺ' => 'ĺ',
|
89 |
+
'Ļ' => 'ļ',
|
90 |
+
'Ľ' => 'ľ',
|
91 |
+
'Ŀ' => 'ŀ',
|
92 |
+
'Ł' => 'ł',
|
93 |
+
'Ń' => 'ń',
|
94 |
+
'Ņ' => 'ņ',
|
95 |
+
'Ň' => 'ň',
|
96 |
+
'Ŋ' => 'ŋ',
|
97 |
+
'Ō' => 'ō',
|
98 |
+
'Ŏ' => 'ŏ',
|
99 |
+
'Ő' => 'ő',
|
100 |
+
'Œ' => 'œ',
|
101 |
+
'Ŕ' => 'ŕ',
|
102 |
+
'Ŗ' => 'ŗ',
|
103 |
+
'Ř' => 'ř',
|
104 |
+
'Ś' => 'ś',
|
105 |
+
'Ŝ' => 'ŝ',
|
106 |
+
'Ş' => 'ş',
|
107 |
+
'Š' => 'š',
|
108 |
+
'Ţ' => 'ţ',
|
109 |
+
'Ť' => 'ť',
|
110 |
+
'Ŧ' => 'ŧ',
|
111 |
+
'Ũ' => 'ũ',
|
112 |
+
'Ū' => 'ū',
|
113 |
+
'Ŭ' => 'ŭ',
|
114 |
+
'Ů' => 'ů',
|
115 |
+
'Ű' => 'ű',
|
116 |
+
'Ų' => 'ų',
|
117 |
+
'Ŵ' => 'ŵ',
|
118 |
+
'Ŷ' => 'ŷ',
|
119 |
+
'Ÿ' => 'ÿ',
|
120 |
+
'Ź' => 'ź',
|
121 |
+
'Ż' => 'ż',
|
122 |
+
'Ž' => 'ž',
|
123 |
+
'Ɓ' => 'ɓ',
|
124 |
+
'Ƃ' => 'ƃ',
|
125 |
+
'Ƅ' => 'ƅ',
|
126 |
+
'Ɔ' => 'ɔ',
|
127 |
+
'Ƈ' => 'ƈ',
|
128 |
+
'Ɖ' => 'ɖ',
|
129 |
+
'Ɗ' => 'ɗ',
|
130 |
+
'Ƌ' => 'ƌ',
|
131 |
+
'Ǝ' => 'ǝ',
|
132 |
+
'Ə' => 'ə',
|
133 |
+
'Ɛ' => 'ɛ',
|
134 |
+
'Ƒ' => 'ƒ',
|
135 |
+
'Ɠ' => 'ɠ',
|
136 |
+
'Ɣ' => 'ɣ',
|
137 |
+
'Ɩ' => 'ɩ',
|
138 |
+
'Ɨ' => 'ɨ',
|
139 |
+
'Ƙ' => 'ƙ',
|
140 |
+
'Ɯ' => 'ɯ',
|
141 |
+
'Ɲ' => 'ɲ',
|
142 |
+
'Ɵ' => 'ɵ',
|
143 |
+
'Ơ' => 'ơ',
|
144 |
+
'Ƣ' => 'ƣ',
|
145 |
+
'Ƥ' => 'ƥ',
|
146 |
+
'Ʀ' => 'ʀ',
|
147 |
+
'Ƨ' => 'ƨ',
|
148 |
+
'Ʃ' => 'ʃ',
|
149 |
+
'Ƭ' => 'ƭ',
|
150 |
+
'Ʈ' => 'ʈ',
|
151 |
+
'Ư' => 'ư',
|
152 |
+
'Ʊ' => 'ʊ',
|
153 |
+
'Ʋ' => 'ʋ',
|
154 |
+
'Ƴ' => 'ƴ',
|
155 |
+
'Ƶ' => 'ƶ',
|
156 |
+
'Ʒ' => 'ʒ',
|
157 |
+
'Ƹ' => 'ƹ',
|
158 |
+
'Ƽ' => 'ƽ',
|
159 |
+
'DŽ' => 'dž',
|
160 |
+
'Dž' => 'dž',
|
161 |
+
'LJ' => 'lj',
|
162 |
+
'Lj' => 'lj',
|
163 |
+
'NJ' => 'nj',
|
164 |
+
'Nj' => 'nj',
|
165 |
+
'Ǎ' => 'ǎ',
|
166 |
+
'Ǐ' => 'ǐ',
|
167 |
+
'Ǒ' => 'ǒ',
|
168 |
+
'Ǔ' => 'ǔ',
|
169 |
+
'Ǖ' => 'ǖ',
|
170 |
+
'Ǘ' => 'ǘ',
|
171 |
+
'Ǚ' => 'ǚ',
|
172 |
+
'Ǜ' => 'ǜ',
|
173 |
+
'Ǟ' => 'ǟ',
|
174 |
+
'Ǡ' => 'ǡ',
|
175 |
+
'Ǣ' => 'ǣ',
|
176 |
+
'Ǥ' => 'ǥ',
|
177 |
+
'Ǧ' => 'ǧ',
|
178 |
+
'Ǩ' => 'ǩ',
|
179 |
+
'Ǫ' => 'ǫ',
|
180 |
+
'Ǭ' => 'ǭ',
|
181 |
+
'Ǯ' => 'ǯ',
|
182 |
+
'DZ' => 'dz',
|
183 |
+
'Dz' => 'dz',
|
184 |
+
'Ǵ' => 'ǵ',
|
185 |
+
'Ƕ' => 'ƕ',
|
186 |
+
'Ƿ' => 'ƿ',
|
187 |
+
'Ǹ' => 'ǹ',
|
188 |
+
'Ǻ' => 'ǻ',
|
189 |
+
'Ǽ' => 'ǽ',
|
190 |
+
'Ǿ' => 'ǿ',
|
191 |
+
'Ȁ' => 'ȁ',
|
192 |
+
'Ȃ' => 'ȃ',
|
193 |
+
'Ȅ' => 'ȅ',
|
194 |
+
'Ȇ' => 'ȇ',
|
195 |
+
'Ȉ' => 'ȉ',
|
196 |
+
'Ȋ' => 'ȋ',
|
197 |
+
'Ȍ' => 'ȍ',
|
198 |
+
'Ȏ' => 'ȏ',
|
199 |
+
'Ȑ' => 'ȑ',
|
200 |
+
'Ȓ' => 'ȓ',
|
201 |
+
'Ȕ' => 'ȕ',
|
202 |
+
'Ȗ' => 'ȗ',
|
203 |
+
'Ș' => 'ș',
|
204 |
+
'Ț' => 'ț',
|
205 |
+
'Ȝ' => 'ȝ',
|
206 |
+
'Ȟ' => 'ȟ',
|
207 |
+
'Ƞ' => 'ƞ',
|
208 |
+
'Ȣ' => 'ȣ',
|
209 |
+
'Ȥ' => 'ȥ',
|
210 |
+
'Ȧ' => 'ȧ',
|
211 |
+
'Ȩ' => 'ȩ',
|
212 |
+
'Ȫ' => 'ȫ',
|
213 |
+
'Ȭ' => 'ȭ',
|
214 |
+
'Ȯ' => 'ȯ',
|
215 |
+
'Ȱ' => 'ȱ',
|
216 |
+
'Ȳ' => 'ȳ',
|
217 |
+
'Ⱥ' => 'ⱥ',
|
218 |
+
'Ȼ' => 'ȼ',
|
219 |
+
'Ƚ' => 'ƚ',
|
220 |
+
'Ⱦ' => 'ⱦ',
|
221 |
+
'Ɂ' => 'ɂ',
|
222 |
+
'Ƀ' => 'ƀ',
|
223 |
+
'Ʉ' => 'ʉ',
|
224 |
+
'Ʌ' => 'ʌ',
|
225 |
+
'Ɇ' => 'ɇ',
|
226 |
+
'Ɉ' => 'ɉ',
|
227 |
+
'Ɋ' => 'ɋ',
|
228 |
+
'Ɍ' => 'ɍ',
|
229 |
+
'Ɏ' => 'ɏ',
|
230 |
+
'Ͱ' => 'ͱ',
|
231 |
+
'Ͳ' => 'ͳ',
|
232 |
+
'Ͷ' => 'ͷ',
|
233 |
+
'Ϳ' => 'ϳ',
|
234 |
+
'Ά' => 'ά',
|
235 |
+
'Έ' => 'έ',
|
236 |
+
'Ή' => 'ή',
|
237 |
+
'Ί' => 'ί',
|
238 |
+
'Ό' => 'ό',
|
239 |
+
'Ύ' => 'ύ',
|
240 |
+
'Ώ' => 'ώ',
|
241 |
+
'Α' => 'α',
|
242 |
+
'Β' => 'β',
|
243 |
+
'Γ' => 'γ',
|
244 |
+
'Δ' => 'δ',
|
245 |
+
'Ε' => 'ε',
|
246 |
+
'Ζ' => 'ζ',
|
247 |
+
'Η' => 'η',
|
248 |
+
'Θ' => 'θ',
|
249 |
+
'Ι' => 'ι',
|
250 |
+
'Κ' => 'κ',
|
251 |
+
'Λ' => 'λ',
|
252 |
+
'Μ' => 'μ',
|
253 |
+
'Ν' => 'ν',
|
254 |
+
'Ξ' => 'ξ',
|
255 |
+
'Ο' => 'ο',
|
256 |
+
'Π' => 'π',
|
257 |
+
'Ρ' => 'ρ',
|
258 |
+
'Σ' => 'σ',
|
259 |
+
'Τ' => 'τ',
|
260 |
+
'Υ' => 'υ',
|
261 |
+
'Φ' => 'φ',
|
262 |
+
'Χ' => 'χ',
|
263 |
+
'Ψ' => 'ψ',
|
264 |
+
'Ω' => 'ω',
|
265 |
+
'Ϊ' => 'ϊ',
|
266 |
+
'Ϋ' => 'ϋ',
|
267 |
+
'Ϗ' => 'ϗ',
|
268 |
+
'Ϙ' => 'ϙ',
|
269 |
+
'Ϛ' => 'ϛ',
|
270 |
+
'Ϝ' => 'ϝ',
|
271 |
+
'Ϟ' => 'ϟ',
|
272 |
+
'Ϡ' => 'ϡ',
|
273 |
+
'Ϣ' => 'ϣ',
|
274 |
+
'Ϥ' => 'ϥ',
|
275 |
+
'Ϧ' => 'ϧ',
|
276 |
+
'Ϩ' => 'ϩ',
|
277 |
+
'Ϫ' => 'ϫ',
|
278 |
+
'Ϭ' => 'ϭ',
|
279 |
+
'Ϯ' => 'ϯ',
|
280 |
+
'ϴ' => 'θ',
|
281 |
+
'Ϸ' => 'ϸ',
|
282 |
+
'Ϲ' => 'ϲ',
|
283 |
+
'Ϻ' => 'ϻ',
|
284 |
+
'Ͻ' => 'ͻ',
|
285 |
+
'Ͼ' => 'ͼ',
|
286 |
+
'Ͽ' => 'ͽ',
|
287 |
+
'Ѐ' => 'ѐ',
|
288 |
+
'Ё' => 'ё',
|
289 |
+
'Ђ' => 'ђ',
|
290 |
+
'Ѓ' => 'ѓ',
|
291 |
+
'Є' => 'є',
|
292 |
+
'Ѕ' => 'ѕ',
|
293 |
+
'І' => 'і',
|
294 |
+
'Ї' => 'ї',
|
295 |
+
'Ј' => 'ј',
|
296 |
+
'Љ' => 'љ',
|
297 |
+
'Њ' => 'њ',
|
298 |
+
'Ћ' => 'ћ',
|
299 |
+
'Ќ' => 'ќ',
|
300 |
+
'Ѝ' => 'ѝ',
|
301 |
+
'Ў' => 'ў',
|
302 |
+
'Џ' => 'џ',
|
303 |
+
'А' => 'а',
|
304 |
+
'Б' => 'б',
|
305 |
+
'В' => 'в',
|
306 |
+
'Г' => 'г',
|
307 |
+
'Д' => 'д',
|
308 |
+
'Е' => 'е',
|
309 |
+
'Ж' => 'ж',
|
310 |
+
'З' => 'з',
|
311 |
+
'И' => 'и',
|
312 |
+
'Й' => 'й',
|
313 |
+
'К' => 'к',
|
314 |
+
'Л' => 'л',
|
315 |
+
'М' => 'м',
|
316 |
+
'Н' => 'н',
|
317 |
+
'О' => 'о',
|
318 |
+
'П' => 'п',
|
319 |
+
'Р' => 'р',
|
320 |
+
'С' => 'с',
|
321 |
+
'Т' => 'т',
|
322 |
+
'У' => 'у',
|
323 |
+
'Ф' => 'ф',
|
324 |
+
'Х' => 'х',
|
325 |
+
'Ц' => 'ц',
|
326 |
+
'Ч' => 'ч',
|
327 |
+
'Ш' => 'ш',
|
328 |
+
'Щ' => 'щ',
|
329 |
+
'Ъ' => 'ъ',
|
330 |
+
'Ы' => 'ы',
|
331 |
+
'Ь' => 'ь',
|
332 |
+
'Э' => 'э',
|
333 |
+
'Ю' => 'ю',
|
334 |
+
'Я' => 'я',
|
335 |
+
'Ѡ' => 'ѡ',
|
336 |
+
'Ѣ' => 'ѣ',
|
337 |
+
'Ѥ' => 'ѥ',
|
338 |
+
'Ѧ' => 'ѧ',
|
339 |
+
'Ѩ' => 'ѩ',
|
340 |
+
'Ѫ' => 'ѫ',
|
341 |
+
'Ѭ' => 'ѭ',
|
342 |
+
'Ѯ' => 'ѯ',
|
343 |
+
'Ѱ' => 'ѱ',
|
344 |
+
'Ѳ' => 'ѳ',
|
345 |
+
'Ѵ' => 'ѵ',
|
346 |
+
'Ѷ' => 'ѷ',
|
347 |
+
'Ѹ' => 'ѹ',
|
348 |
+
'Ѻ' => 'ѻ',
|
349 |
+
'Ѽ' => 'ѽ',
|
350 |
+
'Ѿ' => 'ѿ',
|
351 |
+
'Ҁ' => 'ҁ',
|
352 |
+
'Ҋ' => 'ҋ',
|
353 |
+
'Ҍ' => 'ҍ',
|
354 |
+
'Ҏ' => 'ҏ',
|
355 |
+
'Ґ' => 'ґ',
|
356 |
+
'Ғ' => 'ғ',
|
357 |
+
'Ҕ' => 'ҕ',
|
358 |
+
'Җ' => 'җ',
|
359 |
+
'Ҙ' => 'ҙ',
|
360 |
+
'Қ' => 'қ',
|
361 |
+
'Ҝ' => 'ҝ',
|
362 |
+
'Ҟ' => 'ҟ',
|
363 |
+
'Ҡ' => 'ҡ',
|
364 |
+
'Ң' => 'ң',
|
365 |
+
'Ҥ' => 'ҥ',
|
366 |
+
'Ҧ' => 'ҧ',
|
367 |
+
'Ҩ' => 'ҩ',
|
368 |
+
'Ҫ' => 'ҫ',
|
369 |
+
'Ҭ' => 'ҭ',
|
370 |
+
'Ү' => 'ү',
|
371 |
+
'Ұ' => 'ұ',
|
372 |
+
'Ҳ' => 'ҳ',
|
373 |
+
'Ҵ' => 'ҵ',
|
374 |
+
'Ҷ' => 'ҷ',
|
375 |
+
'Ҹ' => 'ҹ',
|
376 |
+
'Һ' => 'һ',
|
377 |
+
'Ҽ' => 'ҽ',
|
378 |
+
'Ҿ' => 'ҿ',
|
379 |
+
'Ӏ' => 'ӏ',
|
380 |
+
'Ӂ' => 'ӂ',
|
381 |
+
'Ӄ' => 'ӄ',
|
382 |
+
'Ӆ' => 'ӆ',
|
383 |
+
'Ӈ' => 'ӈ',
|
384 |
+
'Ӊ' => 'ӊ',
|
385 |
+
'Ӌ' => 'ӌ',
|
386 |
+
'Ӎ' => 'ӎ',
|
387 |
+
'Ӑ' => 'ӑ',
|
388 |
+
'Ӓ' => 'ӓ',
|
389 |
+
'Ӕ' => 'ӕ',
|
390 |
+
'Ӗ' => 'ӗ',
|
391 |
+
'Ә' => 'ә',
|
392 |
+
'Ӛ' => 'ӛ',
|
393 |
+
'Ӝ' => 'ӝ',
|
394 |
+
'Ӟ' => 'ӟ',
|
395 |
+
'Ӡ' => 'ӡ',
|
396 |
+
'Ӣ' => 'ӣ',
|
397 |
+
'Ӥ' => 'ӥ',
|
398 |
+
'Ӧ' => 'ӧ',
|
399 |
+
'Ө' => 'ө',
|
400 |
+
'Ӫ' => 'ӫ',
|
401 |
+
'Ӭ' => 'ӭ',
|
402 |
+
'Ӯ' => 'ӯ',
|
403 |
+
'Ӱ' => 'ӱ',
|
404 |
+
'Ӳ' => 'ӳ',
|
405 |
+
'Ӵ' => 'ӵ',
|
406 |
+
'Ӷ' => 'ӷ',
|
407 |
+
'Ӹ' => 'ӹ',
|
408 |
+
'Ӻ' => 'ӻ',
|
409 |
+
'Ӽ' => 'ӽ',
|
410 |
+
'Ӿ' => 'ӿ',
|
411 |
+
'Ԁ' => 'ԁ',
|
412 |
+
'Ԃ' => 'ԃ',
|
413 |
+
'Ԅ' => 'ԅ',
|
414 |
+
'Ԇ' => 'ԇ',
|
415 |
+
'Ԉ' => 'ԉ',
|
416 |
+
'Ԋ' => 'ԋ',
|
417 |
+
'Ԍ' => 'ԍ',
|
418 |
+
'Ԏ' => 'ԏ',
|
419 |
+
'Ԑ' => 'ԑ',
|
420 |
+
'Ԓ' => 'ԓ',
|
421 |
+
'Ԕ' => 'ԕ',
|
422 |
+
'Ԗ' => 'ԗ',
|
423 |
+
'Ԙ' => 'ԙ',
|
424 |
+
'Ԛ' => 'ԛ',
|
425 |
+
'Ԝ' => 'ԝ',
|
426 |
+
'Ԟ' => 'ԟ',
|
427 |
+
'Ԡ' => 'ԡ',
|
428 |
+
'Ԣ' => 'ԣ',
|
429 |
+
'Ԥ' => 'ԥ',
|
430 |
+
'Ԧ' => 'ԧ',
|
431 |
+
'Ԩ' => 'ԩ',
|
432 |
+
'Ԫ' => 'ԫ',
|
433 |
+
'Ԭ' => 'ԭ',
|
434 |
+
'Ԯ' => 'ԯ',
|
435 |
+
'Ա' => 'ա',
|
436 |
+
'Բ' => 'բ',
|
437 |
+
'Գ' => 'գ',
|
438 |
+
'Դ' => 'դ',
|
439 |
+
'Ե' => 'ե',
|
440 |
+
'Զ' => 'զ',
|
441 |
+
'Է' => 'է',
|
442 |
+
'Ը' => 'ը',
|
443 |
+
'Թ' => 'թ',
|
444 |
+
'Ժ' => 'ժ',
|
445 |
+
'Ի' => 'ի',
|
446 |
+
'Լ' => 'լ',
|
447 |
+
'Խ' => 'խ',
|
448 |
+
'Ծ' => 'ծ',
|
449 |
+
'Կ' => 'կ',
|
450 |
+
'Հ' => 'հ',
|
451 |
+
'Ձ' => 'ձ',
|
452 |
+
'Ղ' => 'ղ',
|
453 |
+
'Ճ' => 'ճ',
|
454 |
+
'Մ' => 'մ',
|
455 |
+
'Յ' => 'յ',
|
456 |
+
'Ն' => 'ն',
|
457 |
+
'Շ' => 'շ',
|
458 |
+
'Ո' => 'ո',
|
459 |
+
'Չ' => 'չ',
|
460 |
+
'Պ' => 'պ',
|
461 |
+
'Ջ' => 'ջ',
|
462 |
+
'Ռ' => 'ռ',
|
463 |
+
'Ս' => 'ս',
|
464 |
+
'Վ' => 'վ',
|
465 |
+
'Տ' => 'տ',
|
466 |
+
'Ր' => 'ր',
|
467 |
+
'Ց' => 'ց',
|
468 |
+
'Ւ' => 'ւ',
|
469 |
+
'Փ' => 'փ',
|
470 |
+
'Ք' => 'ք',
|
471 |
+
'Օ' => 'օ',
|
472 |
+
'Ֆ' => 'ֆ',
|
473 |
+
'Ⴀ' => 'ⴀ',
|
474 |
+
'Ⴁ' => 'ⴁ',
|
475 |
+
'Ⴂ' => 'ⴂ',
|
476 |
+
'Ⴃ' => 'ⴃ',
|
477 |
+
'Ⴄ' => 'ⴄ',
|
478 |
+
'Ⴅ' => 'ⴅ',
|
479 |
+
'Ⴆ' => 'ⴆ',
|
480 |
+
'Ⴇ' => 'ⴇ',
|
481 |
+
'Ⴈ' => 'ⴈ',
|
482 |
+
'Ⴉ' => 'ⴉ',
|
483 |
+
'Ⴊ' => 'ⴊ',
|
484 |
+
'Ⴋ' => 'ⴋ',
|
485 |
+
'Ⴌ' => 'ⴌ',
|
486 |
+
'Ⴍ' => 'ⴍ',
|
487 |
+
'Ⴎ' => 'ⴎ',
|
488 |
+
'Ⴏ' => 'ⴏ',
|
489 |
+
'Ⴐ' => 'ⴐ',
|
490 |
+
'Ⴑ' => 'ⴑ',
|
491 |
+
'Ⴒ' => 'ⴒ',
|
492 |
+
'Ⴓ' => 'ⴓ',
|
493 |
+
'Ⴔ' => 'ⴔ',
|
494 |
+
'Ⴕ' => 'ⴕ',
|
495 |
+
'Ⴖ' => 'ⴖ',
|
496 |
+
'Ⴗ' => 'ⴗ',
|
497 |
+
'Ⴘ' => 'ⴘ',
|
498 |
+
'Ⴙ' => 'ⴙ',
|
499 |
+
'Ⴚ' => 'ⴚ',
|
500 |
+
'Ⴛ' => 'ⴛ',
|
501 |
+
'Ⴜ' => 'ⴜ',
|
502 |
+
'Ⴝ' => 'ⴝ',
|
503 |
+
'Ⴞ' => 'ⴞ',
|
504 |
+
'Ⴟ' => 'ⴟ',
|
505 |
+
'Ⴠ' => 'ⴠ',
|
506 |
+
'Ⴡ' => 'ⴡ',
|
507 |
+
'Ⴢ' => 'ⴢ',
|
508 |
+
'Ⴣ' => 'ⴣ',
|
509 |
+
'Ⴤ' => 'ⴤ',
|
510 |
+
'Ⴥ' => 'ⴥ',
|
511 |
+
'Ⴧ' => 'ⴧ',
|
512 |
+
'Ⴭ' => 'ⴭ',
|
513 |
+
'Ḁ' => 'ḁ',
|
514 |
+
'Ḃ' => 'ḃ',
|
515 |
+
'Ḅ' => 'ḅ',
|
516 |
+
'Ḇ' => 'ḇ',
|
517 |
+
'Ḉ' => 'ḉ',
|
518 |
+
'Ḋ' => 'ḋ',
|
519 |
+
'Ḍ' => 'ḍ',
|
520 |
+
'Ḏ' => 'ḏ',
|
521 |
+
'Ḑ' => 'ḑ',
|
522 |
+
'Ḓ' => 'ḓ',
|
523 |
+
'Ḕ' => 'ḕ',
|
524 |
+
'Ḗ' => 'ḗ',
|
525 |
+
'Ḙ' => 'ḙ',
|
526 |
+
'Ḛ' => 'ḛ',
|
527 |
+
'Ḝ' => 'ḝ',
|
528 |
+
'Ḟ' => 'ḟ',
|
529 |
+
'Ḡ' => 'ḡ',
|
530 |
+
'Ḣ' => 'ḣ',
|
531 |
+
'Ḥ' => 'ḥ',
|
532 |
+
'Ḧ' => 'ḧ',
|
533 |
+
'Ḩ' => 'ḩ',
|
534 |
+
'Ḫ' => 'ḫ',
|
535 |
+
'Ḭ' => 'ḭ',
|
536 |
+
'Ḯ' => 'ḯ',
|
537 |
+
'Ḱ' => 'ḱ',
|
538 |
+
'Ḳ' => 'ḳ',
|
539 |
+
'Ḵ' => 'ḵ',
|
540 |
+
'Ḷ' => 'ḷ',
|
541 |
+
'Ḹ' => 'ḹ',
|
542 |
+
'Ḻ' => 'ḻ',
|
543 |
+
'Ḽ' => 'ḽ',
|
544 |
+
'Ḿ' => 'ḿ',
|
545 |
+
'Ṁ' => 'ṁ',
|
546 |
+
'Ṃ' => 'ṃ',
|
547 |
+
'Ṅ' => 'ṅ',
|
548 |
+
'Ṇ' => 'ṇ',
|
549 |
+
'Ṉ' => 'ṉ',
|
550 |
+
'Ṋ' => 'ṋ',
|
551 |
+
'Ṍ' => 'ṍ',
|
552 |
+
'Ṏ' => 'ṏ',
|
553 |
+
'Ṑ' => 'ṑ',
|
554 |
+
'Ṓ' => 'ṓ',
|
555 |
+
'Ṕ' => 'ṕ',
|
556 |
+
'Ṗ' => 'ṗ',
|
557 |
+
'Ṙ' => 'ṙ',
|
558 |
+
'Ṛ' => 'ṛ',
|
559 |
+
'Ṝ' => 'ṝ',
|
560 |
+
'Ṟ' => 'ṟ',
|
561 |
+
'Ṡ' => 'ṡ',
|
562 |
+
'Ṣ' => 'ṣ',
|
563 |
+
'Ṥ' => 'ṥ',
|
564 |
+
'Ṧ' => 'ṧ',
|
565 |
+
'Ṩ' => 'ṩ',
|
566 |
+
'Ṫ' => 'ṫ',
|
567 |
+
'Ṭ' => 'ṭ',
|
568 |
+
'Ṯ' => 'ṯ',
|
569 |
+
'Ṱ' => 'ṱ',
|
570 |
+
'Ṳ' => 'ṳ',
|
571 |
+
'Ṵ' => 'ṵ',
|
572 |
+
'Ṷ' => 'ṷ',
|
573 |
+
'Ṹ' => 'ṹ',
|
574 |
+
'Ṻ' => 'ṻ',
|
575 |
+
'Ṽ' => 'ṽ',
|
576 |
+
'Ṿ' => 'ṿ',
|
577 |
+
'Ẁ' => 'ẁ',
|
578 |
+
'Ẃ' => 'ẃ',
|
579 |
+
'Ẅ' => 'ẅ',
|
580 |
+
'Ẇ' => 'ẇ',
|
581 |
+
'Ẉ' => 'ẉ',
|
582 |
+
'Ẋ' => 'ẋ',
|
583 |
+
'Ẍ' => 'ẍ',
|
584 |
+
'Ẏ' => 'ẏ',
|
585 |
+
'Ẑ' => 'ẑ',
|
586 |
+
'Ẓ' => 'ẓ',
|
587 |
+
'Ẕ' => 'ẕ',
|
588 |
+
'ẞ' => 'ß',
|
589 |
+
'Ạ' => 'ạ',
|
590 |
+
'Ả' => 'ả',
|
591 |
+
'Ấ' => 'ấ',
|
592 |
+
'Ầ' => 'ầ',
|
593 |
+
'Ẩ' => 'ẩ',
|
594 |
+
'Ẫ' => 'ẫ',
|
595 |
+
'Ậ' => 'ậ',
|
596 |
+
'Ắ' => 'ắ',
|
597 |
+
'Ằ' => 'ằ',
|
598 |
+
'Ẳ' => 'ẳ',
|
599 |
+
'Ẵ' => 'ẵ',
|
600 |
+
'Ặ' => 'ặ',
|
601 |
+
'Ẹ' => 'ẹ',
|
602 |
+
'Ẻ' => 'ẻ',
|
603 |
+
'Ẽ' => 'ẽ',
|
604 |
+
'Ế' => 'ế',
|
605 |
+
'Ề' => 'ề',
|
606 |
+
'Ể' => 'ể',
|
607 |
+
'Ễ' => 'ễ',
|
608 |
+
'Ệ' => 'ệ',
|
609 |
+
'Ỉ' => 'ỉ',
|
610 |
+
'Ị' => 'ị',
|
611 |
+
'Ọ' => 'ọ',
|
612 |
+
'Ỏ' => 'ỏ',
|
613 |
+
'Ố' => 'ố',
|
614 |
+
'Ồ' => 'ồ',
|
615 |
+
'Ổ' => 'ổ',
|
616 |
+
'Ỗ' => 'ỗ',
|
617 |
+
'Ộ' => 'ộ',
|
618 |
+
'Ớ' => 'ớ',
|
619 |
+
'Ờ' => 'ờ',
|
620 |
+
'Ở' => 'ở',
|
621 |
+
'Ỡ' => 'ỡ',
|
622 |
+
'Ợ' => 'ợ',
|
623 |
+
'Ụ' => 'ụ',
|
624 |
+
'Ủ' => 'ủ',
|
625 |
+
'Ứ' => 'ứ',
|
626 |
+
'Ừ' => 'ừ',
|
627 |
+
'Ử' => 'ử',
|
628 |
+
'Ữ' => 'ữ',
|
629 |
+
'Ự' => 'ự',
|
630 |
+
'Ỳ' => 'ỳ',
|
631 |
+
'Ỵ' => 'ỵ',
|
632 |
+
'Ỷ' => 'ỷ',
|
633 |
+
'Ỹ' => 'ỹ',
|
634 |
+
'Ỻ' => 'ỻ',
|
635 |
+
'Ỽ' => 'ỽ',
|
636 |
+
'Ỿ' => 'ỿ',
|
637 |
+
'Ἀ' => 'ἀ',
|
638 |
+
'Ἁ' => 'ἁ',
|
639 |
+
'Ἂ' => 'ἂ',
|
640 |
+
'Ἃ' => 'ἃ',
|
641 |
+
'Ἄ' => 'ἄ',
|
642 |
+
'Ἅ' => 'ἅ',
|
643 |
+
'Ἆ' => 'ἆ',
|
644 |
+
'Ἇ' => 'ἇ',
|
645 |
+
'Ἐ' => 'ἐ',
|
646 |
+
'Ἑ' => 'ἑ',
|
647 |
+
'Ἒ' => 'ἒ',
|
648 |
+
'Ἓ' => 'ἓ',
|
649 |
+
'Ἔ' => 'ἔ',
|
650 |
+
'Ἕ' => 'ἕ',
|
651 |
+
'Ἠ' => 'ἠ',
|
652 |
+
'Ἡ' => 'ἡ',
|
653 |
+
'Ἢ' => 'ἢ',
|
654 |
+
'Ἣ' => 'ἣ',
|
655 |
+
'Ἤ' => 'ἤ',
|
656 |
+
'Ἥ' => 'ἥ',
|
657 |
+
'Ἦ' => 'ἦ',
|
658 |
+
'Ἧ' => 'ἧ',
|
659 |
+
'Ἰ' => 'ἰ',
|
660 |
+
'Ἱ' => 'ἱ',
|
661 |
+
'Ἲ' => 'ἲ',
|
662 |
+
'Ἳ' => 'ἳ',
|
663 |
+
'Ἴ' => 'ἴ',
|
664 |
+
'Ἵ' => 'ἵ',
|
665 |
+
'Ἶ' => 'ἶ',
|
666 |
+
'Ἷ' => 'ἷ',
|
667 |
+
'Ὀ' => 'ὀ',
|
668 |
+
'Ὁ' => 'ὁ',
|
669 |
+
'Ὂ' => 'ὂ',
|
670 |
+
'Ὃ' => 'ὃ',
|
671 |
+
'Ὄ' => 'ὄ',
|
672 |
+
'Ὅ' => 'ὅ',
|
673 |
+
'Ὑ' => 'ὑ',
|
674 |
+
'Ὓ' => 'ὓ',
|
675 |
+
'Ὕ' => 'ὕ',
|
676 |
+
'Ὗ' => 'ὗ',
|
677 |
+
'Ὠ' => 'ὠ',
|
678 |
+
'Ὡ' => 'ὡ',
|
679 |
+
'Ὢ' => 'ὢ',
|
680 |
+
'Ὣ' => 'ὣ',
|
681 |
+
'Ὤ' => 'ὤ',
|
682 |
+
'Ὥ' => 'ὥ',
|
683 |
+
'Ὦ' => 'ὦ',
|
684 |
+
'Ὧ' => 'ὧ',
|
685 |
+
'ᾈ' => 'ᾀ',
|
686 |
+
'ᾉ' => 'ᾁ',
|
687 |
+
'ᾊ' => 'ᾂ',
|
688 |
+
'ᾋ' => 'ᾃ',
|
689 |
+
'ᾌ' => 'ᾄ',
|
690 |
+
'ᾍ' => 'ᾅ',
|
691 |
+
'ᾎ' => 'ᾆ',
|
692 |
+
'ᾏ' => 'ᾇ',
|
693 |
+
'ᾘ' => 'ᾐ',
|
694 |
+
'ᾙ' => 'ᾑ',
|
695 |
+
'ᾚ' => 'ᾒ',
|
696 |
+
'ᾛ' => 'ᾓ',
|
697 |
+
'ᾜ' => 'ᾔ',
|
698 |
+
'ᾝ' => 'ᾕ',
|
699 |
+
'ᾞ' => 'ᾖ',
|
700 |
+
'ᾟ' => 'ᾗ',
|
701 |
+
'ᾨ' => 'ᾠ',
|
702 |
+
'ᾩ' => 'ᾡ',
|
703 |
+
'ᾪ' => 'ᾢ',
|
704 |
+
'ᾫ' => 'ᾣ',
|
705 |
+
'ᾬ' => 'ᾤ',
|
706 |
+
'ᾭ' => 'ᾥ',
|
707 |
+
'ᾮ' => 'ᾦ',
|
708 |
+
'ᾯ' => 'ᾧ',
|
709 |
+
'Ᾰ' => 'ᾰ',
|
710 |
+
'Ᾱ' => 'ᾱ',
|
711 |
+
'Ὰ' => 'ὰ',
|
712 |
+
'Ά' => 'ά',
|
713 |
+
'ᾼ' => 'ᾳ',
|
714 |
+
'Ὲ' => 'ὲ',
|
715 |
+
'Έ' => 'έ',
|
716 |
+
'Ὴ' => 'ὴ',
|
717 |
+
'Ή' => 'ή',
|
718 |
+
'ῌ' => 'ῃ',
|
719 |
+
'Ῐ' => 'ῐ',
|
720 |
+
'Ῑ' => 'ῑ',
|
721 |
+
'Ὶ' => 'ὶ',
|
722 |
+
'Ί' => 'ί',
|
723 |
+
'Ῠ' => 'ῠ',
|
724 |
+
'Ῡ' => 'ῡ',
|
725 |
+
'Ὺ' => 'ὺ',
|
726 |
+
'Ύ' => 'ύ',
|
727 |
+
'Ῥ' => 'ῥ',
|
728 |
+
'Ὸ' => 'ὸ',
|
729 |
+
'Ό' => 'ό',
|
730 |
+
'Ὼ' => 'ὼ',
|
731 |
+
'Ώ' => 'ώ',
|
732 |
+
'ῼ' => 'ῳ',
|
733 |
+
'Ω' => 'ω',
|
734 |
+
'K' => 'k',
|
735 |
+
'Å' => 'å',
|
736 |
+
'Ⅎ' => 'ⅎ',
|
737 |
+
'Ⅰ' => 'ⅰ',
|
738 |
+
'Ⅱ' => 'ⅱ',
|
739 |
+
'Ⅲ' => 'ⅲ',
|
740 |
+
'Ⅳ' => 'ⅳ',
|
741 |
+
'Ⅴ' => 'ⅴ',
|
742 |
+
'Ⅵ' => 'ⅵ',
|
743 |
+
'Ⅶ' => 'ⅶ',
|
744 |
+
'Ⅷ' => 'ⅷ',
|
745 |
+
'Ⅸ' => 'ⅸ',
|
746 |
+
'Ⅹ' => 'ⅹ',
|
747 |
+
'Ⅺ' => 'ⅺ',
|
748 |
+
'Ⅻ' => 'ⅻ',
|
749 |
+
'Ⅼ' => 'ⅼ',
|
750 |
+
'Ⅽ' => 'ⅽ',
|
751 |
+
'Ⅾ' => 'ⅾ',
|
752 |
+
'Ⅿ' => 'ⅿ',
|
753 |
+
'Ↄ' => 'ↄ',
|
754 |
+
'Ⓐ' => 'ⓐ',
|
755 |
+
'Ⓑ' => 'ⓑ',
|
756 |
+
'Ⓒ' => 'ⓒ',
|
757 |
+
'Ⓓ' => 'ⓓ',
|
758 |
+
'Ⓔ' => 'ⓔ',
|
759 |
+
'Ⓕ' => 'ⓕ',
|
760 |
+
'Ⓖ' => 'ⓖ',
|
761 |
+
'Ⓗ' => 'ⓗ',
|
762 |
+
'Ⓘ' => 'ⓘ',
|
763 |
+
'Ⓙ' => 'ⓙ',
|
764 |
+
'Ⓚ' => 'ⓚ',
|
765 |
+
'Ⓛ' => 'ⓛ',
|
766 |
+
'Ⓜ' => 'ⓜ',
|
767 |
+
'Ⓝ' => 'ⓝ',
|
768 |
+
'Ⓞ' => 'ⓞ',
|
769 |
+
'Ⓟ' => 'ⓟ',
|
770 |
+
'Ⓠ' => 'ⓠ',
|
771 |
+
'Ⓡ' => 'ⓡ',
|
772 |
+
'Ⓢ' => 'ⓢ',
|
773 |
+
'Ⓣ' => 'ⓣ',
|
774 |
+
'Ⓤ' => 'ⓤ',
|
775 |
+
'Ⓥ' => 'ⓥ',
|
776 |
+
'Ⓦ' => 'ⓦ',
|
777 |
+
'Ⓧ' => 'ⓧ',
|
778 |
+
'Ⓨ' => 'ⓨ',
|
779 |
+
'Ⓩ' => 'ⓩ',
|
780 |
+
'Ⰰ' => 'ⰰ',
|
781 |
+
'Ⰱ' => 'ⰱ',
|
782 |
+
'Ⰲ' => 'ⰲ',
|
783 |
+
'Ⰳ' => 'ⰳ',
|
784 |
+
'Ⰴ' => 'ⰴ',
|
785 |
+
'Ⰵ' => 'ⰵ',
|
786 |
+
'Ⰶ' => 'ⰶ',
|
787 |
+
'Ⰷ' => 'ⰷ',
|
788 |
+
'Ⰸ' => 'ⰸ',
|
789 |
+
'Ⰹ' => 'ⰹ',
|
790 |
+
'Ⰺ' => 'ⰺ',
|
791 |
+
'Ⰻ' => 'ⰻ',
|
792 |
+
'Ⰼ' => 'ⰼ',
|
793 |
+
'Ⰽ' => 'ⰽ',
|
794 |
+
'Ⰾ' => 'ⰾ',
|
795 |
+
'Ⰿ' => 'ⰿ',
|
796 |
+
'Ⱀ' => 'ⱀ',
|
797 |
+
'Ⱁ' => 'ⱁ',
|
798 |
+
'Ⱂ' => 'ⱂ',
|
799 |
+
'Ⱃ' => 'ⱃ',
|
800 |
+
'Ⱄ' => 'ⱄ',
|
801 |
+
'Ⱅ' => 'ⱅ',
|
802 |
+
'Ⱆ' => 'ⱆ',
|
803 |
+
'Ⱇ' => 'ⱇ',
|
804 |
+
'Ⱈ' => 'ⱈ',
|
805 |
+
'Ⱉ' => 'ⱉ',
|
806 |
+
'Ⱊ' => 'ⱊ',
|
807 |
+
'Ⱋ' => 'ⱋ',
|
808 |
+
'Ⱌ' => 'ⱌ',
|
809 |
+
'Ⱍ' => 'ⱍ',
|
810 |
+
'Ⱎ' => 'ⱎ',
|
811 |
+
'Ⱏ' => 'ⱏ',
|
812 |
+
'Ⱐ' => 'ⱐ',
|
813 |
+
'Ⱑ' => 'ⱑ',
|
814 |
+
'Ⱒ' => 'ⱒ',
|
815 |
+
'Ⱓ' => 'ⱓ',
|
816 |
+
'Ⱔ' => 'ⱔ',
|
817 |
+
'Ⱕ' => 'ⱕ',
|
818 |
+
'Ⱖ' => 'ⱖ',
|
819 |
+
'Ⱗ' => 'ⱗ',
|
820 |
+
'Ⱘ' => 'ⱘ',
|
821 |
+
'Ⱙ' => 'ⱙ',
|
822 |
+
'Ⱚ' => 'ⱚ',
|
823 |
+
'Ⱛ' => 'ⱛ',
|
824 |
+
'Ⱜ' => 'ⱜ',
|
825 |
+
'Ⱝ' => 'ⱝ',
|
826 |
+
'Ⱞ' => 'ⱞ',
|
827 |
+
'Ⱡ' => 'ⱡ',
|
828 |
+
'Ɫ' => 'ɫ',
|
829 |
+
'Ᵽ' => 'ᵽ',
|
830 |
+
'Ɽ' => 'ɽ',
|
831 |
+
'Ⱨ' => 'ⱨ',
|
832 |
+
'Ⱪ' => 'ⱪ',
|
833 |
+
'Ⱬ' => 'ⱬ',
|
834 |
+
'Ɑ' => 'ɑ',
|
835 |
+
'Ɱ' => 'ɱ',
|
836 |
+
'Ɐ' => 'ɐ',
|
837 |
+
'Ɒ' => 'ɒ',
|
838 |
+
'Ⱳ' => 'ⱳ',
|
839 |
+
'Ⱶ' => 'ⱶ',
|
840 |
+
'Ȿ' => 'ȿ',
|
841 |
+
'Ɀ' => 'ɀ',
|
842 |
+
'Ⲁ' => 'ⲁ',
|
843 |
+
'Ⲃ' => 'ⲃ',
|
844 |
+
'Ⲅ' => 'ⲅ',
|
845 |
+
'Ⲇ' => 'ⲇ',
|
846 |
+
'Ⲉ' => 'ⲉ',
|
847 |
+
'Ⲋ' => 'ⲋ',
|
848 |
+
'Ⲍ' => 'ⲍ',
|
849 |
+
'Ⲏ' => 'ⲏ',
|
850 |
+
'Ⲑ' => 'ⲑ',
|
851 |
+
'Ⲓ' => 'ⲓ',
|
852 |
+
'Ⲕ' => 'ⲕ',
|
853 |
+
'Ⲗ' => 'ⲗ',
|
854 |
+
'Ⲙ' => 'ⲙ',
|
855 |
+
'Ⲛ' => 'ⲛ',
|
856 |
+
'Ⲝ' => 'ⲝ',
|
857 |
+
'Ⲟ' => 'ⲟ',
|
858 |
+
'Ⲡ' => 'ⲡ',
|
859 |
+
'Ⲣ' => 'ⲣ',
|
860 |
+
'Ⲥ' => 'ⲥ',
|
861 |
+
'Ⲧ' => 'ⲧ',
|
862 |
+
'Ⲩ' => 'ⲩ',
|
863 |
+
'Ⲫ' => 'ⲫ',
|
864 |
+
'Ⲭ' => 'ⲭ',
|
865 |
+
'Ⲯ' => 'ⲯ',
|
866 |
+
'Ⲱ' => 'ⲱ',
|
867 |
+
'Ⲳ' => 'ⲳ',
|
868 |
+
'Ⲵ' => 'ⲵ',
|
869 |
+
'Ⲷ' => 'ⲷ',
|
870 |
+
'Ⲹ' => 'ⲹ',
|
871 |
+
'Ⲻ' => 'ⲻ',
|
872 |
+
'Ⲽ' => 'ⲽ',
|
873 |
+
'Ⲿ' => 'ⲿ',
|
874 |
+
'Ⳁ' => 'ⳁ',
|
875 |
+
'Ⳃ' => 'ⳃ',
|
876 |
+
'Ⳅ' => 'ⳅ',
|
877 |
+
'Ⳇ' => 'ⳇ',
|
878 |
+
'Ⳉ' => 'ⳉ',
|
879 |
+
'Ⳋ' => 'ⳋ',
|
880 |
+
'Ⳍ' => 'ⳍ',
|
881 |
+
'Ⳏ' => 'ⳏ',
|
882 |
+
'Ⳑ' => 'ⳑ',
|
883 |
+
'Ⳓ' => 'ⳓ',
|
884 |
+
'Ⳕ' => 'ⳕ',
|
885 |
+
'Ⳗ' => 'ⳗ',
|
886 |
+
'Ⳙ' => 'ⳙ',
|
887 |
+
'Ⳛ' => 'ⳛ',
|
888 |
+
'Ⳝ' => 'ⳝ',
|
889 |
+
'Ⳟ' => 'ⳟ',
|
890 |
+
'Ⳡ' => 'ⳡ',
|
891 |
+
'Ⳣ' => 'ⳣ',
|
892 |
+
'Ⳬ' => 'ⳬ',
|
893 |
+
'Ⳮ' => 'ⳮ',
|
894 |
+
'Ⳳ' => 'ⳳ',
|
895 |
+
'Ꙁ' => 'ꙁ',
|
896 |
+
'Ꙃ' => 'ꙃ',
|
897 |
+
'Ꙅ' => 'ꙅ',
|
898 |
+
'Ꙇ' => 'ꙇ',
|
899 |
+
'Ꙉ' => 'ꙉ',
|
900 |
+
'Ꙋ' => 'ꙋ',
|
901 |
+
'Ꙍ' => 'ꙍ',
|
902 |
+
'Ꙏ' => 'ꙏ',
|
903 |
+
'Ꙑ' => 'ꙑ',
|
904 |
+
'Ꙓ' => 'ꙓ',
|
905 |
+
'Ꙕ' => 'ꙕ',
|
906 |
+
'Ꙗ' => 'ꙗ',
|
907 |
+
'Ꙙ' => 'ꙙ',
|
908 |
+
'Ꙛ' => 'ꙛ',
|
909 |
+
'Ꙝ' => 'ꙝ',
|
910 |
+
'Ꙟ' => 'ꙟ',
|
911 |
+
'Ꙡ' => 'ꙡ',
|
912 |
+
'Ꙣ' => 'ꙣ',
|
913 |
+
'Ꙥ' => 'ꙥ',
|
914 |
+
'Ꙧ' => 'ꙧ',
|
915 |
+
'Ꙩ' => 'ꙩ',
|
916 |
+
'Ꙫ' => 'ꙫ',
|
917 |
+
'Ꙭ' => 'ꙭ',
|
918 |
+
'Ꚁ' => 'ꚁ',
|
919 |
+
'Ꚃ' => 'ꚃ',
|
920 |
+
'Ꚅ' => 'ꚅ',
|
921 |
+
'Ꚇ' => 'ꚇ',
|
922 |
+
'Ꚉ' => 'ꚉ',
|
923 |
+
'Ꚋ' => 'ꚋ',
|
924 |
+
'Ꚍ' => 'ꚍ',
|
925 |
+
'Ꚏ' => 'ꚏ',
|
926 |
+
'Ꚑ' => 'ꚑ',
|
927 |
+
'Ꚓ' => 'ꚓ',
|
928 |
+
'Ꚕ' => 'ꚕ',
|
929 |
+
'Ꚗ' => 'ꚗ',
|
930 |
+
'Ꚙ' => 'ꚙ',
|
931 |
+
'Ꚛ' => 'ꚛ',
|
932 |
+
'Ꜣ' => 'ꜣ',
|
933 |
+
'Ꜥ' => 'ꜥ',
|
934 |
+
'Ꜧ' => 'ꜧ',
|
935 |
+
'Ꜩ' => 'ꜩ',
|
936 |
+
'Ꜫ' => 'ꜫ',
|
937 |
+
'Ꜭ' => 'ꜭ',
|
938 |
+
'Ꜯ' => 'ꜯ',
|
939 |
+
'Ꜳ' => 'ꜳ',
|
940 |
+
'Ꜵ' => 'ꜵ',
|
941 |
+
'Ꜷ' => 'ꜷ',
|
942 |
+
'Ꜹ' => 'ꜹ',
|
943 |
+
'Ꜻ' => 'ꜻ',
|
944 |
+
'Ꜽ' => 'ꜽ',
|
945 |
+
'Ꜿ' => 'ꜿ',
|
946 |
+
'Ꝁ' => 'ꝁ',
|
947 |
+
'Ꝃ' => 'ꝃ',
|
948 |
+
'Ꝅ' => 'ꝅ',
|
949 |
+
'Ꝇ' => 'ꝇ',
|
950 |
+
'Ꝉ' => 'ꝉ',
|
951 |
+
'Ꝋ' => 'ꝋ',
|
952 |
+
'Ꝍ' => 'ꝍ',
|
953 |
+
'Ꝏ' => 'ꝏ',
|
954 |
+
'Ꝑ' => 'ꝑ',
|
955 |
+
'Ꝓ' => 'ꝓ',
|
956 |
+
'Ꝕ' => 'ꝕ',
|
957 |
+
'Ꝗ' => 'ꝗ',
|
958 |
+
'Ꝙ' => 'ꝙ',
|
959 |
+
'Ꝛ' => 'ꝛ',
|
960 |
+
'Ꝝ' => 'ꝝ',
|
961 |
+
'Ꝟ' => 'ꝟ',
|
962 |
+
'Ꝡ' => 'ꝡ',
|
963 |
+
'Ꝣ' => 'ꝣ',
|
964 |
+
'Ꝥ' => 'ꝥ',
|
965 |
+
'Ꝧ' => 'ꝧ',
|
966 |
+
'Ꝩ' => 'ꝩ',
|
967 |
+
'Ꝫ' => 'ꝫ',
|
968 |
+
'Ꝭ' => 'ꝭ',
|
969 |
+
'Ꝯ' => 'ꝯ',
|
970 |
+
'Ꝺ' => 'ꝺ',
|
971 |
+
'Ꝼ' => 'ꝼ',
|
972 |
+
'Ᵹ' => 'ᵹ',
|
973 |
+
'Ꝿ' => 'ꝿ',
|
974 |
+
'Ꞁ' => 'ꞁ',
|
975 |
+
'Ꞃ' => 'ꞃ',
|
976 |
+
'Ꞅ' => 'ꞅ',
|
977 |
+
'Ꞇ' => 'ꞇ',
|
978 |
+
'Ꞌ' => 'ꞌ',
|
979 |
+
'Ɥ' => 'ɥ',
|
980 |
+
'Ꞑ' => 'ꞑ',
|
981 |
+
'Ꞓ' => 'ꞓ',
|
982 |
+
'Ꞗ' => 'ꞗ',
|
983 |
+
'Ꞙ' => 'ꞙ',
|
984 |
+
'Ꞛ' => 'ꞛ',
|
985 |
+
'Ꞝ' => 'ꞝ',
|
986 |
+
'Ꞟ' => 'ꞟ',
|
987 |
+
'Ꞡ' => 'ꞡ',
|
988 |
+
'Ꞣ' => 'ꞣ',
|
989 |
+
'Ꞥ' => 'ꞥ',
|
990 |
+
'Ꞧ' => 'ꞧ',
|
991 |
+
'Ꞩ' => 'ꞩ',
|
992 |
+
'Ɦ' => 'ɦ',
|
993 |
+
'Ɜ' => 'ɜ',
|
994 |
+
'Ɡ' => 'ɡ',
|
995 |
+
'Ɬ' => 'ɬ',
|
996 |
+
'Ʞ' => 'ʞ',
|
997 |
+
'Ʇ' => 'ʇ',
|
998 |
+
'A' => 'a',
|
999 |
+
'B' => 'b',
|
1000 |
+
'C' => 'c',
|
1001 |
+
'D' => 'd',
|
1002 |
+
'E' => 'e',
|
1003 |
+
'F' => 'f',
|
1004 |
+
'G' => 'g',
|
1005 |
+
'H' => 'h',
|
1006 |
+
'I' => 'i',
|
1007 |
+
'J' => 'j',
|
1008 |
+
'K' => 'k',
|
1009 |
+
'L' => 'l',
|
1010 |
+
'M' => 'm',
|
1011 |
+
'N' => 'n',
|
1012 |
+
'O' => 'o',
|
1013 |
+
'P' => 'p',
|
1014 |
+
'Q' => 'q',
|
1015 |
+
'R' => 'r',
|
1016 |
+
'S' => 's',
|
1017 |
+
'T' => 't',
|
1018 |
+
'U' => 'u',
|
1019 |
+
'V' => 'v',
|
1020 |
+
'W' => 'w',
|
1021 |
+
'X' => 'x',
|
1022 |
+
'Y' => 'y',
|
1023 |
+
'Z' => 'z',
|
1024 |
+
'𐐀' => '𐐨',
|
1025 |
+
'𐐁' => '𐐩',
|
1026 |
+
'𐐂' => '𐐪',
|
1027 |
+
'𐐃' => '𐐫',
|
1028 |
+
'𐐄' => '𐐬',
|
1029 |
+
'𐐅' => '𐐭',
|
1030 |
+
'𐐆' => '𐐮',
|
1031 |
+
'𐐇' => '𐐯',
|
1032 |
+
'𐐈' => '𐐰',
|
1033 |
+
'𐐉' => '𐐱',
|
1034 |
+
'𐐊' => '𐐲',
|
1035 |
+
'𐐋' => '𐐳',
|
1036 |
+
'𐐌' => '𐐴',
|
1037 |
+
'𐐍' => '𐐵',
|
1038 |
+
'𐐎' => '𐐶',
|
1039 |
+
'𐐏' => '𐐷',
|
1040 |
+
'𐐐' => '𐐸',
|
1041 |
+
'𐐑' => '𐐹',
|
1042 |
+
'𐐒' => '𐐺',
|
1043 |
+
'𐐓' => '𐐻',
|
1044 |
+
'𐐔' => '𐐼',
|
1045 |
+
'𐐕' => '𐐽',
|
1046 |
+
'𐐖' => '𐐾',
|
1047 |
+
'𐐗' => '𐐿',
|
1048 |
+
'𐐘' => '𐑀',
|
1049 |
+
'𐐙' => '𐑁',
|
1050 |
+
'𐐚' => '𐑂',
|
1051 |
+
'𐐛' => '𐑃',
|
1052 |
+
'𐐜' => '𐑄',
|
1053 |
+
'𐐝' => '𐑅',
|
1054 |
+
'𐐞' => '𐑆',
|
1055 |
+
'𐐟' => '𐑇',
|
1056 |
+
'𐐠' => '𐑈',
|
1057 |
+
'𐐡' => '𐑉',
|
1058 |
+
'𐐢' => '𐑊',
|
1059 |
+
'𐐣' => '𐑋',
|
1060 |
+
'𐐤' => '𐑌',
|
1061 |
+
'𐐥' => '𐑍',
|
1062 |
+
'𐐦' => '𐑎',
|
1063 |
+
'𐐧' => '𐑏',
|
1064 |
+
'𑢠' => '𑣀',
|
1065 |
+
'𑢡' => '𑣁',
|
1066 |
+
'𑢢' => '𑣂',
|
1067 |
+
'𑢣' => '𑣃',
|
1068 |
+
'𑢤' => '𑣄',
|
1069 |
+
'𑢥' => '𑣅',
|
1070 |
+
'𑢦' => '𑣆',
|
1071 |
+
'𑢧' => '𑣇',
|
1072 |
+
'𑢨' => '𑣈',
|
1073 |
+
'𑢩' => '𑣉',
|
1074 |
+
'𑢪' => '𑣊',
|
1075 |
+
'𑢫' => '𑣋',
|
1076 |
+
'𑢬' => '𑣌',
|
1077 |
+
'𑢭' => '𑣍',
|
1078 |
+
'𑢮' => '𑣎',
|
1079 |
+
'𑢯' => '𑣏',
|
1080 |
+
'𑢰' => '𑣐',
|
1081 |
+
'𑢱' => '𑣑',
|
1082 |
+
'𑢲' => '𑣒',
|
1083 |
+
'𑢳' => '𑣓',
|
1084 |
+
'𑢴' => '𑣔',
|
1085 |
+
'𑢵' => '𑣕',
|
1086 |
+
'𑢶' => '𑣖',
|
1087 |
+
'𑢷' => '𑣗',
|
1088 |
+
'𑢸' => '𑣘',
|
1089 |
+
'𑢹' => '𑣙',
|
1090 |
+
'𑢺' => '𑣚',
|
1091 |
+
'𑢻' => '𑣛',
|
1092 |
+
'𑢼' => '𑣜',
|
1093 |
+
'𑢽' => '𑣝',
|
1094 |
+
'𑢾' => '𑣞',
|
1095 |
+
'𑢿' => '𑣟',
|
1096 |
+
);
|
1097 |
+
|
1098 |
+
$result =& $data;
|
1099 |
+
unset($data);
|
1100 |
+
|
1101 |
+
return $result;
|
src/common/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
ADDED
@@ -0,0 +1,1109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
static $data = array (
|
4 |
+
'a' => 'A',
|
5 |
+
'b' => 'B',
|
6 |
+
'c' => 'C',
|
7 |
+
'd' => 'D',
|
8 |
+
'e' => 'E',
|
9 |
+
'f' => 'F',
|
10 |
+
'g' => 'G',
|
11 |
+
'h' => 'H',
|
12 |
+
'i' => 'I',
|
13 |
+
'j' => 'J',
|
14 |
+
'k' => 'K',
|
15 |
+
'l' => 'L',
|
16 |
+
'm' => 'M',
|
17 |
+
'n' => 'N',
|
18 |
+
'o' => 'O',
|
19 |
+
'p' => 'P',
|
20 |
+
'q' => 'Q',
|
21 |
+
'r' => 'R',
|
22 |
+
's' => 'S',
|
23 |
+
't' => 'T',
|
24 |
+
'u' => 'U',
|
25 |
+
'v' => 'V',
|
26 |
+
'w' => 'W',
|
27 |
+
'x' => 'X',
|
28 |
+
'y' => 'Y',
|
29 |
+
'z' => 'Z',
|
30 |
+
'µ' => 'Μ',
|
31 |
+
'à' => 'À',
|
32 |
+
'á' => 'Á',
|
33 |
+
'â' => 'Â',
|
34 |
+
'ã' => 'Ã',
|
35 |
+
'ä' => 'Ä',
|
36 |
+
'å' => 'Å',
|
37 |
+
'æ' => 'Æ',
|
38 |
+
'ç' => 'Ç',
|
39 |
+
'è' => 'È',
|
40 |
+
'é' => 'É',
|
41 |
+
'ê' => 'Ê',
|
42 |
+
'ë' => 'Ë',
|
43 |
+
'ì' => 'Ì',
|
44 |
+
'í' => 'Í',
|
45 |
+
'î' => 'Î',
|
46 |
+
'ï' => 'Ï',
|
47 |
+
'ð' => 'Ð',
|
48 |
+
'ñ' => 'Ñ',
|
49 |
+
'ò' => 'Ò',
|
50 |
+
'ó' => 'Ó',
|
51 |
+
'ô' => 'Ô',
|
52 |
+
'õ' => 'Õ',
|
53 |
+
'ö' => 'Ö',
|
54 |
+
'ø' => 'Ø',
|
55 |
+
'ù' => 'Ù',
|
56 |
+
'ú' => 'Ú',
|
57 |
+
'û' => 'Û',
|
58 |
+
'ü' => 'Ü',
|
59 |
+
'ý' => 'Ý',
|
60 |
+
'þ' => 'Þ',
|
61 |
+
'ÿ' => 'Ÿ',
|
62 |
+
'ā' => 'Ā',
|
63 |
+
'ă' => 'Ă',
|
64 |
+
'ą' => 'Ą',
|
65 |
+
'ć' => 'Ć',
|
66 |
+
'ĉ' => 'Ĉ',
|
67 |
+
'ċ' => 'Ċ',
|
68 |
+
'č' => 'Č',
|
69 |
+
'ď' => 'Ď',
|
70 |
+
'đ' => 'Đ',
|
71 |
+
'ē' => 'Ē',
|
72 |
+
'ĕ' => 'Ĕ',
|
73 |
+
'ė' => 'Ė',
|
74 |
+
'ę' => 'Ę',
|
75 |
+
'ě' => 'Ě',
|
76 |
+
'ĝ' => 'Ĝ',
|
77 |
+
'ğ' => 'Ğ',
|
78 |
+
'ġ' => 'Ġ',
|
79 |
+
'ģ' => 'Ģ',
|
80 |
+
'ĥ' => 'Ĥ',
|
81 |
+
'ħ' => 'Ħ',
|
82 |
+
'ĩ' => 'Ĩ',
|
83 |
+
'ī' => 'Ī',
|
84 |
+
'ĭ' => 'Ĭ',
|
85 |
+
'į' => 'Į',
|
86 |
+
'ı' => 'I',
|
87 |
+
'ij' => 'IJ',
|
88 |
+
'ĵ' => 'Ĵ',
|
89 |
+
'ķ' => 'Ķ',
|
90 |
+
'ĺ' => 'Ĺ',
|
91 |
+
'ļ' => 'Ļ',
|
92 |
+
'ľ' => 'Ľ',
|
93 |
+
'ŀ' => 'Ŀ',
|
94 |
+
'ł' => 'Ł',
|
95 |
+
'ń' => 'Ń',
|
96 |
+
'ņ' => 'Ņ',
|
97 |
+
'ň' => 'Ň',
|
98 |
+
'ŋ' => 'Ŋ',
|
99 |
+
'ō' => 'Ō',
|
100 |
+
'ŏ' => 'Ŏ',
|
101 |
+
'ő' => 'Ő',
|
102 |
+
'œ' => 'Œ',
|
103 |
+
'ŕ' => 'Ŕ',
|
104 |
+
'ŗ' => 'Ŗ',
|
105 |
+
'ř' => 'Ř',
|
106 |
+
'ś' => 'Ś',
|
107 |
+
'ŝ' => 'Ŝ',
|
108 |
+
'ş' => 'Ş',
|
109 |
+
'š' => 'Š',
|
110 |
+
'ţ' => 'Ţ',
|
111 |
+
'ť' => 'Ť',
|
112 |
+
'ŧ' => 'Ŧ',
|
113 |
+
'ũ' => 'Ũ',
|
114 |
+
'ū' => 'Ū',
|
115 |
+
'ŭ' => 'Ŭ',
|
116 |
+
'ů' => 'Ů',
|
117 |
+
'ű' => 'Ű',
|
118 |
+
'ų' => 'Ų',
|
119 |
+
'ŵ' => 'Ŵ',
|
120 |
+
'ŷ' => 'Ŷ',
|
121 |
+
'ź' => 'Ź',
|
122 |
+
'ż' => 'Ż',
|
123 |
+
'ž' => 'Ž',
|
124 |
+
'ſ' => 'S',
|
125 |
+
'ƀ' => 'Ƀ',
|
126 |
+
'ƃ' => 'Ƃ',
|
127 |
+
'ƅ' => 'Ƅ',
|
128 |
+
'ƈ' => 'Ƈ',
|
129 |
+
'ƌ' => 'Ƌ',
|
130 |
+
'ƒ' => 'Ƒ',
|
131 |
+
'ƕ' => 'Ƕ',
|
132 |
+
'ƙ' => 'Ƙ',
|
133 |
+
'ƚ' => 'Ƚ',
|
134 |
+
'ƞ' => 'Ƞ',
|
135 |
+
'ơ' => 'Ơ',
|
136 |
+
'ƣ' => 'Ƣ',
|
137 |
+
'ƥ' => 'Ƥ',
|
138 |
+
'ƨ' => 'Ƨ',
|
139 |
+
'ƭ' => 'Ƭ',
|
140 |
+
'ư' => 'Ư',
|
141 |
+
'ƴ' => 'Ƴ',
|
142 |
+
'ƶ' => 'Ƶ',
|
143 |
+
'ƹ' => 'Ƹ',
|
144 |
+
'ƽ' => 'Ƽ',
|
145 |
+
'ƿ' => 'Ƿ',
|
146 |
+
'Dž' => 'DŽ',
|
147 |
+
'dž' => 'DŽ',
|
148 |
+
'Lj' => 'LJ',
|
149 |
+
'lj' => 'LJ',
|
150 |
+
'Nj' => 'NJ',
|
151 |
+
'nj' => 'NJ',
|
152 |
+
'ǎ' => 'Ǎ',
|
153 |
+
'ǐ' => 'Ǐ',
|
154 |
+
'ǒ' => 'Ǒ',
|
155 |
+
'ǔ' => 'Ǔ',
|
156 |
+
'ǖ' => 'Ǖ',
|
157 |
+
'ǘ' => 'Ǘ',
|
158 |
+
'ǚ' => 'Ǚ',
|
159 |
+
'ǜ' => 'Ǜ',
|
160 |
+
'ǝ' => 'Ǝ',
|
161 |
+
'ǟ' => 'Ǟ',
|
162 |
+
'ǡ' => 'Ǡ',
|
163 |
+
'ǣ' => 'Ǣ',
|
164 |
+
'ǥ' => 'Ǥ',
|
165 |
+
'ǧ' => 'Ǧ',
|
166 |
+
'ǩ' => 'Ǩ',
|
167 |
+
'ǫ' => 'Ǫ',
|
168 |
+
'ǭ' => 'Ǭ',
|
169 |
+
'ǯ' => 'Ǯ',
|
170 |
+
'Dz' => 'DZ',
|
171 |
+
'dz' => 'DZ',
|
172 |
+
'ǵ' => 'Ǵ',
|
173 |
+
'ǹ' => 'Ǹ',
|
174 |
+
'ǻ' => 'Ǻ',
|
175 |
+
'ǽ' => 'Ǽ',
|
176 |
+
'ǿ' => 'Ǿ',
|
177 |
+
'ȁ' => 'Ȁ',
|
178 |
+
'ȃ' => 'Ȃ',
|
179 |
+
'ȅ' => 'Ȅ',
|
180 |
+
'ȇ' => 'Ȇ',
|
181 |
+
'ȉ' => 'Ȉ',
|
182 |
+
'ȋ' => 'Ȋ',
|
183 |
+
'ȍ' => 'Ȍ',
|
184 |
+
'ȏ' => 'Ȏ',
|
185 |
+
'ȑ' => 'Ȑ',
|
186 |
+
'ȓ' => 'Ȓ',
|
187 |
+
'ȕ' => 'Ȕ',
|
188 |
+
'ȗ' => 'Ȗ',
|
189 |
+
'ș' => 'Ș',
|
190 |
+
'ț' => 'Ț',
|
191 |
+
'ȝ' => 'Ȝ',
|
192 |
+
'ȟ' => 'Ȟ',
|
193 |
+
'ȣ' => 'Ȣ',
|
194 |
+
'ȥ' => 'Ȥ',
|
195 |
+
'ȧ' => 'Ȧ',
|
196 |
+
'ȩ' => 'Ȩ',
|
197 |
+
'ȫ' => 'Ȫ',
|
198 |
+
'ȭ' => 'Ȭ',
|
199 |
+
'ȯ' => 'Ȯ',
|
200 |
+
'ȱ' => 'Ȱ',
|
201 |
+
'ȳ' => 'Ȳ',
|
202 |
+
'ȼ' => 'Ȼ',
|
203 |
+
'ȿ' => 'Ȿ',
|
204 |
+
'ɀ' => 'Ɀ',
|
205 |
+
'ɂ' => 'Ɂ',
|
206 |
+
'ɇ' => 'Ɇ',
|
207 |
+
'ɉ' => 'Ɉ',
|
208 |
+
'ɋ' => 'Ɋ',
|
209 |
+
'ɍ' => 'Ɍ',
|
210 |
+
'ɏ' => 'Ɏ',
|
211 |
+
'ɐ' => 'Ɐ',
|
212 |
+
'ɑ' => 'Ɑ',
|
213 |
+
'ɒ' => 'Ɒ',
|
214 |
+
'ɓ' => 'Ɓ',
|
215 |
+
'ɔ' => 'Ɔ',
|
216 |
+
'ɖ' => 'Ɖ',
|
217 |
+
'ɗ' => 'Ɗ',
|
218 |
+
'ə' => 'Ə',
|
219 |
+
'ɛ' => 'Ɛ',
|
220 |
+
'ɜ' => 'Ɜ',
|
221 |
+
'ɠ' => 'Ɠ',
|
222 |
+
'ɡ' => 'Ɡ',
|
223 |
+
'ɣ' => 'Ɣ',
|
224 |
+
'ɥ' => 'Ɥ',
|
225 |
+
'ɦ' => 'Ɦ',
|
226 |
+
'ɨ' => 'Ɨ',
|
227 |
+
'ɩ' => 'Ɩ',
|
228 |
+
'ɫ' => 'Ɫ',
|
229 |
+
'ɬ' => 'Ɬ',
|
230 |
+
'ɯ' => 'Ɯ',
|
231 |
+
'ɱ' => 'Ɱ',
|
232 |
+
'ɲ' => 'Ɲ',
|
233 |
+
'ɵ' => 'Ɵ',
|
234 |
+
'ɽ' => 'Ɽ',
|
235 |
+
'ʀ' => 'Ʀ',
|
236 |
+
'ʃ' => 'Ʃ',
|
237 |
+
'ʇ' => 'Ʇ',
|
238 |
+
'ʈ' => 'Ʈ',
|
239 |
+
'ʉ' => 'Ʉ',
|
240 |
+
'ʊ' => 'Ʊ',
|
241 |
+
'ʋ' => 'Ʋ',
|
242 |
+
'ʌ' => 'Ʌ',
|
243 |
+
'ʒ' => 'Ʒ',
|
244 |
+
'ʞ' => 'Ʞ',
|
245 |
+
'ͅ' => 'Ι',
|
246 |
+
'ͱ' => 'Ͱ',
|
247 |
+
'ͳ' => 'Ͳ',
|
248 |
+
'ͷ' => 'Ͷ',
|
249 |
+
'ͻ' => 'Ͻ',
|
250 |
+
'ͼ' => 'Ͼ',
|
251 |
+
'ͽ' => 'Ͽ',
|
252 |
+
'ά' => 'Ά',
|
253 |
+
'έ' => 'Έ',
|
254 |
+
'ή' => 'Ή',
|
255 |
+
'ί' => 'Ί',
|
256 |
+
'α' => 'Α',
|
257 |
+
'β' => 'Β',
|
258 |
+
'γ' => 'Γ',
|
259 |
+
'δ' => 'Δ',
|
260 |
+
'ε' => 'Ε',
|
261 |
+
'ζ' => 'Ζ',
|
262 |
+
'η' => 'Η',
|
263 |
+
'θ' => 'Θ',
|
264 |
+
'ι' => 'Ι',
|
265 |
+
'κ' => 'Κ',
|
266 |
+
'λ' => 'Λ',
|
267 |
+
'μ' => 'Μ',
|
268 |
+
'ν' => 'Ν',
|
269 |
+
'ξ' => 'Ξ',
|
270 |
+
'ο' => 'Ο',
|
271 |
+
'π' => 'Π',
|
272 |
+
'ρ' => 'Ρ',
|
273 |
+
'ς' => 'Σ',
|
274 |
+
'σ' => 'Σ',
|
275 |
+
'τ' => 'Τ',
|
276 |
+
'υ' => 'Υ',
|
277 |
+
'φ' => 'Φ',
|
278 |
+
'χ' => 'Χ',
|
279 |
+
'ψ' => 'Ψ',
|
280 |
+
'ω' => 'Ω',
|
281 |
+
'ϊ' => 'Ϊ',
|
282 |
+
'ϋ' => 'Ϋ',
|
283 |
+
'ό' => 'Ό',
|
284 |
+
'ύ' => 'Ύ',
|
285 |
+
'ώ' => 'Ώ',
|
286 |
+
'ϐ' => 'Β',
|
287 |
+
'ϑ' => 'Θ',
|
288 |
+
'ϕ' => 'Φ',
|
289 |
+
'ϖ' => 'Π',
|
290 |
+
'ϗ' => 'Ϗ',
|
291 |
+
'ϙ' => 'Ϙ',
|
292 |
+
'ϛ' => 'Ϛ',
|
293 |
+
'ϝ' => 'Ϝ',
|
294 |
+
'ϟ' => 'Ϟ',
|
295 |
+
'ϡ' => 'Ϡ',
|
296 |
+
'ϣ' => 'Ϣ',
|
297 |
+
'ϥ' => 'Ϥ',
|
298 |
+
'ϧ' => 'Ϧ',
|
299 |
+
'ϩ' => 'Ϩ',
|
300 |
+
'ϫ' => 'Ϫ',
|
301 |
+
'ϭ' => 'Ϭ',
|
302 |
+
'ϯ' => 'Ϯ',
|
303 |
+
'ϰ' => 'Κ',
|
304 |
+
'ϱ' => 'Ρ',
|
305 |
+
'ϲ' => 'Ϲ',
|
306 |
+
'ϳ' => 'Ϳ',
|
307 |
+
'ϵ' => 'Ε',
|
308 |
+
'ϸ' => 'Ϸ',
|
309 |
+
'ϻ' => 'Ϻ',
|
310 |
+
'а' => 'А',
|
311 |
+
'б' => 'Б',
|
312 |
+
'в' => 'В',
|
313 |
+
'г' => 'Г',
|
314 |
+
'д' => 'Д',
|
315 |
+
'е' => 'Е',
|
316 |
+
'ж' => 'Ж',
|
317 |
+
'з' => 'З',
|
318 |
+
'и' => 'И',
|
319 |
+
'й' => 'Й',
|
320 |
+
'к' => 'К',
|
321 |
+
'л' => 'Л',
|
322 |
+
'м' => 'М',
|
323 |
+
'н' => 'Н',
|
324 |
+
'о' => 'О',
|
325 |
+
'п' => 'П',
|
326 |
+
'р' => 'Р',
|
327 |
+
'с' => 'С',
|
328 |
+
'т' => 'Т',
|
329 |
+
'у' => 'У',
|
330 |
+
'ф' => 'Ф',
|
331 |
+
'х' => 'Х',
|
332 |
+
'ц' => 'Ц',
|
333 |
+
'ч' => 'Ч',
|
334 |
+
'ш' => 'Ш',
|
335 |
+
'щ' => 'Щ',
|
336 |
+
'ъ' => 'Ъ',
|
337 |
+
'ы' => 'Ы',
|
338 |
+
'ь' => 'Ь',
|
339 |
+
'э' => 'Э',
|
340 |
+
'ю' => 'Ю',
|
341 |
+
'я' => 'Я',
|
342 |
+
'ѐ' => 'Ѐ',
|
343 |
+
'ё' => 'Ё',
|
344 |
+
'ђ' => 'Ђ',
|
345 |
+
'ѓ' => 'Ѓ',
|
346 |
+
'є' => 'Є',
|
347 |
+
'ѕ' => 'Ѕ',
|
348 |
+
'і' => 'І',
|
349 |
+
'ї' => 'Ї',
|
350 |
+
'ј' => 'Ј',
|
351 |
+
'љ' => 'Љ',
|
352 |
+
'њ' => 'Њ',
|
353 |
+
'ћ' => 'Ћ',
|
354 |
+
'ќ' => 'Ќ',
|
355 |
+
'ѝ' => 'Ѝ',
|
356 |
+
'ў' => 'Ў',
|
357 |
+
'џ' => 'Џ',
|
358 |
+
'ѡ' => 'Ѡ',
|
359 |
+
'ѣ' => 'Ѣ',
|
360 |
+
'ѥ' => 'Ѥ',
|
361 |
+
'ѧ' => 'Ѧ',
|
362 |
+
'ѩ' => 'Ѩ',
|
363 |
+
'ѫ' => 'Ѫ',
|
364 |
+
'ѭ' => 'Ѭ',
|
365 |
+
'ѯ' => 'Ѯ',
|
366 |
+
'ѱ' => 'Ѱ',
|
367 |
+
'ѳ' => 'Ѳ',
|
368 |
+
'ѵ' => 'Ѵ',
|
369 |
+
'ѷ' => 'Ѷ',
|
370 |
+
'ѹ' => 'Ѹ',
|
371 |
+
'ѻ' => 'Ѻ',
|
372 |
+
'ѽ' => 'Ѽ',
|
373 |
+
'ѿ' => 'Ѿ',
|
374 |
+
'ҁ' => 'Ҁ',
|
375 |
+
'ҋ' => 'Ҋ',
|
376 |
+
'ҍ' => 'Ҍ',
|
377 |
+
'ҏ' => 'Ҏ',
|
378 |
+
'ґ' => 'Ґ',
|
379 |
+
'ғ' => 'Ғ',
|
380 |
+
'ҕ' => 'Ҕ',
|
381 |
+
'җ' => 'Җ',
|
382 |
+
'ҙ' => 'Ҙ',
|
383 |
+
'қ' => 'Қ',
|
384 |
+
'ҝ' => 'Ҝ',
|
385 |
+
'ҟ' => 'Ҟ',
|
386 |
+
'ҡ' => 'Ҡ',
|
387 |
+
'ң' => 'Ң',
|
388 |
+
'ҥ' => 'Ҥ',
|
389 |
+
'ҧ' => 'Ҧ',
|
390 |
+
'ҩ' => 'Ҩ',
|
391 |
+
'ҫ' => 'Ҫ',
|
392 |
+
'ҭ' => 'Ҭ',
|
393 |
+
'ү' => 'Ү',
|
394 |
+
'ұ' => 'Ұ',
|
395 |
+
'ҳ' => 'Ҳ',
|
396 |
+
'ҵ' => 'Ҵ',
|
397 |
+
'ҷ' => 'Ҷ',
|
398 |
+
'ҹ' => 'Ҹ',
|
399 |
+
'һ' => 'Һ',
|
400 |
+
'ҽ' => 'Ҽ',
|
401 |
+
'ҿ' => 'Ҿ',
|
402 |
+
'ӂ' => 'Ӂ',
|
403 |
+
'ӄ' => 'Ӄ',
|
404 |
+
'ӆ' => 'Ӆ',
|
405 |
+
'ӈ' => 'Ӈ',
|
406 |
+
'ӊ' => 'Ӊ',
|
407 |
+
'ӌ' => 'Ӌ',
|
408 |
+
'ӎ' => 'Ӎ',
|
409 |
+
'ӏ' => 'Ӏ',
|
410 |
+
'ӑ' => 'Ӑ',
|
411 |
+
'ӓ' => 'Ӓ',
|
412 |
+
'ӕ' => 'Ӕ',
|
413 |
+
'ӗ' => 'Ӗ',
|
414 |
+
'ә' => 'Ә',
|
415 |
+
'ӛ' => 'Ӛ',
|
416 |
+
'ӝ' => 'Ӝ',
|
417 |
+
'ӟ' => 'Ӟ',
|
418 |
+
'ӡ' => 'Ӡ',
|
419 |
+
'ӣ' => 'Ӣ',
|
420 |
+
'ӥ' => 'Ӥ',
|
421 |
+
'ӧ' => 'Ӧ',
|
422 |
+
'ө' => 'Ө',
|
423 |
+
'ӫ' => 'Ӫ',
|
424 |
+
'ӭ' => 'Ӭ',
|
425 |
+
'ӯ' => 'Ӯ',
|
426 |
+
'ӱ' => 'Ӱ',
|
427 |
+
'ӳ' => 'Ӳ',
|
428 |
+
'ӵ' => 'Ӵ',
|
429 |
+
'ӷ' => 'Ӷ',
|
430 |
+
'ӹ' => 'Ӹ',
|
431 |
+
'ӻ' => 'Ӻ',
|
432 |
+
'ӽ' => 'Ӽ',
|
433 |
+
'ӿ' => 'Ӿ',
|
434 |
+
'ԁ' => 'Ԁ',
|
435 |
+
'ԃ' => 'Ԃ',
|
436 |
+
'ԅ' => 'Ԅ',
|
437 |
+
'ԇ' => 'Ԇ',
|
438 |
+
'ԉ' => 'Ԉ',
|
439 |
+
'ԋ' => 'Ԋ',
|
440 |
+
'ԍ' => 'Ԍ',
|
441 |
+
'ԏ' => 'Ԏ',
|
442 |
+
'ԑ' => 'Ԑ',
|
443 |
+
'ԓ' => 'Ԓ',
|
444 |
+
'ԕ' => 'Ԕ',
|
445 |
+
'ԗ' => 'Ԗ',
|
446 |
+
'ԙ' => 'Ԙ',
|
447 |
+
'ԛ' => 'Ԛ',
|
448 |
+
'ԝ' => 'Ԝ',
|
449 |
+
'ԟ' => 'Ԟ',
|
450 |
+
'ԡ' => 'Ԡ',
|
451 |
+
'ԣ' => 'Ԣ',
|
452 |
+
'ԥ' => 'Ԥ',
|
453 |
+
'ԧ' => 'Ԧ',
|
454 |
+
'ԩ' => 'Ԩ',
|
455 |
+
'ԫ' => 'Ԫ',
|
456 |
+
'ԭ' => 'Ԭ',
|
457 |
+
'ԯ' => 'Ԯ',
|
458 |
+
'ա' => 'Ա',
|
459 |
+
'բ' => 'Բ',
|
460 |
+
'գ' => 'Գ',
|
461 |
+
'դ' => 'Դ',
|
462 |
+
'ե' => 'Ե',
|
463 |
+
'զ' => 'Զ',
|
464 |
+
'է' => 'Է',
|
465 |
+
'ը' => 'Ը',
|
466 |
+
'թ' => 'Թ',
|
467 |
+
'ժ' => 'Ժ',
|
468 |
+
'ի' => 'Ի',
|
469 |
+
'լ' => 'Լ',
|
470 |
+
'խ' => 'Խ',
|
471 |
+
'ծ' => 'Ծ',
|
472 |
+
'կ' => 'Կ',
|
473 |
+
'հ' => 'Հ',
|
474 |
+
'ձ' => 'Ձ',
|
475 |
+
'ղ' => 'Ղ',
|
476 |
+
'ճ' => 'Ճ',
|
477 |
+
'մ' => 'Մ',
|
478 |
+
'յ' => 'Յ',
|
479 |
+
'ն' => 'Ն',
|
480 |
+
'շ' => 'Շ',
|
481 |
+
'ո' => 'Ո',
|
482 |
+
'չ' => 'Չ',
|
483 |
+
'պ' => 'Պ',
|
484 |
+
'ջ' => 'Ջ',
|
485 |
+
'ռ' => 'Ռ',
|
486 |
+
'ս' => 'Ս',
|
487 |
+
'վ' => 'Վ',
|
488 |
+
'տ' => 'Տ',
|
489 |
+
'ր' => 'Ր',
|
490 |
+
'ց' => 'Ց',
|
491 |
+
'ւ' => 'Ւ',
|
492 |
+
'փ' => 'Փ',
|
493 |
+
'ք' => 'Ք',
|
494 |
+
'օ' => 'Օ',
|
495 |
+
'ֆ' => 'Ֆ',
|
496 |
+
'ᵹ' => 'Ᵹ',
|
497 |
+
'ᵽ' => 'Ᵽ',
|
498 |
+
'ḁ' => 'Ḁ',
|
499 |
+
'ḃ' => 'Ḃ',
|
500 |
+
'ḅ' => 'Ḅ',
|
501 |
+
'ḇ' => 'Ḇ',
|
502 |
+
'ḉ' => 'Ḉ',
|
503 |
+
'ḋ' => 'Ḋ',
|
504 |
+
'ḍ' => 'Ḍ',
|
505 |
+
'ḏ' => 'Ḏ',
|
506 |
+
'ḑ' => 'Ḑ',
|
507 |
+
'ḓ' => 'Ḓ',
|
508 |
+
'ḕ' => 'Ḕ',
|
509 |
+
'ḗ' => 'Ḗ',
|
510 |
+
'ḙ' => 'Ḙ',
|
511 |
+
'ḛ' => 'Ḛ',
|
512 |
+
'ḝ' => 'Ḝ',
|
513 |
+
'ḟ' => 'Ḟ',
|
514 |
+
'ḡ' => 'Ḡ',
|
515 |
+
'ḣ' => 'Ḣ',
|
516 |
+
'ḥ' => 'Ḥ',
|
517 |
+
'ḧ' => 'Ḧ',
|
518 |
+
'ḩ' => 'Ḩ',
|
519 |
+
'ḫ' => 'Ḫ',
|
520 |
+
'ḭ' => 'Ḭ',
|
521 |
+
'ḯ' => 'Ḯ',
|
522 |
+
'ḱ' => 'Ḱ',
|
523 |
+
'ḳ' => 'Ḳ',
|
524 |
+
'ḵ' => 'Ḵ',
|
525 |
+
'ḷ' => 'Ḷ',
|
526 |
+
'ḹ' => 'Ḹ',
|
527 |
+
'ḻ' => 'Ḻ',
|
528 |
+
'ḽ' => 'Ḽ',
|
529 |
+
'ḿ' => 'Ḿ',
|
530 |
+
'ṁ' => 'Ṁ',
|
531 |
+
'ṃ' => 'Ṃ',
|
532 |
+
'ṅ' => 'Ṅ',
|
533 |
+
'ṇ' => 'Ṇ',
|
534 |
+
'ṉ' => 'Ṉ',
|
535 |
+
'ṋ' => 'Ṋ',
|
536 |
+
'ṍ' => 'Ṍ',
|
537 |
+
'ṏ' => 'Ṏ',
|
538 |
+
'ṑ' => 'Ṑ',
|
539 |
+
'ṓ' => 'Ṓ',
|
540 |
+
'ṕ' => 'Ṕ',
|
541 |
+
'ṗ' => 'Ṗ',
|
542 |
+
'ṙ' => 'Ṙ',
|
543 |
+
'ṛ' => 'Ṛ',
|
544 |
+
'ṝ' => 'Ṝ',
|
545 |
+
'ṟ' => 'Ṟ',
|
546 |
+
'ṡ' => 'Ṡ',
|
547 |
+
'ṣ' => 'Ṣ',
|
548 |
+
'ṥ' => 'Ṥ',
|
549 |
+
'ṧ' => 'Ṧ',
|
550 |
+
'ṩ' => 'Ṩ',
|
551 |
+
'ṫ' => 'Ṫ',
|
552 |
+
'ṭ' => 'Ṭ',
|
553 |
+
'ṯ' => 'Ṯ',
|
554 |
+
'ṱ' => 'Ṱ',
|
555 |
+
'ṳ' => 'Ṳ',
|
556 |
+
'ṵ' => 'Ṵ',
|
557 |
+
'ṷ' => 'Ṷ',
|
558 |
+
'ṹ' => 'Ṹ',
|
559 |
+
'ṻ' => 'Ṻ',
|
560 |
+
'ṽ' => 'Ṽ',
|
561 |
+
'ṿ' => 'Ṿ',
|
562 |
+
'ẁ' => 'Ẁ',
|
563 |
+
'ẃ' => 'Ẃ',
|
564 |
+
'ẅ' => 'Ẅ',
|
565 |
+
'ẇ' => 'Ẇ',
|
566 |
+
'ẉ' => 'Ẉ',
|
567 |
+
'ẋ' => 'Ẋ',
|
568 |
+
'ẍ' => 'Ẍ',
|
569 |
+
'ẏ' => 'Ẏ',
|
570 |
+
'ẑ' => 'Ẑ',
|
571 |
+
'ẓ' => 'Ẓ',
|
572 |
+
'ẕ' => 'Ẕ',
|
573 |
+
'ẛ' => 'Ṡ',
|
574 |
+
'ạ' => 'Ạ',
|
575 |
+
'ả' => 'Ả',
|
576 |
+
'ấ' => 'Ấ',
|
577 |
+
'ầ' => 'Ầ',
|
578 |
+
'ẩ' => 'Ẩ',
|
579 |
+
'ẫ' => 'Ẫ',
|
580 |
+
'ậ' => 'Ậ',
|
581 |
+
'ắ' => 'Ắ',
|
582 |
+
'ằ' => 'Ằ',
|
583 |
+
'ẳ' => 'Ẳ',
|
584 |
+
'ẵ' => 'Ẵ',
|
585 |
+
'ặ' => 'Ặ',
|
586 |
+
'ẹ' => 'Ẹ',
|
587 |
+
'ẻ' => 'Ẻ',
|
588 |
+
'ẽ' => 'Ẽ',
|
589 |
+
'ế' => 'Ế',
|
590 |
+
'ề' => 'Ề',
|
591 |
+
'ể' => 'Ể',
|
592 |
+
'ễ' => 'Ễ',
|
593 |
+
'ệ' => 'Ệ',
|
594 |
+
'ỉ' => 'Ỉ',
|
595 |
+
'ị' => 'Ị',
|
596 |
+
'ọ' => 'Ọ',
|
597 |
+
'ỏ' => 'Ỏ',
|
598 |
+
'ố' => 'Ố',
|
599 |
+
'ồ' => 'Ồ',
|
600 |
+
'ổ' => 'Ổ',
|
601 |
+
'ỗ' => 'Ỗ',
|
602 |
+
'ộ' => 'Ộ',
|
603 |
+
'ớ' => 'Ớ',
|
604 |
+
'ờ' => 'Ờ',
|
605 |
+
'ở' => 'Ở',
|
606 |
+
'ỡ' => 'Ỡ',
|
607 |
+
'ợ' => 'Ợ',
|
608 |
+
'ụ' => 'Ụ',
|
609 |
+
'ủ' => 'Ủ',
|
610 |
+
'ứ' => 'Ứ',
|
611 |
+
'ừ' => 'Ừ',
|
612 |
+
'ử' => 'Ử',
|
613 |
+
'ữ' => 'Ữ',
|
614 |
+
'ự' => 'Ự',
|
615 |
+
'ỳ' => 'Ỳ',
|
616 |
+
'ỵ' => 'Ỵ',
|
617 |
+
'ỷ' => 'Ỷ',
|
618 |
+
'ỹ' => 'Ỹ',
|
619 |
+
'ỻ' => 'Ỻ',
|
620 |
+
'ỽ' => 'Ỽ',
|
621 |
+
'ỿ' => 'Ỿ',
|
622 |
+
'ἀ' => 'Ἀ',
|
623 |
+
'ἁ' => 'Ἁ',
|
624 |
+
'ἂ' => 'Ἂ',
|
625 |
+
'ἃ' => 'Ἃ',
|
626 |
+
'ἄ' => 'Ἄ',
|
627 |
+
'ἅ' => 'Ἅ',
|
628 |
+
'ἆ' => 'Ἆ',
|
629 |
+
'ἇ' => 'Ἇ',
|
630 |
+
'ἐ' => 'Ἐ',
|
631 |
+
'ἑ' => 'Ἑ',
|
632 |
+
'ἒ' => 'Ἒ',
|
633 |
+
'ἓ' => 'Ἓ',
|
634 |
+
'ἔ' => 'Ἔ',
|
635 |
+
'ἕ' => 'Ἕ',
|
636 |
+
'ἠ' => 'Ἠ',
|
637 |
+
'ἡ' => 'Ἡ',
|
638 |
+
'ἢ' => 'Ἢ',
|
639 |
+
'ἣ' => 'Ἣ',
|
640 |
+
'ἤ' => 'Ἤ',
|
641 |
+
'ἥ' => 'Ἥ',
|
642 |
+
'ἦ' => 'Ἦ',
|
643 |
+
'ἧ' => 'Ἧ',
|
644 |
+
'ἰ' => 'Ἰ',
|
645 |
+
'ἱ' => 'Ἱ',
|
646 |
+
'ἲ' => 'Ἲ',
|
647 |
+
'ἳ' => 'Ἳ',
|
648 |
+
'ἴ' => 'Ἴ',
|
649 |
+
'ἵ' => 'Ἵ',
|
650 |
+
'ἶ' => 'Ἶ',
|
651 |
+
'ἷ' => 'Ἷ',
|
652 |
+
'ὀ' => 'Ὀ',
|
653 |
+
'ὁ' => 'Ὁ',
|
654 |
+
'ὂ' => 'Ὂ',
|
655 |
+
'ὃ' => 'Ὃ',
|
656 |
+
'ὄ' => 'Ὄ',
|
657 |
+
'ὅ' => 'Ὅ',
|
658 |
+
'ὑ' => 'Ὑ',
|
659 |
+
'ὓ' => 'Ὓ',
|
660 |
+
'ὕ' => 'Ὕ',
|
661 |
+
'ὗ' => 'Ὗ',
|
662 |
+
'ὠ' => 'Ὠ',
|
663 |
+
'ὡ' => 'Ὡ',
|
664 |
+
'ὢ' => 'Ὢ',
|
665 |
+
'ὣ' => 'Ὣ',
|
666 |
+
'ὤ' => 'Ὤ',
|
667 |
+
'ὥ' => 'Ὥ',
|
668 |
+
'ὦ' => 'Ὦ',
|
669 |
+
'ὧ' => 'Ὧ',
|
670 |
+
'ὰ' => 'Ὰ',
|
671 |
+
'ά' => 'Ά',
|
672 |
+
'ὲ' => 'Ὲ',
|
673 |
+
'έ' => 'Έ',
|
674 |
+
'ὴ' => 'Ὴ',
|
675 |
+
'ή' => 'Ή',
|
676 |
+
'ὶ' => 'Ὶ',
|
677 |
+
'ί' => 'Ί',
|
678 |
+
'ὸ' => 'Ὸ',
|
679 |
+
'ό' => 'Ό',
|
680 |
+
'ὺ' => 'Ὺ',
|
681 |
+
'ύ' => 'Ύ',
|
682 |
+
'ὼ' => 'Ὼ',
|
683 |
+
'ώ' => 'Ώ',
|
684 |
+
'ᾀ' => 'ᾈ',
|
685 |
+
'ᾁ' => 'ᾉ',
|
686 |
+
'ᾂ' => 'ᾊ',
|
687 |
+
'ᾃ' => 'ᾋ',
|
688 |
+
'ᾄ' => 'ᾌ',
|
689 |
+
'ᾅ' => 'ᾍ',
|
690 |
+
'ᾆ' => 'ᾎ',
|
691 |
+
'ᾇ' => 'ᾏ',
|
692 |
+
'ᾐ' => 'ᾘ',
|
693 |
+
'ᾑ' => 'ᾙ',
|
694 |
+
'ᾒ' => 'ᾚ',
|
695 |
+
'ᾓ' => 'ᾛ',
|
696 |
+
'ᾔ' => 'ᾜ',
|
697 |
+
'ᾕ' => 'ᾝ',
|
698 |
+
'ᾖ' => 'ᾞ',
|
699 |
+
'ᾗ' => 'ᾟ',
|
700 |
+
'ᾠ' => 'ᾨ',
|
701 |
+
'ᾡ' => 'ᾩ',
|
702 |
+
'ᾢ' => 'ᾪ',
|
703 |
+
'ᾣ' => 'ᾫ',
|
704 |
+
'ᾤ' => 'ᾬ',
|
705 |
+
'ᾥ' => 'ᾭ',
|
706 |
+
'ᾦ' => 'ᾮ',
|
707 |
+
'ᾧ' => 'ᾯ',
|
708 |
+
'ᾰ' => 'Ᾰ',
|
709 |
+
'ᾱ' => 'Ᾱ',
|
710 |
+
'ᾳ' => 'ᾼ',
|
711 |
+
'ι' => 'Ι',
|
712 |
+
'ῃ' => 'ῌ',
|
713 |
+
'ῐ' => 'Ῐ',
|
714 |
+
'ῑ' => 'Ῑ',
|
715 |
+
'ῠ' => 'Ῠ',
|
716 |
+
'ῡ' => 'Ῡ',
|
717 |
+
'ῥ' => 'Ῥ',
|
718 |
+
'ῳ' => 'ῼ',
|
719 |
+
'ⅎ' => 'Ⅎ',
|
720 |
+
'ⅰ' => 'Ⅰ',
|
721 |
+
'ⅱ' => 'Ⅱ',
|
722 |
+
'ⅲ' => 'Ⅲ',
|
723 |
+
'ⅳ' => 'Ⅳ',
|
724 |
+
'ⅴ' => 'Ⅴ',
|
725 |
+
'ⅵ' => 'Ⅵ',
|
726 |
+
'ⅶ' => 'Ⅶ',
|
727 |
+
'ⅷ' => 'Ⅷ',
|
728 |
+
'ⅸ' => 'Ⅸ',
|
729 |
+
'ⅹ' => 'Ⅹ',
|
730 |
+
'ⅺ' => 'Ⅺ',
|
731 |
+
'ⅻ' => 'Ⅻ',
|
732 |
+
'ⅼ' => 'Ⅼ',
|
733 |
+
'ⅽ' => 'Ⅽ',
|
734 |
+
'ⅾ' => 'Ⅾ',
|
735 |
+
'ⅿ' => 'Ⅿ',
|
736 |
+
'ↄ' => 'Ↄ',
|
737 |
+
'ⓐ' => 'Ⓐ',
|
738 |
+
'ⓑ' => 'Ⓑ',
|
739 |
+
'ⓒ' => 'Ⓒ',
|
740 |
+
'ⓓ' => 'Ⓓ',
|
741 |
+
'ⓔ' => 'Ⓔ',
|
742 |
+
'ⓕ' => 'Ⓕ',
|
743 |
+
'ⓖ' => 'Ⓖ',
|
744 |
+
'ⓗ' => 'Ⓗ',
|
745 |
+
'ⓘ' => 'Ⓘ',
|
746 |
+
'ⓙ' => 'Ⓙ',
|
747 |
+
'ⓚ' => 'Ⓚ',
|
748 |
+
'ⓛ' => 'Ⓛ',
|
749 |
+
'ⓜ' => 'Ⓜ',
|
750 |
+
'ⓝ' => 'Ⓝ',
|
751 |
+
'ⓞ' => 'Ⓞ',
|
752 |
+
'ⓟ' => 'Ⓟ',
|
753 |
+
'ⓠ' => 'Ⓠ',
|
754 |
+
'ⓡ' => 'Ⓡ',
|
755 |
+
'ⓢ' => 'Ⓢ',
|
756 |
+
'ⓣ' => 'Ⓣ',
|
757 |
+
'ⓤ' => 'Ⓤ',
|
758 |
+
'ⓥ' => 'Ⓥ',
|
759 |
+
'ⓦ' => 'Ⓦ',
|
760 |
+
'ⓧ' => 'Ⓧ',
|
761 |
+
'ⓨ' => 'Ⓨ',
|
762 |
+
'ⓩ' => 'Ⓩ',
|
763 |
+
'ⰰ' => 'Ⰰ',
|
764 |
+
'ⰱ' => 'Ⰱ',
|
765 |
+
'ⰲ' => 'Ⰲ',
|
766 |
+
'ⰳ' => 'Ⰳ',
|
767 |
+
'ⰴ' => 'Ⰴ',
|
768 |
+
'ⰵ' => 'Ⰵ',
|
769 |
+
'ⰶ' => 'Ⰶ',
|
770 |
+
'ⰷ' => 'Ⰷ',
|
771 |
+
'ⰸ' => 'Ⰸ',
|
772 |
+
'ⰹ' => 'Ⰹ',
|
773 |
+
'ⰺ' => 'Ⰺ',
|
774 |
+
'ⰻ' => 'Ⰻ',
|
775 |
+
'ⰼ' => 'Ⰼ',
|
776 |
+
'ⰽ' => 'Ⰽ',
|
777 |
+
'ⰾ' => 'Ⰾ',
|
778 |
+
'ⰿ' => 'Ⰿ',
|
779 |
+
'ⱀ' => 'Ⱀ',
|
780 |
+
'ⱁ' => 'Ⱁ',
|
781 |
+
'ⱂ' => 'Ⱂ',
|
782 |
+
'ⱃ' => 'Ⱃ',
|
783 |
+
'ⱄ' => 'Ⱄ',
|
784 |
+
'ⱅ' => 'Ⱅ',
|
785 |
+
'ⱆ' => 'Ⱆ',
|
786 |
+
'ⱇ' => 'Ⱇ',
|
787 |
+
'ⱈ' => 'Ⱈ',
|
788 |
+
'ⱉ' => 'Ⱉ',
|
789 |
+
'ⱊ' => 'Ⱊ',
|
790 |
+
'ⱋ' => 'Ⱋ',
|
791 |
+
'ⱌ' => 'Ⱌ',
|
792 |
+
'ⱍ' => 'Ⱍ',
|
793 |
+
'ⱎ' => 'Ⱎ',
|
794 |
+
'ⱏ' => 'Ⱏ',
|
795 |
+
'ⱐ' => 'Ⱐ',
|
796 |
+
'ⱑ' => 'Ⱑ',
|
797 |
+
'ⱒ' => 'Ⱒ',
|
798 |
+
'ⱓ' => 'Ⱓ',
|
799 |
+
'ⱔ' => 'Ⱔ',
|
800 |
+
'ⱕ' => 'Ⱕ',
|
801 |
+
'ⱖ' => 'Ⱖ',
|
802 |
+
'ⱗ' => 'Ⱗ',
|
803 |
+
'ⱘ' => 'Ⱘ',
|
804 |
+
'ⱙ' => 'Ⱙ',
|
805 |
+
'ⱚ' => 'Ⱚ',
|
806 |
+
'ⱛ' => 'Ⱛ',
|
807 |
+
'ⱜ' => 'Ⱜ',
|
808 |
+
'ⱝ' => 'Ⱝ',
|
809 |
+
'ⱞ' => 'Ⱞ',
|
810 |
+
'ⱡ' => 'Ⱡ',
|
811 |
+
'ⱥ' => 'Ⱥ',
|
812 |
+
'ⱦ' => 'Ⱦ',
|
813 |
+
'ⱨ' => 'Ⱨ',
|
814 |
+
'ⱪ' => 'Ⱪ',
|
815 |
+
'ⱬ' => 'Ⱬ',
|
816 |
+
'ⱳ' => 'Ⱳ',
|
817 |
+
'ⱶ' => 'Ⱶ',
|
818 |
+
'ⲁ' => 'Ⲁ',
|
819 |
+
'ⲃ' => 'Ⲃ',
|
820 |
+
'ⲅ' => 'Ⲅ',
|
821 |
+
'ⲇ' => 'Ⲇ',
|
822 |
+
'ⲉ' => 'Ⲉ',
|
823 |
+
'ⲋ' => 'Ⲋ',
|
824 |
+
'ⲍ' => 'Ⲍ',
|
825 |
+
'ⲏ' => 'Ⲏ',
|
826 |
+
'ⲑ' => 'Ⲑ',
|
827 |
+
'ⲓ' => 'Ⲓ',
|
828 |
+
'ⲕ' => 'Ⲕ',
|
829 |
+
'ⲗ' => 'Ⲗ',
|
830 |
+
'ⲙ' => 'Ⲙ',
|
831 |
+
'ⲛ' => 'Ⲛ',
|
832 |
+
'ⲝ' => 'Ⲝ',
|
833 |
+
'ⲟ' => 'Ⲟ',
|
834 |
+
'ⲡ' => 'Ⲡ',
|
835 |
+
'ⲣ' => 'Ⲣ',
|
836 |
+
'ⲥ' => 'Ⲥ',
|
837 |
+
'ⲧ' => 'Ⲧ',
|
838 |
+
'ⲩ' => 'Ⲩ',
|
839 |
+
'ⲫ' => 'Ⲫ',
|
840 |
+
'ⲭ' => 'Ⲭ',
|
841 |
+
'ⲯ' => 'Ⲯ',
|
842 |
+
'ⲱ' => 'Ⲱ',
|
843 |
+
'ⲳ' => 'Ⲳ',
|
844 |
+
'ⲵ' => 'Ⲵ',
|
845 |
+
'ⲷ' => 'Ⲷ',
|
846 |
+
'ⲹ' => 'Ⲹ',
|
847 |
+
'ⲻ' => 'Ⲻ',
|
848 |
+
'ⲽ' => 'Ⲽ',
|
849 |
+
'ⲿ' => 'Ⲿ',
|
850 |
+
'ⳁ' => 'Ⳁ',
|
851 |
+
'ⳃ' => 'Ⳃ',
|
852 |
+
'ⳅ' => 'Ⳅ',
|
853 |
+
'ⳇ' => 'Ⳇ',
|
854 |
+
'ⳉ' => 'Ⳉ',
|
855 |
+
'ⳋ' => 'Ⳋ',
|
856 |
+
'ⳍ' => 'Ⳍ',
|
857 |
+
'ⳏ' => 'Ⳏ',
|
858 |
+
'ⳑ' => 'Ⳑ',
|
859 |
+
'ⳓ' => 'Ⳓ',
|
860 |
+
'ⳕ' => 'Ⳕ',
|
861 |
+
'ⳗ' => 'Ⳗ',
|
862 |
+
'ⳙ' => 'Ⳙ',
|
863 |
+
'ⳛ' => 'Ⳛ',
|
864 |
+
'ⳝ' => 'Ⳝ',
|
865 |
+
'ⳟ' => 'Ⳟ',
|
866 |
+
'ⳡ' => 'Ⳡ',
|
867 |
+
'ⳣ' => 'Ⳣ',
|
868 |
+
'ⳬ' => 'Ⳬ',
|
869 |
+
'ⳮ' => 'Ⳮ',
|
870 |
+
'ⳳ' => 'Ⳳ',
|
871 |
+
'ⴀ' => 'Ⴀ',
|
872 |
+
'ⴁ' => 'Ⴁ',
|
873 |
+
'ⴂ' => 'Ⴂ',
|
874 |
+
'ⴃ' => 'Ⴃ',
|
875 |
+
'ⴄ' => 'Ⴄ',
|
876 |
+
'ⴅ' => 'Ⴅ',
|
877 |
+
'ⴆ' => 'Ⴆ',
|
878 |
+
'ⴇ' => 'Ⴇ',
|
879 |
+
'ⴈ' => 'Ⴈ',
|
880 |
+
'ⴉ' => 'Ⴉ',
|
881 |
+
'ⴊ' => 'Ⴊ',
|
882 |
+
'ⴋ' => 'Ⴋ',
|
883 |
+
'ⴌ' => 'Ⴌ',
|
884 |
+
'ⴍ' => 'Ⴍ',
|
885 |
+
'ⴎ' => 'Ⴎ',
|
886 |
+
'ⴏ' => 'Ⴏ',
|
887 |
+
'ⴐ' => 'Ⴐ',
|
888 |
+
'ⴑ' => 'Ⴑ',
|
889 |
+
'ⴒ' => 'Ⴒ',
|
890 |
+
'ⴓ' => 'Ⴓ',
|
891 |
+
'ⴔ' => 'Ⴔ',
|
892 |
+
'ⴕ' => 'Ⴕ',
|
893 |
+
'ⴖ' => 'Ⴖ',
|
894 |
+
'ⴗ' => 'Ⴗ',
|
895 |
+
'ⴘ' => 'Ⴘ',
|
896 |
+
'ⴙ' => 'Ⴙ',
|
897 |
+
'ⴚ' => 'Ⴚ',
|
898 |
+
'ⴛ' => 'Ⴛ',
|
899 |
+
'ⴜ' => 'Ⴜ',
|
900 |
+
'ⴝ' => 'Ⴝ',
|
901 |
+
'ⴞ' => 'Ⴞ',
|
902 |
+
'ⴟ' => 'Ⴟ',
|
903 |
+
'ⴠ' => 'Ⴠ',
|
904 |
+
'ⴡ' => 'Ⴡ',
|
905 |
+
'ⴢ' => 'Ⴢ',
|
906 |
+
'ⴣ' => 'Ⴣ',
|
907 |
+
'ⴤ' => 'Ⴤ',
|
908 |
+
'ⴥ' => 'Ⴥ',
|
909 |
+
'ⴧ' => 'Ⴧ',
|
910 |
+
'ⴭ' => 'Ⴭ',
|
911 |
+
'ꙁ' => 'Ꙁ',
|
912 |
+
'ꙃ' => 'Ꙃ',
|
913 |
+
'ꙅ' => 'Ꙅ',
|
914 |
+
'ꙇ' => 'Ꙇ',
|
915 |
+
'ꙉ' => 'Ꙉ',
|
916 |
+
'ꙋ' => 'Ꙋ',
|
917 |
+
'ꙍ' => 'Ꙍ',
|
918 |
+
'ꙏ' => 'Ꙏ',
|
919 |
+
'ꙑ' => 'Ꙑ',
|
920 |
+
'ꙓ' => 'Ꙓ',
|
921 |
+
'ꙕ' => 'Ꙕ',
|
922 |
+
'ꙗ' => 'Ꙗ',
|
923 |
+
'ꙙ' => 'Ꙙ',
|
924 |
+
'ꙛ' => 'Ꙛ',
|
925 |
+
'ꙝ' => 'Ꙝ',
|
926 |
+
'ꙟ' => 'Ꙟ',
|
927 |
+
'ꙡ' => 'Ꙡ',
|
928 |
+
'ꙣ' => 'Ꙣ',
|
929 |
+
'ꙥ' => 'Ꙥ',
|
930 |
+
'ꙧ' => 'Ꙧ',
|
931 |
+
'ꙩ' => 'Ꙩ',
|
932 |
+
'ꙫ' => 'Ꙫ',
|
933 |
+
'ꙭ' => 'Ꙭ',
|
934 |
+
'ꚁ' => 'Ꚁ',
|
935 |
+
'ꚃ' => 'Ꚃ',
|
936 |
+
'ꚅ' => 'Ꚅ',
|
937 |
+
'ꚇ' => 'Ꚇ',
|
938 |
+
'ꚉ' => 'Ꚉ',
|
939 |
+
'ꚋ' => 'Ꚋ',
|
940 |
+
'ꚍ' => 'Ꚍ',
|
941 |
+
'ꚏ' => 'Ꚏ',
|
942 |
+
'ꚑ' => 'Ꚑ',
|
943 |
+
'ꚓ' => 'Ꚓ',
|
944 |
+
'ꚕ' => 'Ꚕ',
|
945 |
+
'ꚗ' => 'Ꚗ',
|
946 |
+
'ꚙ' => 'Ꚙ',
|
947 |
+
'ꚛ' => 'Ꚛ',
|
948 |
+
'ꜣ' => 'Ꜣ',
|
949 |
+
'ꜥ' => 'Ꜥ',
|
950 |
+
'ꜧ' => 'Ꜧ',
|
951 |
+
'ꜩ' => 'Ꜩ',
|
952 |
+
'ꜫ' => 'Ꜫ',
|
953 |
+
'ꜭ' => 'Ꜭ',
|
954 |
+
'ꜯ' => 'Ꜯ',
|
955 |
+
'ꜳ' => 'Ꜳ',
|
956 |
+
'ꜵ' => 'Ꜵ',
|
957 |
+
'ꜷ' => 'Ꜷ',
|
958 |
+
'ꜹ' => 'Ꜹ',
|
959 |
+
'ꜻ' => 'Ꜻ',
|
960 |
+
'ꜽ' => 'Ꜽ',
|
961 |
+
'ꜿ' => 'Ꜿ',
|
962 |
+
'ꝁ' => 'Ꝁ',
|
963 |
+
'ꝃ' => 'Ꝃ',
|
964 |
+
'ꝅ' => 'Ꝅ',
|
965 |
+
'ꝇ' => 'Ꝇ',
|
966 |
+
'ꝉ' => 'Ꝉ',
|
967 |
+
'ꝋ' => 'Ꝋ',
|
968 |
+
'ꝍ' => 'Ꝍ',
|
969 |
+
'ꝏ' => 'Ꝏ',
|
970 |
+
'ꝑ' => 'Ꝑ',
|
971 |
+
'ꝓ' => 'Ꝓ',
|
972 |
+
'ꝕ' => 'Ꝕ',
|
973 |
+
'ꝗ' => 'Ꝗ',
|
974 |
+
'ꝙ' => 'Ꝙ',
|
975 |
+
'ꝛ' => 'Ꝛ',
|
976 |
+
'ꝝ' => 'Ꝝ',
|
977 |
+
'ꝟ' => 'Ꝟ',
|
978 |
+
'ꝡ' => 'Ꝡ',
|
979 |
+
'ꝣ' => 'Ꝣ',
|
980 |
+
'ꝥ' => 'Ꝥ',
|
981 |
+
'ꝧ' => 'Ꝧ',
|
982 |
+
'ꝩ' => 'Ꝩ',
|
983 |
+
'ꝫ' => 'Ꝫ',
|
984 |
+
'ꝭ' => 'Ꝭ',
|
985 |
+
'ꝯ' => 'Ꝯ',
|
986 |
+
'ꝺ' => 'Ꝺ',
|
987 |
+
'ꝼ' => 'Ꝼ',
|
988 |
+
'ꝿ' => 'Ꝿ',
|
989 |
+
'ꞁ' => 'Ꞁ',
|
990 |
+
'ꞃ' => 'Ꞃ',
|
991 |
+
'ꞅ' => 'Ꞅ',
|
992 |
+
'ꞇ' => 'Ꞇ',
|
993 |
+
'ꞌ' => 'Ꞌ',
|
994 |
+
'ꞑ' => 'Ꞑ',
|
995 |
+
'ꞓ' => 'Ꞓ',
|
996 |
+
'ꞗ' => 'Ꞗ',
|
997 |
+
'ꞙ' => 'Ꞙ',
|
998 |
+
'ꞛ' => 'Ꞛ',
|
999 |
+
'ꞝ' => 'Ꞝ',
|
1000 |
+
'ꞟ' => 'Ꞟ',
|
1001 |
+
'ꞡ' => 'Ꞡ',
|
1002 |
+
'ꞣ' => 'Ꞣ',
|
1003 |
+
'ꞥ' => 'Ꞥ',
|
1004 |
+
'ꞧ' => 'Ꞧ',
|
1005 |
+
'ꞩ' => 'Ꞩ',
|
1006 |
+
'a' => 'A',
|
1007 |
+
'b' => 'B',
|
1008 |
+
'c' => 'C',
|
1009 |
+
'd' => 'D',
|
1010 |
+
'e' => 'E',
|
1011 |
+
'f' => 'F',
|
1012 |
+
'g' => 'G',
|
1013 |
+
'h' => 'H',
|
1014 |
+
'i' => 'I',
|
1015 |
+
'j' => 'J',
|
1016 |
+
'k' => 'K',
|
1017 |
+
'l' => 'L',
|
1018 |
+
'm' => 'M',
|
1019 |
+
'n' => 'N',
|
1020 |
+
'o' => 'O',
|
1021 |
+
'p' => 'P',
|
1022 |
+
'q' => 'Q',
|
1023 |
+
'r' => 'R',
|
1024 |
+
's' => 'S',
|
1025 |
+
't' => 'T',
|
1026 |
+
'u' => 'U',
|
1027 |
+
'v' => 'V',
|
1028 |
+
'w' => 'W',
|
1029 |
+
'x' => 'X',
|
1030 |
+
'y' => 'Y',
|
1031 |
+
'z' => 'Z',
|
1032 |
+
'𐐨' => '𐐀',
|
1033 |
+
'𐐩' => '𐐁',
|
1034 |
+
'𐐪' => '𐐂',
|
1035 |
+
'𐐫' => '𐐃',
|
1036 |
+
'𐐬' => '𐐄',
|
1037 |
+
'𐐭' => '𐐅',
|
1038 |
+
'𐐮' => '𐐆',
|
1039 |
+
'𐐯' => '𐐇',
|
1040 |
+
'𐐰' => '𐐈',
|
1041 |
+
'𐐱' => '𐐉',
|
1042 |
+
'𐐲' => '𐐊',
|
1043 |
+
'𐐳' => '𐐋',
|
1044 |
+
'𐐴' => '𐐌',
|
1045 |
+
'𐐵' => '𐐍',
|
1046 |
+
'𐐶' => '𐐎',
|
1047 |
+
'𐐷' => '𐐏',
|
1048 |
+
'𐐸' => '𐐐',
|
1049 |
+
'𐐹' => '𐐑',
|
1050 |
+
'𐐺' => '𐐒',
|
1051 |
+
'𐐻' => '𐐓',
|
1052 |
+
'𐐼' => '𐐔',
|
1053 |
+
'𐐽' => '𐐕',
|
1054 |
+
'𐐾' => '𐐖',
|
1055 |
+
'𐐿' => '𐐗',
|
1056 |
+
'𐑀' => '𐐘',
|
1057 |
+
'𐑁' => '𐐙',
|
1058 |
+
'𐑂' => '𐐚',
|
1059 |
+
'𐑃' => '𐐛',
|
1060 |
+
'𐑄' => '𐐜',
|
1061 |
+
'𐑅' => '𐐝',
|
1062 |
+
'𐑆' => '𐐞',
|
1063 |
+
'𐑇' => '𐐟',
|
1064 |
+
'𐑈' => '𐐠',
|
1065 |
+
'𐑉' => '𐐡',
|
1066 |
+
'𐑊' => '𐐢',
|
1067 |
+
'𐑋' => '𐐣',
|
1068 |
+
'𐑌' => '𐐤',
|
1069 |
+
'𐑍' => '𐐥',
|
1070 |
+
'𐑎' => '𐐦',
|
1071 |
+
'𐑏' => '𐐧',
|
1072 |
+
'𑣀' => '𑢠',
|
1073 |
+
'𑣁' => '𑢡',
|
1074 |
+
'𑣂' => '𑢢',
|
1075 |
+
'𑣃' => '𑢣',
|
1076 |
+
'𑣄' => '𑢤',
|
1077 |
+
'𑣅' => '𑢥',
|
1078 |
+
'𑣆' => '𑢦',
|
1079 |
+
'𑣇' => '𑢧',
|
1080 |
+
'𑣈' => '𑢨',
|
1081 |
+
'𑣉' => '𑢩',
|
1082 |
+
'𑣊' => '𑢪',
|
1083 |
+
'𑣋' => '𑢫',
|
1084 |
+
'𑣌' => '𑢬',
|
1085 |
+
'𑣍' => '𑢭',
|
1086 |
+
'𑣎' => '𑢮',
|
1087 |
+
'𑣏' => '𑢯',
|
1088 |
+
'𑣐' => '𑢰',
|
1089 |
+
'𑣑' => '𑢱',
|
1090 |
+
'𑣒' => '𑢲',
|
1091 |
+
'𑣓' => '𑢳',
|
1092 |
+
'𑣔' => '𑢴',
|
1093 |
+
'𑣕' => '𑢵',
|
1094 |
+
'𑣖' => '𑢶',
|
1095 |
+
'𑣗' => '𑢷',
|
1096 |
+
'𑣘' => '𑢸',
|
1097 |
+
'𑣙' => '𑢹',
|
1098 |
+
'𑣚' => '𑢺',
|
1099 |
+
'𑣛' => '𑢻',
|
1100 |
+
'𑣜' => '𑢼',
|
1101 |
+
'𑣝' => '𑢽',
|
1102 |
+
'𑣞' => '𑢾',
|
1103 |
+
'𑣟' => '𑢿',
|
1104 |
+
);
|
1105 |
+
|
1106 |
+
$result =& $data;
|
1107 |
+
unset($data);
|
1108 |
+
|
1109 |
+
return $result;
|
src/common/lib/vendor/symfony/polyfill-mbstring/bootstrap.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
use Symfony\Polyfill\Mbstring as p;
|
13 |
+
|
14 |
+
if (!function_exists('mb_strlen')) {
|
15 |
+
define('MB_CASE_UPPER', 0);
|
16 |
+
define('MB_CASE_LOWER', 1);
|
17 |
+
define('MB_CASE_TITLE', 2);
|
18 |
+
|
19 |
+
function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
|
20 |
+
function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); }
|
21 |
+
function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); }
|
22 |
+
function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); }
|
23 |
+
function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); }
|
24 |
+
function mb_language($lang = null) { return p\Mbstring::mb_language($lang); }
|
25 |
+
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
26 |
+
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
27 |
+
function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); }
|
28 |
+
function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); }
|
29 |
+
function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); }
|
30 |
+
function mb_parse_str($s, &$result = array()) { parse_str($s, $result); }
|
31 |
+
function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); }
|
32 |
+
function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); }
|
33 |
+
function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); }
|
34 |
+
function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); }
|
35 |
+
function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); }
|
36 |
+
function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); }
|
37 |
+
function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); }
|
38 |
+
function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); }
|
39 |
+
function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); }
|
40 |
+
function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); }
|
41 |
+
function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); }
|
42 |
+
function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); }
|
43 |
+
function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); }
|
44 |
+
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
45 |
+
function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); }
|
46 |
+
function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); }
|
47 |
+
function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
|
48 |
+
function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
|
49 |
+
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
50 |
+
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
51 |
+
}
|
52 |
+
if (!function_exists('mb_chr')) {
|
53 |
+
function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); }
|
54 |
+
function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); }
|
55 |
+
function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); }
|
56 |
+
}
|
src/common/lib/vendor/symfony/translation/CHANGELOG.md
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CHANGELOG
|
2 |
+
=========
|
3 |
+
|
4 |
+
3.4.0
|
5 |
+
-----
|
6 |
+
|
7 |
+
* Added `TranslationDumperPass`
|
8 |
+
* Added `TranslationExtractorPass`
|
9 |
+
* Added `TranslatorPass`
|
10 |
+
* Added `TranslationReader` and `TranslationReaderInterface`
|
11 |
+
* Added `<notes>` section to the Xliff 2.0 dumper.
|
12 |
+
* Improved Xliff 2.0 loader to load `<notes>` section.
|
13 |
+
* Added `TranslationWriterInterface`
|
14 |
+
* Deprecated `TranslationWriter::writeTranslations` in favor of `TranslationWriter::write`
|
15 |
+
* added support for adding custom message formatter and decoupling the default one.
|
16 |
+
* Added `PhpExtractor`
|
17 |
+
* Added `PhpStringTokenParser`
|
18 |
+
|
19 |
+
3.2.0
|
20 |
+
-----
|
21 |
+
|
22 |
+
* Added support for escaping `|` in plural translations with double pipe.
|
23 |
+
|
24 |
+
3.1.0
|
25 |
+
-----
|
26 |
+
|
27 |
+
* Deprecated the backup feature of the file dumper classes.
|
28 |
+
|
29 |
+
3.0.0
|
30 |
+
-----
|
31 |
+
|
32 |
+
* removed `FileDumper::format()` method.
|
33 |
+
* Changed the visibility of the locale property in `Translator` from protected to private.
|
34 |
+
|
35 |
+
2.8.0
|
36 |
+
-----
|
37 |
+
|
38 |
+
* deprecated FileDumper::format(), overwrite FileDumper::formatCatalogue() instead.
|
39 |
+
* deprecated Translator::getMessages(), rely on TranslatorBagInterface::getCatalogue() instead.
|
40 |
+
* added `FileDumper::formatCatalogue` which allows format the catalogue without dumping it into file.
|
41 |
+
* added option `json_encoding` to JsonFileDumper
|
42 |
+
* added options `as_tree`, `inline` to YamlFileDumper
|
43 |
+
* added support for XLIFF 2.0.
|
44 |
+
* added support for XLIFF target and tool attributes.
|
45 |
+
* added message parameters to DataCollectorTranslator.
|
46 |
+
* [DEPRECATION] The `DiffOperation` class has been deprecated and
|
47 |
+
will be removed in Symfony 3.0, since its operation has nothing to do with 'diff',
|
48 |
+
so the class name is misleading. The `TargetOperation` class should be used for
|
49 |
+
this use-case instead.
|
50 |
+
|
51 |
+
2.7.0
|
52 |
+
-----
|
53 |
+
|
54 |
+
* added DataCollectorTranslator for collecting the translated messages.
|
55 |
+
|
56 |
+
2.6.0
|
57 |
+
-----
|
58 |
+
|
59 |
+
* added possibility to cache catalogues
|
60 |
+
* added TranslatorBagInterface
|
61 |
+
* added LoggingTranslator
|
62 |
+
* added Translator::getMessages() for retrieving the message catalogue as an array
|
63 |
+
|
64 |
+
2.5.0
|
65 |
+
-----
|
66 |
+
|
67 |
+
* added relative file path template to the file dumpers
|
68 |
+
* added optional backup to the file dumpers
|
69 |
+
* changed IcuResFileDumper to extend FileDumper
|
70 |
+
|
71 |
+
2.3.0
|
72 |
+
-----
|
73 |
+
|
74 |
+
* added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues)
|
75 |
+
* added Translator::getFallbackLocales()
|
76 |
+
* deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method
|
77 |
+
|
78 |
+
2.2.0
|
79 |
+
-----
|
80 |
+
|
81 |
+
* QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3.
|
82 |
+
* [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now
|
83 |
+
throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found
|
84 |
+
and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid.
|
85 |
+
* changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException
|
86 |
+
(IcuDatFileLoader, IcuResFileLoader and QtFileLoader)
|
87 |
+
|
88 |
+
2.1.0
|
89 |
+
-----
|
90 |
+
|
91 |
+
* added support for more than one fallback locale
|
92 |
+
* added support for extracting translation messages from templates (Twig and PHP)
|
93 |
+
* added dumpers for translation catalogs
|
94 |
+
* added support for QT, gettext, and ResourceBundles
|
src/common/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Catalogue;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\MessageCatalogueInterface;
|
16 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
17 |
+
use Symfony\Component\Translation\Exception\LogicException;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Base catalogues binary operation class.
|
21 |
+
*
|
22 |
+
* A catalogue binary operation performs operation on
|
23 |
+
* source (the left argument) and target (the right argument) catalogues.
|
24 |
+
*
|
25 |
+
* @author Jean-François Simon <contact@jfsimon.fr>
|
26 |
+
*/
|
27 |
+
abstract class AbstractOperation implements OperationInterface
|
28 |
+
{
|
29 |
+
protected $source;
|
30 |
+
protected $target;
|
31 |
+
protected $result;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var null|array The domains affected by this operation
|
35 |
+
*/
|
36 |
+
private $domains;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* This array stores 'all', 'new' and 'obsolete' messages for all valid domains.
|
40 |
+
*
|
41 |
+
* The data structure of this array is as follows:
|
42 |
+
* ```php
|
43 |
+
* array(
|
44 |
+
* 'domain 1' => array(
|
45 |
+
* 'all' => array(...),
|
46 |
+
* 'new' => array(...),
|
47 |
+
* 'obsolete' => array(...)
|
48 |
+
* ),
|
49 |
+
* 'domain 2' => array(
|
50 |
+
* 'all' => array(...),
|
51 |
+
* 'new' => array(...),
|
52 |
+
* 'obsolete' => array(...)
|
53 |
+
* ),
|
54 |
+
* ...
|
55 |
+
* )
|
56 |
+
* ```
|
57 |
+
*
|
58 |
+
* @var array The array that stores 'all', 'new' and 'obsolete' messages
|
59 |
+
*/
|
60 |
+
protected $messages;
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @throws LogicException
|
64 |
+
*/
|
65 |
+
public function __construct(MessageCatalogueInterface $source, MessageCatalogueInterface $target)
|
66 |
+
{
|
67 |
+
if ($source->getLocale() !== $target->getLocale()) {
|
68 |
+
throw new LogicException('Operated catalogues must belong to the same locale.');
|
69 |
+
}
|
70 |
+
|
71 |
+
$this->source = $source;
|
72 |
+
$this->target = $target;
|
73 |
+
$this->result = new MessageCatalogue($source->getLocale());
|
74 |
+
$this->messages = array();
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* {@inheritdoc}
|
79 |
+
*/
|
80 |
+
public function getDomains()
|
81 |
+
{
|
82 |
+
if (null === $this->domains) {
|
83 |
+
$this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains())));
|
84 |
+
}
|
85 |
+
|
86 |
+
return $this->domains;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* {@inheritdoc}
|
91 |
+
*/
|
92 |
+
public function getMessages($domain)
|
93 |
+
{
|
94 |
+
if (!in_array($domain, $this->getDomains())) {
|
95 |
+
throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
|
96 |
+
}
|
97 |
+
|
98 |
+
if (!isset($this->messages[$domain]['all'])) {
|
99 |
+
$this->processDomain($domain);
|
100 |
+
}
|
101 |
+
|
102 |
+
return $this->messages[$domain]['all'];
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* {@inheritdoc}
|
107 |
+
*/
|
108 |
+
public function getNewMessages($domain)
|
109 |
+
{
|
110 |
+
if (!in_array($domain, $this->getDomains())) {
|
111 |
+
throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
|
112 |
+
}
|
113 |
+
|
114 |
+
if (!isset($this->messages[$domain]['new'])) {
|
115 |
+
$this->processDomain($domain);
|
116 |
+
}
|
117 |
+
|
118 |
+
return $this->messages[$domain]['new'];
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* {@inheritdoc}
|
123 |
+
*/
|
124 |
+
public function getObsoleteMessages($domain)
|
125 |
+
{
|
126 |
+
if (!in_array($domain, $this->getDomains())) {
|
127 |
+
throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
|
128 |
+
}
|
129 |
+
|
130 |
+
if (!isset($this->messages[$domain]['obsolete'])) {
|
131 |
+
$this->processDomain($domain);
|
132 |
+
}
|
133 |
+
|
134 |
+
return $this->messages[$domain]['obsolete'];
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* {@inheritdoc}
|
139 |
+
*/
|
140 |
+
public function getResult()
|
141 |
+
{
|
142 |
+
foreach ($this->getDomains() as $domain) {
|
143 |
+
if (!isset($this->messages[$domain])) {
|
144 |
+
$this->processDomain($domain);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
return $this->result;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Performs operation on source and target catalogues for the given domain and
|
153 |
+
* stores the results.
|
154 |
+
*
|
155 |
+
* @param string $domain The domain which the operation will be performed for
|
156 |
+
*/
|
157 |
+
abstract protected function processDomain($domain);
|
158 |
+
}
|
src/common/lib/vendor/symfony/translation/Catalogue/MergeOperation.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Catalogue;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Merge operation between two catalogues as follows:
|
16 |
+
* all = source ∪ target = {x: x ∈ source ∨ x ∈ target}
|
17 |
+
* new = all ∖ source = {x: x ∈ target ∧ x ∉ source}
|
18 |
+
* obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅
|
19 |
+
* Basically, the result contains messages from both catalogues.
|
20 |
+
*
|
21 |
+
* @author Jean-François Simon <contact@jfsimon.fr>
|
22 |
+
*/
|
23 |
+
class MergeOperation extends AbstractOperation
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* {@inheritdoc}
|
27 |
+
*/
|
28 |
+
protected function processDomain($domain)
|
29 |
+
{
|
30 |
+
$this->messages[$domain] = array(
|
31 |
+
'all' => array(),
|
32 |
+
'new' => array(),
|
33 |
+
'obsolete' => array(),
|
34 |
+
);
|
35 |
+
|
36 |
+
foreach ($this->source->all($domain) as $id => $message) {
|
37 |
+
$this->messages[$domain]['all'][$id] = $message;
|
38 |
+
$this->result->add(array($id => $message), $domain);
|
39 |
+
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
|
40 |
+
$this->result->setMetadata($id, $keyMetadata, $domain);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
foreach ($this->target->all($domain) as $id => $message) {
|
45 |
+
if (!$this->source->has($id, $domain)) {
|
46 |
+
$this->messages[$domain]['all'][$id] = $message;
|
47 |
+
$this->messages[$domain]['new'][$id] = $message;
|
48 |
+
$this->result->add(array($id => $message), $domain);
|
49 |
+
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
|
50 |
+
$this->result->setMetadata($id, $keyMetadata, $domain);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
src/common/lib/vendor/symfony/translation/Catalogue/OperationInterface.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Catalogue;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogueInterface;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Represents an operation on catalogue(s).
|
18 |
+
*
|
19 |
+
* An instance of this interface performs an operation on one or more catalogues and
|
20 |
+
* stores intermediate and final results of the operation.
|
21 |
+
*
|
22 |
+
* The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and
|
23 |
+
* the following results are stored:
|
24 |
+
*
|
25 |
+
* Messages: also called 'all', are valid messages for the given domain after the operation is performed.
|
26 |
+
*
|
27 |
+
* New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}).
|
28 |
+
*
|
29 |
+
* Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}).
|
30 |
+
*
|
31 |
+
* Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'.
|
32 |
+
*
|
33 |
+
* @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
|
34 |
+
*/
|
35 |
+
interface OperationInterface
|
36 |
+
{
|
37 |
+
/**
|
38 |
+
* Returns domains affected by operation.
|
39 |
+
*
|
40 |
+
* @return array
|
41 |
+
*/
|
42 |
+
public function getDomains();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Returns all valid messages ('all') after operation.
|
46 |
+
*
|
47 |
+
* @param string $domain
|
48 |
+
*
|
49 |
+
* @return array
|
50 |
+
*/
|
51 |
+
public function getMessages($domain);
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Returns new messages ('new') after operation.
|
55 |
+
*
|
56 |
+
* @param string $domain
|
57 |
+
*
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
+
public function getNewMessages($domain);
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Returns obsolete messages ('obsolete') after operation.
|
64 |
+
*
|
65 |
+
* @param string $domain
|
66 |
+
*
|
67 |
+
* @return array
|
68 |
+
*/
|
69 |
+
public function getObsoleteMessages($domain);
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Returns resulting catalogue ('result').
|
73 |
+
*
|
74 |
+
* @return MessageCatalogueInterface
|
75 |
+
*/
|
76 |
+
public function getResult();
|
77 |
+
}
|
src/common/lib/vendor/symfony/translation/Catalogue/TargetOperation.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Catalogue;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Target operation between two catalogues:
|
16 |
+
* intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target}
|
17 |
+
* all = intersection ∪ (target ∖ intersection) = target
|
18 |
+
* new = all ∖ source = {x: x ∈ target ∧ x ∉ source}
|
19 |
+
* obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target}
|
20 |
+
* Basically, the result contains messages from the target catalogue.
|
21 |
+
*
|
22 |
+
* @author Michael Lee <michael.lee@zerustech.com>
|
23 |
+
*/
|
24 |
+
class TargetOperation extends AbstractOperation
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
protected function processDomain($domain)
|
30 |
+
{
|
31 |
+
$this->messages[$domain] = array(
|
32 |
+
'all' => array(),
|
33 |
+
'new' => array(),
|
34 |
+
'obsolete' => array(),
|
35 |
+
);
|
36 |
+
|
37 |
+
// For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``,
|
38 |
+
// because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
39 |
+
//
|
40 |
+
// For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));``
|
41 |
+
// because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback}
|
42 |
+
//
|
43 |
+
// For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))``
|
44 |
+
// because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
45 |
+
|
46 |
+
foreach ($this->source->all($domain) as $id => $message) {
|
47 |
+
if ($this->target->has($id, $domain)) {
|
48 |
+
$this->messages[$domain]['all'][$id] = $message;
|
49 |
+
$this->result->add(array($id => $message), $domain);
|
50 |
+
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
|
51 |
+
$this->result->setMetadata($id, $keyMetadata, $domain);
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
$this->messages[$domain]['obsolete'][$id] = $message;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
foreach ($this->target->all($domain) as $id => $message) {
|
59 |
+
if (!$this->source->has($id, $domain)) {
|
60 |
+
$this->messages[$domain]['all'][$id] = $message;
|
61 |
+
$this->messages[$domain]['new'][$id] = $message;
|
62 |
+
$this->result->add(array($id => $message), $domain);
|
63 |
+
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
|
64 |
+
$this->result->setMetadata($id, $keyMetadata, $domain);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
src/common/lib/vendor/symfony/translation/Command/XliffLintCommand.php
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Command;
|
13 |
+
|
14 |
+
use Symfony\Component\Console\Command\Command;
|
15 |
+
use Symfony\Component\Console\Input\InputInterface;
|
16 |
+
use Symfony\Component\Console\Input\InputOption;
|
17 |
+
use Symfony\Component\Console\Output\OutputInterface;
|
18 |
+
use Symfony\Component\Console\Style\SymfonyStyle;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Validates XLIFF files syntax and outputs encountered errors.
|
22 |
+
*
|
23 |
+
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
24 |
+
* @author Robin Chalas <robin.chalas@gmail.com>
|
25 |
+
* @author Javier Eguiluz <javier.eguiluz@gmail.com>
|
26 |
+
*/
|
27 |
+
class XliffLintCommand extends Command
|
28 |
+
{
|
29 |
+
protected static $defaultName = 'lint:xliff';
|
30 |
+
|
31 |
+
private $format;
|
32 |
+
private $displayCorrectFiles;
|
33 |
+
private $directoryIteratorProvider;
|
34 |
+
private $isReadableProvider;
|
35 |
+
|
36 |
+
public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
|
37 |
+
{
|
38 |
+
parent::__construct($name);
|
39 |
+
|
40 |
+
$this->directoryIteratorProvider = $directoryIteratorProvider;
|
41 |
+
$this->isReadableProvider = $isReadableProvider;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* {@inheritdoc}
|
46 |
+
*/
|
47 |
+
protected function configure()
|
48 |
+
{
|
49 |
+
$this
|
50 |
+
->setDescription('Lints a XLIFF file and outputs encountered errors')
|
51 |
+
->addArgument('filename', null, 'A file or a directory or STDIN')
|
52 |
+
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
|
53 |
+
->setHelp(<<<EOF
|
54 |
+
The <info>%command.name%</info> command lints a XLIFF file and outputs to STDOUT
|
55 |
+
the first encountered syntax error.
|
56 |
+
|
57 |
+
You can validates XLIFF contents passed from STDIN:
|
58 |
+
|
59 |
+
<info>cat filename | php %command.full_name%</info>
|
60 |
+
|
61 |
+
You can also validate the syntax of a file:
|
62 |
+
|
63 |
+
<info>php %command.full_name% filename</info>
|
64 |
+
|
65 |
+
Or of a whole directory:
|
66 |
+
|
67 |
+
<info>php %command.full_name% dirname</info>
|
68 |
+
<info>php %command.full_name% dirname --format=json</info>
|
69 |
+
|
70 |
+
EOF
|
71 |
+
)
|
72 |
+
;
|
73 |
+
}
|
74 |
+
|
75 |
+
protected function execute(InputInterface $input, OutputInterface $output)
|
76 |
+
{
|
77 |
+
$io = new SymfonyStyle($input, $output);
|
78 |
+
$filename = $input->getArgument('filename');
|
79 |
+
$this->format = $input->getOption('format');
|
80 |
+
$this->displayCorrectFiles = $output->isVerbose();
|
81 |
+
|
82 |
+
if (!$filename) {
|
83 |
+
if (!$stdin = $this->getStdin()) {
|
84 |
+
throw new \RuntimeException('Please provide a filename or pipe file content to STDIN.');
|
85 |
+
}
|
86 |
+
|
87 |
+
return $this->display($io, array($this->validate($stdin)));
|
88 |
+
}
|
89 |
+
|
90 |
+
if (!$this->isReadable($filename)) {
|
91 |
+
throw new \RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
|
92 |
+
}
|
93 |
+
|
94 |
+
$filesInfo = array();
|
95 |
+
foreach ($this->getFiles($filename) as $file) {
|
96 |
+
$filesInfo[] = $this->validate(file_get_contents($file), $file);
|
97 |
+
}
|
98 |
+
|
99 |
+
return $this->display($io, $filesInfo);
|
100 |
+
}
|
101 |
+
|
102 |
+
private function validate($content, $file = null)
|
103 |
+
{
|
104 |
+
// Avoid: Warning DOMDocument::loadXML(): Empty string supplied as input
|
105 |
+
if ('' === trim($content)) {
|
106 |
+
return array('file' => $file, 'valid' => true);
|
107 |
+
}
|
108 |
+
|
109 |
+
libxml_use_internal_errors(true);
|
110 |
+
|
111 |
+
$document = new \DOMDocument();
|
112 |
+
$document->loadXML($content);
|
113 |
+
if ($document->schemaValidate(__DIR__.'/../Resources/schemas/xliff-core-1.2-strict.xsd')) {
|
114 |
+
return array('file' => $file, 'valid' => true);
|
115 |
+
}
|
116 |
+
|
117 |
+
$errorMessages = array_map(function ($error) {
|
118 |
+
return array(
|
119 |
+
'line' => $error->line,
|
120 |
+
'column' => $error->column,
|
121 |
+
'message' => trim($error->message),
|
122 |
+
);
|
123 |
+
}, libxml_get_errors());
|
124 |
+
|
125 |
+
libxml_clear_errors();
|
126 |
+
libxml_use_internal_errors(false);
|
127 |
+
|
128 |
+
return array('file' => $file, 'valid' => false, 'messages' => $errorMessages);
|
129 |
+
}
|
130 |
+
|
131 |
+
private function display(SymfonyStyle $io, array $files)
|
132 |
+
{
|
133 |
+
switch ($this->format) {
|
134 |
+
case 'txt':
|
135 |
+
return $this->displayTxt($io, $files);
|
136 |
+
case 'json':
|
137 |
+
return $this->displayJson($io, $files);
|
138 |
+
default:
|
139 |
+
throw new \InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format));
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
private function displayTxt(SymfonyStyle $io, array $filesInfo)
|
144 |
+
{
|
145 |
+
$countFiles = count($filesInfo);
|
146 |
+
$erroredFiles = 0;
|
147 |
+
|
148 |
+
foreach ($filesInfo as $info) {
|
149 |
+
if ($info['valid'] && $this->displayCorrectFiles) {
|
150 |
+
$io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
151 |
+
} elseif (!$info['valid']) {
|
152 |
+
++$erroredFiles;
|
153 |
+
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
154 |
+
$io->listing(array_map(function ($error) {
|
155 |
+
// general document errors have a '-1' line number
|
156 |
+
return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']);
|
157 |
+
}, $info['messages']));
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
if (0 === $erroredFiles) {
|
162 |
+
$io->success(sprintf('All %d XLIFF files contain valid syntax.', $countFiles));
|
163 |
+
} else {
|
164 |
+
$io->warning(sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles));
|
165 |
+
}
|
166 |
+
|
167 |
+
return min($erroredFiles, 1);
|
168 |
+
}
|
169 |
+
|
170 |
+
private function displayJson(SymfonyStyle $io, array $filesInfo)
|
171 |
+
{
|
172 |
+
$errors = 0;
|
173 |
+
|
174 |
+
array_walk($filesInfo, function (&$v) use (&$errors) {
|
175 |
+
$v['file'] = (string) $v['file'];
|
176 |
+
if (!$v['valid']) {
|
177 |
+
++$errors;
|
178 |
+
}
|
179 |
+
});
|
180 |
+
|
181 |
+
$io->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
182 |
+
|
183 |
+
return min($errors, 1);
|
184 |
+
}
|
185 |
+
|
186 |
+
private function getFiles($fileOrDirectory)
|
187 |
+
{
|
188 |
+
if (is_file($fileOrDirectory)) {
|
189 |
+
yield new \SplFileInfo($fileOrDirectory);
|
190 |
+
|
191 |
+
return;
|
192 |
+
}
|
193 |
+
|
194 |
+
foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) {
|
195 |
+
if (!in_array($file->getExtension(), array('xlf', 'xliff'))) {
|
196 |
+
continue;
|
197 |
+
}
|
198 |
+
|
199 |
+
yield $file;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
private function getStdin()
|
204 |
+
{
|
205 |
+
if (0 !== ftell(STDIN)) {
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
|
209 |
+
$inputs = '';
|
210 |
+
while (!feof(STDIN)) {
|
211 |
+
$inputs .= fread(STDIN, 1024);
|
212 |
+
}
|
213 |
+
|
214 |
+
return $inputs;
|
215 |
+
}
|
216 |
+
|
217 |
+
private function getDirectoryIterator($directory)
|
218 |
+
{
|
219 |
+
$default = function ($directory) {
|
220 |
+
return new \RecursiveIteratorIterator(
|
221 |
+
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
|
222 |
+
\RecursiveIteratorIterator::LEAVES_ONLY
|
223 |
+
);
|
224 |
+
};
|
225 |
+
|
226 |
+
if (null !== $this->directoryIteratorProvider) {
|
227 |
+
return call_user_func($this->directoryIteratorProvider, $directory, $default);
|
228 |
+
}
|
229 |
+
|
230 |
+
return $default($directory);
|
231 |
+
}
|
232 |
+
|
233 |
+
private function isReadable($fileOrDirectory)
|
234 |
+
{
|
235 |
+
$default = function ($fileOrDirectory) {
|
236 |
+
return is_readable($fileOrDirectory);
|
237 |
+
};
|
238 |
+
|
239 |
+
if (null !== $this->isReadableProvider) {
|
240 |
+
return call_user_func($this->isReadableProvider, $fileOrDirectory, $default);
|
241 |
+
}
|
242 |
+
|
243 |
+
return $default($fileOrDirectory);
|
244 |
+
}
|
245 |
+
}
|
src/common/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\DataCollector;
|
13 |
+
|
14 |
+
use Symfony\Component\HttpFoundation\Request;
|
15 |
+
use Symfony\Component\HttpFoundation\Response;
|
16 |
+
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
|
17 |
+
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
|
18 |
+
use Symfony\Component\Translation\DataCollectorTranslator;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
22 |
+
*/
|
23 |
+
class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface
|
24 |
+
{
|
25 |
+
private $translator;
|
26 |
+
|
27 |
+
public function __construct(DataCollectorTranslator $translator)
|
28 |
+
{
|
29 |
+
$this->translator = $translator;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* {@inheritdoc}
|
34 |
+
*/
|
35 |
+
public function lateCollect()
|
36 |
+
{
|
37 |
+
$messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages());
|
38 |
+
|
39 |
+
$this->data = $this->computeCount($messages);
|
40 |
+
$this->data['messages'] = $messages;
|
41 |
+
|
42 |
+
$this->data['locale'] = $this->translator->getLocale();
|
43 |
+
$this->data['fallback_locales'] = $this->translator->getFallbackLocales();
|
44 |
+
|
45 |
+
$this->data = $this->cloneVar($this->data);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* {@inheritdoc}
|
50 |
+
*/
|
51 |
+
public function collect(Request $request, Response $response, \Exception $exception = null)
|
52 |
+
{
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* {@inheritdoc}
|
57 |
+
*/
|
58 |
+
public function reset()
|
59 |
+
{
|
60 |
+
$this->data = array();
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @return array
|
65 |
+
*/
|
66 |
+
public function getMessages()
|
67 |
+
{
|
68 |
+
return isset($this->data['messages']) ? $this->data['messages'] : array();
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @return int
|
73 |
+
*/
|
74 |
+
public function getCountMissings()
|
75 |
+
{
|
76 |
+
return isset($this->data[DataCollectorTranslator::MESSAGE_MISSING]) ? $this->data[DataCollectorTranslator::MESSAGE_MISSING] : 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @return int
|
81 |
+
*/
|
82 |
+
public function getCountFallbacks()
|
83 |
+
{
|
84 |
+
return isset($this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK]) ? $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] : 0;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @return int
|
89 |
+
*/
|
90 |
+
public function getCountDefines()
|
91 |
+
{
|
92 |
+
return isset($this->data[DataCollectorTranslator::MESSAGE_DEFINED]) ? $this->data[DataCollectorTranslator::MESSAGE_DEFINED] : 0;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function getLocale()
|
96 |
+
{
|
97 |
+
return !empty($this->data['locale']) ? $this->data['locale'] : null;
|
98 |
+
}
|
99 |
+
|
100 |
+
public function getFallbackLocales()
|
101 |
+
{
|
102 |
+
return (isset($this->data['fallback_locales']) && count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : array();
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* {@inheritdoc}
|
107 |
+
*/
|
108 |
+
public function getName()
|
109 |
+
{
|
110 |
+
return 'translation';
|
111 |
+
}
|
112 |
+
|
113 |
+
private function sanitizeCollectedMessages($messages)
|
114 |
+
{
|
115 |
+
$result = array();
|
116 |
+
foreach ($messages as $key => $message) {
|
117 |
+
$messageId = $message['locale'].$message['domain'].$message['id'];
|
118 |
+
|
119 |
+
if (!isset($result[$messageId])) {
|
120 |
+
$message['count'] = 1;
|
121 |
+
$message['parameters'] = !empty($message['parameters']) ? array($message['parameters']) : array();
|
122 |
+
$messages[$key]['translation'] = $this->sanitizeString($message['translation']);
|
123 |
+
$result[$messageId] = $message;
|
124 |
+
} else {
|
125 |
+
if (!empty($message['parameters'])) {
|
126 |
+
$result[$messageId]['parameters'][] = $message['parameters'];
|
127 |
+
}
|
128 |
+
|
129 |
+
++$result[$messageId]['count'];
|
130 |
+
}
|
131 |
+
|
132 |
+
unset($messages[$key]);
|
133 |
+
}
|
134 |
+
|
135 |
+
return $result;
|
136 |
+
}
|
137 |
+
|
138 |
+
private function computeCount($messages)
|
139 |
+
{
|
140 |
+
$count = array(
|
141 |
+
DataCollectorTranslator::MESSAGE_DEFINED => 0,
|
142 |
+
DataCollectorTranslator::MESSAGE_MISSING => 0,
|
143 |
+
DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK => 0,
|
144 |
+
);
|
145 |
+
|
146 |
+
foreach ($messages as $message) {
|
147 |
+
++$count[$message['state']];
|
148 |
+
}
|
149 |
+
|
150 |
+
return $count;
|
151 |
+
}
|
152 |
+
|
153 |
+
private function sanitizeString($string, $length = 80)
|
154 |
+
{
|
155 |
+
$string = trim(preg_replace('/\s+/', ' ', $string));
|
156 |
+
|
157 |
+
if (false !== $encoding = mb_detect_encoding($string, null, true)) {
|
158 |
+
if (mb_strlen($string, $encoding) > $length) {
|
159 |
+
return mb_substr($string, 0, $length - 3, $encoding).'...';
|
160 |
+
}
|
161 |
+
} elseif (strlen($string) > $length) {
|
162 |
+
return substr($string, 0, $length - 3).'...';
|
163 |
+
}
|
164 |
+
|
165 |
+
return $string;
|
166 |
+
}
|
167 |
+
}
|
src/common/lib/vendor/symfony/translation/DataCollectorTranslator.php
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
18 |
+
*/
|
19 |
+
class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface
|
20 |
+
{
|
21 |
+
const MESSAGE_DEFINED = 0;
|
22 |
+
const MESSAGE_MISSING = 1;
|
23 |
+
const MESSAGE_EQUALS_FALLBACK = 2;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var TranslatorInterface|TranslatorBagInterface
|
27 |
+
*/
|
28 |
+
private $translator;
|
29 |
+
|
30 |
+
private $messages = array();
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
|
34 |
+
*/
|
35 |
+
public function __construct(TranslatorInterface $translator)
|
36 |
+
{
|
37 |
+
if (!$translator instanceof TranslatorBagInterface) {
|
38 |
+
throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
|
39 |
+
}
|
40 |
+
|
41 |
+
$this->translator = $translator;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* {@inheritdoc}
|
46 |
+
*/
|
47 |
+
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
|
48 |
+
{
|
49 |
+
$trans = $this->translator->trans($id, $parameters, $domain, $locale);
|
50 |
+
$this->collectMessage($locale, $domain, $id, $trans, $parameters);
|
51 |
+
|
52 |
+
return $trans;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* {@inheritdoc}
|
57 |
+
*/
|
58 |
+
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
|
59 |
+
{
|
60 |
+
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
|
61 |
+
$this->collectMessage($locale, $domain, $id, $trans, $parameters, $number);
|
62 |
+
|
63 |
+
return $trans;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* {@inheritdoc}
|
68 |
+
*/
|
69 |
+
public function setLocale($locale)
|
70 |
+
{
|
71 |
+
$this->translator->setLocale($locale);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* {@inheritdoc}
|
76 |
+
*/
|
77 |
+
public function getLocale()
|
78 |
+
{
|
79 |
+
return $this->translator->getLocale();
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* {@inheritdoc}
|
84 |
+
*/
|
85 |
+
public function getCatalogue($locale = null)
|
86 |
+
{
|
87 |
+
return $this->translator->getCatalogue($locale);
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Gets the fallback locales.
|
92 |
+
*
|
93 |
+
* @return array $locales The fallback locales
|
94 |
+
*/
|
95 |
+
public function getFallbackLocales()
|
96 |
+
{
|
97 |
+
if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
|
98 |
+
return $this->translator->getFallbackLocales();
|
99 |
+
}
|
100 |
+
|
101 |
+
return array();
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Passes through all unknown calls onto the translator object.
|
106 |
+
*/
|
107 |
+
public function __call($method, $args)
|
108 |
+
{
|
109 |
+
return call_user_func_array(array($this->translator, $method), $args);
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* @return array
|
114 |
+
*/
|
115 |
+
public function getCollectedMessages()
|
116 |
+
{
|
117 |
+
return $this->messages;
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @param string|null $locale
|
122 |
+
* @param string|null $domain
|
123 |
+
* @param string $id
|
124 |
+
* @param string $translation
|
125 |
+
* @param array|null $parameters
|
126 |
+
* @param int|null $number
|
127 |
+
*/
|
128 |
+
private function collectMessage($locale, $domain, $id, $translation, $parameters = array(), $number = null)
|
129 |
+
{
|
130 |
+
if (null === $domain) {
|
131 |
+
$domain = 'messages';
|
132 |
+
}
|
133 |
+
|
134 |
+
$id = (string) $id;
|
135 |
+
$catalogue = $this->translator->getCatalogue($locale);
|
136 |
+
$locale = $catalogue->getLocale();
|
137 |
+
if ($catalogue->defines($id, $domain)) {
|
138 |
+
$state = self::MESSAGE_DEFINED;
|
139 |
+
} elseif ($catalogue->has($id, $domain)) {
|
140 |
+
$state = self::MESSAGE_EQUALS_FALLBACK;
|
141 |
+
|
142 |
+
$fallbackCatalogue = $catalogue->getFallbackCatalogue();
|
143 |
+
while ($fallbackCatalogue) {
|
144 |
+
if ($fallbackCatalogue->defines($id, $domain)) {
|
145 |
+
$locale = $fallbackCatalogue->getLocale();
|
146 |
+
break;
|
147 |
+
}
|
148 |
+
|
149 |
+
$fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue();
|
150 |
+
}
|
151 |
+
} else {
|
152 |
+
$state = self::MESSAGE_MISSING;
|
153 |
+
}
|
154 |
+
|
155 |
+
$this->messages[] = array(
|
156 |
+
'locale' => $locale,
|
157 |
+
'domain' => $domain,
|
158 |
+
'id' => $id,
|
159 |
+
'translation' => $translation,
|
160 |
+
'parameters' => $parameters,
|
161 |
+
'transChoiceNumber' => $number,
|
162 |
+
'state' => $state,
|
163 |
+
);
|
164 |
+
}
|
165 |
+
}
|
src/common/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\DependencyInjection;
|
13 |
+
|
14 |
+
use Symfony\Component\DependencyInjection\Reference;
|
15 |
+
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 |
+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Adds tagged translation.formatter services to translation writer.
|
20 |
+
*/
|
21 |
+
class TranslationDumperPass implements CompilerPassInterface
|
22 |
+
{
|
23 |
+
private $writerServiceId;
|
24 |
+
private $dumperTag;
|
25 |
+
|
26 |
+
public function __construct($writerServiceId = 'translation.writer', $dumperTag = 'translation.dumper')
|
27 |
+
{
|
28 |
+
$this->writerServiceId = $writerServiceId;
|
29 |
+
$this->dumperTag = $dumperTag;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function process(ContainerBuilder $container)
|
33 |
+
{
|
34 |
+
if (!$container->hasDefinition($this->writerServiceId)) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
$definition = $container->getDefinition($this->writerServiceId);
|
39 |
+
|
40 |
+
foreach ($container->findTaggedServiceIds($this->dumperTag, true) as $id => $attributes) {
|
41 |
+
$definition->addMethodCall('addDumper', array($attributes[0]['alias'], new Reference($id)));
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
src/common/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\DependencyInjection;
|
13 |
+
|
14 |
+
use Symfony\Component\DependencyInjection\Reference;
|
15 |
+
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 |
+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
17 |
+
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Adds tagged translation.extractor services to translation extractor.
|
21 |
+
*/
|
22 |
+
class TranslationExtractorPass implements CompilerPassInterface
|
23 |
+
{
|
24 |
+
private $extractorServiceId;
|
25 |
+
private $extractorTag;
|
26 |
+
|
27 |
+
public function __construct($extractorServiceId = 'translation.extractor', $extractorTag = 'translation.extractor')
|
28 |
+
{
|
29 |
+
$this->extractorServiceId = $extractorServiceId;
|
30 |
+
$this->extractorTag = $extractorTag;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function process(ContainerBuilder $container)
|
34 |
+
{
|
35 |
+
if (!$container->hasDefinition($this->extractorServiceId)) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
|
39 |
+
$definition = $container->getDefinition($this->extractorServiceId);
|
40 |
+
|
41 |
+
foreach ($container->findTaggedServiceIds($this->extractorTag, true) as $id => $attributes) {
|
42 |
+
if (!isset($attributes[0]['alias'])) {
|
43 |
+
throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id));
|
44 |
+
}
|
45 |
+
|
46 |
+
$definition->addMethodCall('addExtractor', array($attributes[0]['alias'], new Reference($id)));
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
src/common/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\DependencyInjection;
|
13 |
+
|
14 |
+
use Symfony\Component\DependencyInjection\Reference;
|
15 |
+
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 |
+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
17 |
+
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
|
18 |
+
|
19 |
+
class TranslatorPass implements CompilerPassInterface
|
20 |
+
{
|
21 |
+
private $translatorServiceId;
|
22 |
+
private $readerServiceId;
|
23 |
+
private $loaderTag;
|
24 |
+
private $debugCommandServiceId;
|
25 |
+
private $updateCommandServiceId;
|
26 |
+
|
27 |
+
public function __construct($translatorServiceId = 'translator.default', $readerServiceId = 'translation.loader', $loaderTag = 'translation.loader', $debugCommandServiceId = 'console.command.translation_debug', $updateCommandServiceId = 'console.command.translation_update')
|
28 |
+
{
|
29 |
+
if ('translation.loader' === $readerServiceId && 2 > func_num_args()) {
|
30 |
+
@trigger_error('The default value for $readerServiceId will change in 4.0 to "translation.reader".', E_USER_DEPRECATED);
|
31 |
+
}
|
32 |
+
|
33 |
+
$this->translatorServiceId = $translatorServiceId;
|
34 |
+
$this->readerServiceId = $readerServiceId;
|
35 |
+
$this->loaderTag = $loaderTag;
|
36 |
+
$this->debugCommandServiceId = $debugCommandServiceId;
|
37 |
+
$this->updateCommandServiceId = $updateCommandServiceId;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function process(ContainerBuilder $container)
|
41 |
+
{
|
42 |
+
if (!$container->hasDefinition($this->translatorServiceId)) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
$loaders = array();
|
47 |
+
$loaderRefs = array();
|
48 |
+
foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) {
|
49 |
+
$loaderRefs[$id] = new Reference($id);
|
50 |
+
$loaders[$id][] = $attributes[0]['alias'];
|
51 |
+
if (isset($attributes[0]['legacy-alias'])) {
|
52 |
+
$loaders[$id][] = $attributes[0]['legacy-alias'];
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if ($container->hasDefinition($this->readerServiceId)) {
|
57 |
+
$definition = $container->getDefinition($this->readerServiceId);
|
58 |
+
foreach ($loaders as $id => $formats) {
|
59 |
+
foreach ($formats as $format) {
|
60 |
+
$definition->addMethodCall('addLoader', array($format, $loaderRefs[$id]));
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
// Duplicated code to support "translation.reader", to be removed in 4.0
|
66 |
+
if ('translation.reader' !== $this->readerServiceId) {
|
67 |
+
if ($container->hasDefinition('translation.reader')) {
|
68 |
+
$definition = $container->getDefinition('translation.reader');
|
69 |
+
foreach ($loaders as $id => $formats) {
|
70 |
+
foreach ($formats as $format) {
|
71 |
+
$definition->addMethodCall('addLoader', array($format, $loaderRefs[$id]));
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
$container
|
78 |
+
->findDefinition($this->translatorServiceId)
|
79 |
+
->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs))
|
80 |
+
->replaceArgument(3, $loaders)
|
81 |
+
;
|
82 |
+
|
83 |
+
if (!$container->hasParameter('twig.default_path')) {
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
if ($container->hasDefinition($this->debugCommandServiceId)) {
|
88 |
+
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
|
89 |
+
}
|
90 |
+
|
91 |
+
if ($container->hasDefinition($this->updateCommandServiceId)) {
|
92 |
+
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* CsvFileDumper generates a csv formatted string representation of a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Stealth35
|
20 |
+
*/
|
21 |
+
class CsvFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
private $delimiter = ';';
|
24 |
+
private $enclosure = '"';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
30 |
+
{
|
31 |
+
$handle = fopen('php://memory', 'rb+');
|
32 |
+
|
33 |
+
foreach ($messages->all($domain) as $source => $target) {
|
34 |
+
fputcsv($handle, array($source, $target), $this->delimiter, $this->enclosure);
|
35 |
+
}
|
36 |
+
|
37 |
+
rewind($handle);
|
38 |
+
$output = stream_get_contents($handle);
|
39 |
+
fclose($handle);
|
40 |
+
|
41 |
+
return $output;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Sets the delimiter and escape character for CSV.
|
46 |
+
*
|
47 |
+
* @param string $delimiter Delimiter character
|
48 |
+
* @param string $enclosure Enclosure character
|
49 |
+
*/
|
50 |
+
public function setCsvControl($delimiter = ';', $enclosure = '"')
|
51 |
+
{
|
52 |
+
$this->delimiter = $delimiter;
|
53 |
+
$this->enclosure = $enclosure;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* {@inheritdoc}
|
58 |
+
*/
|
59 |
+
protected function getExtension()
|
60 |
+
{
|
61 |
+
return 'csv';
|
62 |
+
}
|
63 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/DumperInterface.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* DumperInterface is the interface implemented by all translation dumpers.
|
18 |
+
* There is no common option.
|
19 |
+
*
|
20 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
21 |
+
*/
|
22 |
+
interface DumperInterface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Dumps the message catalogue.
|
26 |
+
*
|
27 |
+
* @param MessageCatalogue $messages The message catalogue
|
28 |
+
* @param array $options Options that are used by the dumper
|
29 |
+
*/
|
30 |
+
public function dump(MessageCatalogue $messages, $options = array());
|
31 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/FileDumper.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
16 |
+
use Symfony\Component\Translation\Exception\RuntimeException;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s).
|
20 |
+
* Performs backup of already existing files.
|
21 |
+
*
|
22 |
+
* Options:
|
23 |
+
* - path (mandatory): the directory where the files should be saved
|
24 |
+
*
|
25 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
26 |
+
*/
|
27 |
+
abstract class FileDumper implements DumperInterface
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* A template for the relative paths to files.
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
protected $relativePathTemplate = '%domain%.%locale%.%extension%';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Make file backup before the dump.
|
38 |
+
*
|
39 |
+
* @var bool
|
40 |
+
*/
|
41 |
+
private $backup = true;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Sets the template for the relative paths to files.
|
45 |
+
*
|
46 |
+
* @param string $relativePathTemplate A template for the relative paths to files
|
47 |
+
*/
|
48 |
+
public function setRelativePathTemplate($relativePathTemplate)
|
49 |
+
{
|
50 |
+
$this->relativePathTemplate = $relativePathTemplate;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Sets backup flag.
|
55 |
+
*
|
56 |
+
* @param bool
|
57 |
+
*/
|
58 |
+
public function setBackup($backup)
|
59 |
+
{
|
60 |
+
$this->backup = $backup;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* {@inheritdoc}
|
65 |
+
*/
|
66 |
+
public function dump(MessageCatalogue $messages, $options = array())
|
67 |
+
{
|
68 |
+
if (!array_key_exists('path', $options)) {
|
69 |
+
throw new InvalidArgumentException('The file dumper needs a path option.');
|
70 |
+
}
|
71 |
+
|
72 |
+
// save a file for each domain
|
73 |
+
foreach ($messages->getDomains() as $domain) {
|
74 |
+
// backup
|
75 |
+
$fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale());
|
76 |
+
if (file_exists($fullpath)) {
|
77 |
+
if ($this->backup) {
|
78 |
+
@trigger_error('Creating a backup while dumping a message catalogue is deprecated since version 3.1 and will be removed in 4.0. Use TranslationWriter::disableBackup() to disable the backup.', E_USER_DEPRECATED);
|
79 |
+
copy($fullpath, $fullpath.'~');
|
80 |
+
}
|
81 |
+
} else {
|
82 |
+
$directory = dirname($fullpath);
|
83 |
+
if (!file_exists($directory) && !@mkdir($directory, 0777, true)) {
|
84 |
+
throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory));
|
85 |
+
}
|
86 |
+
}
|
87 |
+
// save file
|
88 |
+
file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options));
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Transforms a domain of a message catalogue to its string representation.
|
94 |
+
*
|
95 |
+
* @param MessageCatalogue $messages
|
96 |
+
* @param string $domain
|
97 |
+
* @param array $options
|
98 |
+
*
|
99 |
+
* @return string representation
|
100 |
+
*/
|
101 |
+
abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array());
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Gets the file extension of the dumper.
|
105 |
+
*
|
106 |
+
* @return string file extension
|
107 |
+
*/
|
108 |
+
abstract protected function getExtension();
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Gets the relative file path using the template.
|
112 |
+
*
|
113 |
+
* @param string $domain The domain
|
114 |
+
* @param string $locale The locale
|
115 |
+
*
|
116 |
+
* @return string The relative file path
|
117 |
+
*/
|
118 |
+
private function getRelativePath($domain, $locale)
|
119 |
+
{
|
120 |
+
return strtr($this->relativePathTemplate, array(
|
121 |
+
'%domain%' => $domain,
|
122 |
+
'%locale%' => $locale,
|
123 |
+
'%extension%' => $this->getExtension(),
|
124 |
+
));
|
125 |
+
}
|
126 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Stealth35
|
20 |
+
*/
|
21 |
+
class IcuResFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
protected $relativePathTemplate = '%domain%/%locale%.%extension%';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* {@inheritdoc}
|
30 |
+
*/
|
31 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
32 |
+
{
|
33 |
+
$data = $indexes = $resources = '';
|
34 |
+
|
35 |
+
foreach ($messages->all($domain) as $source => $target) {
|
36 |
+
$indexes .= pack('v', strlen($data) + 28);
|
37 |
+
$data .= $source."\0";
|
38 |
+
}
|
39 |
+
|
40 |
+
$data .= $this->writePadding($data);
|
41 |
+
|
42 |
+
$keyTop = $this->getPosition($data);
|
43 |
+
|
44 |
+
foreach ($messages->all($domain) as $source => $target) {
|
45 |
+
$resources .= pack('V', $this->getPosition($data));
|
46 |
+
|
47 |
+
$data .= pack('V', strlen($target))
|
48 |
+
.mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8')
|
49 |
+
.$this->writePadding($data)
|
50 |
+
;
|
51 |
+
}
|
52 |
+
|
53 |
+
$resOffset = $this->getPosition($data);
|
54 |
+
|
55 |
+
$data .= pack('v', count($messages->all($domain)))
|
56 |
+
.$indexes
|
57 |
+
.$this->writePadding($data)
|
58 |
+
.$resources
|
59 |
+
;
|
60 |
+
|
61 |
+
$bundleTop = $this->getPosition($data);
|
62 |
+
|
63 |
+
$root = pack('V7',
|
64 |
+
$resOffset + (2 << 28), // Resource Offset + Resource Type
|
65 |
+
6, // Index length
|
66 |
+
$keyTop, // Index keys top
|
67 |
+
$bundleTop, // Index resources top
|
68 |
+
$bundleTop, // Index bundle top
|
69 |
+
count($messages->all($domain)), // Index max table length
|
70 |
+
0 // Index attributes
|
71 |
+
);
|
72 |
+
|
73 |
+
$header = pack('vC2v4C12@32',
|
74 |
+
32, // Header size
|
75 |
+
0xDA, 0x27, // Magic number 1 and 2
|
76 |
+
20, 0, 0, 2, // Rest of the header, ..., Size of a char
|
77 |
+
0x52, 0x65, 0x73, 0x42, // Data format identifier
|
78 |
+
1, 2, 0, 0, // Data version
|
79 |
+
1, 4, 0, 0 // Unicode version
|
80 |
+
);
|
81 |
+
|
82 |
+
return $header.$root.$data;
|
83 |
+
}
|
84 |
+
|
85 |
+
private function writePadding($data)
|
86 |
+
{
|
87 |
+
$padding = strlen($data) % 4;
|
88 |
+
|
89 |
+
if ($padding) {
|
90 |
+
return str_repeat("\xAA", 4 - $padding);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
private function getPosition($data)
|
95 |
+
{
|
96 |
+
return (strlen($data) + 28) / 4;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* {@inheritdoc}
|
101 |
+
*/
|
102 |
+
protected function getExtension()
|
103 |
+
{
|
104 |
+
return 'res';
|
105 |
+
}
|
106 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/IniFileDumper.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* IniFileDumper generates an ini formatted string representation of a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Stealth35
|
20 |
+
*/
|
21 |
+
class IniFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
27 |
+
{
|
28 |
+
$output = '';
|
29 |
+
|
30 |
+
foreach ($messages->all($domain) as $source => $target) {
|
31 |
+
$escapeTarget = str_replace('"', '\"', $target);
|
32 |
+
$output .= $source.'="'.$escapeTarget."\"\n";
|
33 |
+
}
|
34 |
+
|
35 |
+
return $output;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* {@inheritdoc}
|
40 |
+
*/
|
41 |
+
protected function getExtension()
|
42 |
+
{
|
43 |
+
return 'ini';
|
44 |
+
}
|
45 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* JsonFileDumper generates an json formatted string representation of a message catalogue.
|
18 |
+
*
|
19 |
+
* @author singles
|
20 |
+
*/
|
21 |
+
class JsonFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
27 |
+
{
|
28 |
+
if (isset($options['json_encoding'])) {
|
29 |
+
$flags = $options['json_encoding'];
|
30 |
+
} else {
|
31 |
+
$flags = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
|
32 |
+
}
|
33 |
+
|
34 |
+
return json_encode($messages->all($domain), $flags);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* {@inheritdoc}
|
39 |
+
*/
|
40 |
+
protected function getExtension()
|
41 |
+
{
|
42 |
+
return 'json';
|
43 |
+
}
|
44 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/MoFileDumper.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Loader\MoFileLoader;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* MoFileDumper generates a gettext formatted string representation of a message catalogue.
|
19 |
+
*
|
20 |
+
* @author Stealth35
|
21 |
+
*/
|
22 |
+
class MoFileDumper extends FileDumper
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* {@inheritdoc}
|
26 |
+
*/
|
27 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
28 |
+
{
|
29 |
+
$sources = $targets = $sourceOffsets = $targetOffsets = '';
|
30 |
+
$offsets = array();
|
31 |
+
$size = 0;
|
32 |
+
|
33 |
+
foreach ($messages->all($domain) as $source => $target) {
|
34 |
+
$offsets[] = array_map('strlen', array($sources, $source, $targets, $target));
|
35 |
+
$sources .= "\0".$source;
|
36 |
+
$targets .= "\0".$target;
|
37 |
+
++$size;
|
38 |
+
}
|
39 |
+
|
40 |
+
$header = array(
|
41 |
+
'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC,
|
42 |
+
'formatRevision' => 0,
|
43 |
+
'count' => $size,
|
44 |
+
'offsetId' => MoFileLoader::MO_HEADER_SIZE,
|
45 |
+
'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size),
|
46 |
+
'sizeHashes' => 0,
|
47 |
+
'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size),
|
48 |
+
);
|
49 |
+
|
50 |
+
$sourcesSize = strlen($sources);
|
51 |
+
$sourcesStart = $header['offsetHashes'] + 1;
|
52 |
+
|
53 |
+
foreach ($offsets as $offset) {
|
54 |
+
$sourceOffsets .= $this->writeLong($offset[1])
|
55 |
+
.$this->writeLong($offset[0] + $sourcesStart);
|
56 |
+
$targetOffsets .= $this->writeLong($offset[3])
|
57 |
+
.$this->writeLong($offset[2] + $sourcesStart + $sourcesSize);
|
58 |
+
}
|
59 |
+
|
60 |
+
$output = implode(array_map(array($this, 'writeLong'), $header))
|
61 |
+
.$sourceOffsets
|
62 |
+
.$targetOffsets
|
63 |
+
.$sources
|
64 |
+
.$targets
|
65 |
+
;
|
66 |
+
|
67 |
+
return $output;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* {@inheritdoc}
|
72 |
+
*/
|
73 |
+
protected function getExtension()
|
74 |
+
{
|
75 |
+
return 'mo';
|
76 |
+
}
|
77 |
+
|
78 |
+
private function writeLong($str)
|
79 |
+
{
|
80 |
+
return pack('V*', $str);
|
81 |
+
}
|
82 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* PhpFileDumper generates PHP files from a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
20 |
+
*/
|
21 |
+
class PhpFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
27 |
+
{
|
28 |
+
return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n";
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
protected function getExtension()
|
35 |
+
{
|
36 |
+
return 'php';
|
37 |
+
}
|
38 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/PoFileDumper.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* PoFileDumper generates a gettext formatted string representation of a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Stealth35
|
20 |
+
*/
|
21 |
+
class PoFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
27 |
+
{
|
28 |
+
$output = 'msgid ""'."\n";
|
29 |
+
$output .= 'msgstr ""'."\n";
|
30 |
+
$output .= '"Content-Type: text/plain; charset=UTF-8\n"'."\n";
|
31 |
+
$output .= '"Content-Transfer-Encoding: 8bit\n"'."\n";
|
32 |
+
$output .= '"Language: '.$messages->getLocale().'\n"'."\n";
|
33 |
+
$output .= "\n";
|
34 |
+
|
35 |
+
$newLine = false;
|
36 |
+
foreach ($messages->all($domain) as $source => $target) {
|
37 |
+
if ($newLine) {
|
38 |
+
$output .= "\n";
|
39 |
+
} else {
|
40 |
+
$newLine = true;
|
41 |
+
}
|
42 |
+
$output .= sprintf('msgid "%s"'."\n", $this->escape($source));
|
43 |
+
$output .= sprintf('msgstr "%s"', $this->escape($target));
|
44 |
+
}
|
45 |
+
|
46 |
+
return $output;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* {@inheritdoc}
|
51 |
+
*/
|
52 |
+
protected function getExtension()
|
53 |
+
{
|
54 |
+
return 'po';
|
55 |
+
}
|
56 |
+
|
57 |
+
private function escape($str)
|
58 |
+
{
|
59 |
+
return addcslashes($str, "\0..\37\42\134");
|
60 |
+
}
|
61 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/QtFileDumper.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* QtFileDumper generates ts files from a message catalogue.
|
18 |
+
*
|
19 |
+
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
20 |
+
*/
|
21 |
+
class QtFileDumper extends FileDumper
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
27 |
+
{
|
28 |
+
$dom = new \DOMDocument('1.0', 'utf-8');
|
29 |
+
$dom->formatOutput = true;
|
30 |
+
$ts = $dom->appendChild($dom->createElement('TS'));
|
31 |
+
$context = $ts->appendChild($dom->createElement('context'));
|
32 |
+
$context->appendChild($dom->createElement('name', $domain));
|
33 |
+
|
34 |
+
foreach ($messages->all($domain) as $source => $target) {
|
35 |
+
$message = $context->appendChild($dom->createElement('message'));
|
36 |
+
$message->appendChild($dom->createElement('source', $source));
|
37 |
+
$message->appendChild($dom->createElement('translation', $target));
|
38 |
+
}
|
39 |
+
|
40 |
+
return $dom->saveXML();
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritdoc}
|
45 |
+
*/
|
46 |
+
protected function getExtension()
|
47 |
+
{
|
48 |
+
return 'ts';
|
49 |
+
}
|
50 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* XliffFileDumper generates xliff files from a message catalogue.
|
19 |
+
*
|
20 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
21 |
+
*/
|
22 |
+
class XliffFileDumper extends FileDumper
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* {@inheritdoc}
|
26 |
+
*/
|
27 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
28 |
+
{
|
29 |
+
$xliffVersion = '1.2';
|
30 |
+
if (array_key_exists('xliff_version', $options)) {
|
31 |
+
$xliffVersion = $options['xliff_version'];
|
32 |
+
}
|
33 |
+
|
34 |
+
if (array_key_exists('default_locale', $options)) {
|
35 |
+
$defaultLocale = $options['default_locale'];
|
36 |
+
} else {
|
37 |
+
$defaultLocale = \Locale::getDefault();
|
38 |
+
}
|
39 |
+
|
40 |
+
if ('1.2' === $xliffVersion) {
|
41 |
+
return $this->dumpXliff1($defaultLocale, $messages, $domain, $options);
|
42 |
+
}
|
43 |
+
if ('2.0' === $xliffVersion) {
|
44 |
+
return $this->dumpXliff2($defaultLocale, $messages, $domain, $options);
|
45 |
+
}
|
46 |
+
|
47 |
+
throw new InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion));
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* {@inheritdoc}
|
52 |
+
*/
|
53 |
+
protected function getExtension()
|
54 |
+
{
|
55 |
+
return 'xlf';
|
56 |
+
}
|
57 |
+
|
58 |
+
private function dumpXliff1($defaultLocale, MessageCatalogue $messages, $domain, array $options = array())
|
59 |
+
{
|
60 |
+
$toolInfo = array('tool-id' => 'symfony', 'tool-name' => 'Symfony');
|
61 |
+
if (array_key_exists('tool_info', $options)) {
|
62 |
+
$toolInfo = array_merge($toolInfo, $options['tool_info']);
|
63 |
+
}
|
64 |
+
|
65 |
+
$dom = new \DOMDocument('1.0', 'utf-8');
|
66 |
+
$dom->formatOutput = true;
|
67 |
+
|
68 |
+
$xliff = $dom->appendChild($dom->createElement('xliff'));
|
69 |
+
$xliff->setAttribute('version', '1.2');
|
70 |
+
$xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2');
|
71 |
+
|
72 |
+
$xliffFile = $xliff->appendChild($dom->createElement('file'));
|
73 |
+
$xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale));
|
74 |
+
$xliffFile->setAttribute('target-language', str_replace('_', '-', $messages->getLocale()));
|
75 |
+
$xliffFile->setAttribute('datatype', 'plaintext');
|
76 |
+
$xliffFile->setAttribute('original', 'file.ext');
|
77 |
+
|
78 |
+
$xliffHead = $xliffFile->appendChild($dom->createElement('header'));
|
79 |
+
$xliffTool = $xliffHead->appendChild($dom->createElement('tool'));
|
80 |
+
foreach ($toolInfo as $id => $value) {
|
81 |
+
$xliffTool->setAttribute($id, $value);
|
82 |
+
}
|
83 |
+
|
84 |
+
$xliffBody = $xliffFile->appendChild($dom->createElement('body'));
|
85 |
+
foreach ($messages->all($domain) as $source => $target) {
|
86 |
+
$translation = $dom->createElement('trans-unit');
|
87 |
+
|
88 |
+
$translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._'));
|
89 |
+
$translation->setAttribute('resname', $source);
|
90 |
+
|
91 |
+
$s = $translation->appendChild($dom->createElement('source'));
|
92 |
+
$s->appendChild($dom->createTextNode($source));
|
93 |
+
|
94 |
+
// Does the target contain characters requiring a CDATA section?
|
95 |
+
$text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target);
|
96 |
+
|
97 |
+
$targetElement = $dom->createElement('target');
|
98 |
+
$metadata = $messages->getMetadata($source, $domain);
|
99 |
+
if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) {
|
100 |
+
foreach ($metadata['target-attributes'] as $name => $value) {
|
101 |
+
$targetElement->setAttribute($name, $value);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
$t = $translation->appendChild($targetElement);
|
105 |
+
$t->appendChild($text);
|
106 |
+
|
107 |
+
if ($this->hasMetadataArrayInfo('notes', $metadata)) {
|
108 |
+
foreach ($metadata['notes'] as $note) {
|
109 |
+
if (!isset($note['content'])) {
|
110 |
+
continue;
|
111 |
+
}
|
112 |
+
|
113 |
+
$n = $translation->appendChild($dom->createElement('note'));
|
114 |
+
$n->appendChild($dom->createTextNode($note['content']));
|
115 |
+
|
116 |
+
if (isset($note['priority'])) {
|
117 |
+
$n->setAttribute('priority', $note['priority']);
|
118 |
+
}
|
119 |
+
|
120 |
+
if (isset($note['from'])) {
|
121 |
+
$n->setAttribute('from', $note['from']);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
$xliffBody->appendChild($translation);
|
127 |
+
}
|
128 |
+
|
129 |
+
return $dom->saveXML();
|
130 |
+
}
|
131 |
+
|
132 |
+
private function dumpXliff2($defaultLocale, MessageCatalogue $messages, $domain, array $options = array())
|
133 |
+
{
|
134 |
+
$dom = new \DOMDocument('1.0', 'utf-8');
|
135 |
+
$dom->formatOutput = true;
|
136 |
+
|
137 |
+
$xliff = $dom->appendChild($dom->createElement('xliff'));
|
138 |
+
$xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0');
|
139 |
+
$xliff->setAttribute('version', '2.0');
|
140 |
+
$xliff->setAttribute('srcLang', str_replace('_', '-', $defaultLocale));
|
141 |
+
$xliff->setAttribute('trgLang', str_replace('_', '-', $messages->getLocale()));
|
142 |
+
|
143 |
+
$xliffFile = $xliff->appendChild($dom->createElement('file'));
|
144 |
+
$xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale());
|
145 |
+
|
146 |
+
foreach ($messages->all($domain) as $source => $target) {
|
147 |
+
$translation = $dom->createElement('unit');
|
148 |
+
$translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._'));
|
149 |
+
$metadata = $messages->getMetadata($source, $domain);
|
150 |
+
|
151 |
+
// Add notes section
|
152 |
+
if ($this->hasMetadataArrayInfo('notes', $metadata)) {
|
153 |
+
$notesElement = $dom->createElement('notes');
|
154 |
+
foreach ($metadata['notes'] as $note) {
|
155 |
+
$n = $dom->createElement('note');
|
156 |
+
$n->appendChild($dom->createTextNode(isset($note['content']) ? $note['content'] : ''));
|
157 |
+
unset($note['content']);
|
158 |
+
|
159 |
+
foreach ($note as $name => $value) {
|
160 |
+
$n->setAttribute($name, $value);
|
161 |
+
}
|
162 |
+
$notesElement->appendChild($n);
|
163 |
+
}
|
164 |
+
$translation->appendChild($notesElement);
|
165 |
+
}
|
166 |
+
|
167 |
+
$segment = $translation->appendChild($dom->createElement('segment'));
|
168 |
+
|
169 |
+
$s = $segment->appendChild($dom->createElement('source'));
|
170 |
+
$s->appendChild($dom->createTextNode($source));
|
171 |
+
|
172 |
+
// Does the target contain characters requiring a CDATA section?
|
173 |
+
$text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target);
|
174 |
+
|
175 |
+
$targetElement = $dom->createElement('target');
|
176 |
+
if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) {
|
177 |
+
foreach ($metadata['target-attributes'] as $name => $value) {
|
178 |
+
$targetElement->setAttribute($name, $value);
|
179 |
+
}
|
180 |
+
}
|
181 |
+
$t = $segment->appendChild($targetElement);
|
182 |
+
$t->appendChild($text);
|
183 |
+
|
184 |
+
$xliffFile->appendChild($translation);
|
185 |
+
}
|
186 |
+
|
187 |
+
return $dom->saveXML();
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* @param string $key
|
192 |
+
* @param array|null $metadata
|
193 |
+
*
|
194 |
+
* @return bool
|
195 |
+
*/
|
196 |
+
private function hasMetadataArrayInfo($key, $metadata = null)
|
197 |
+
{
|
198 |
+
return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || is_array($metadata[$key]));
|
199 |
+
}
|
200 |
+
}
|
src/common/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Dumper;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Util\ArrayConverter;
|
16 |
+
use Symfony\Component\Yaml\Yaml;
|
17 |
+
use Symfony\Component\Translation\Exception\LogicException;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* YamlFileDumper generates yaml files from a message catalogue.
|
21 |
+
*
|
22 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
23 |
+
*/
|
24 |
+
class YamlFileDumper extends FileDumper
|
25 |
+
{
|
26 |
+
private $extension;
|
27 |
+
|
28 |
+
public function __construct(/**string */$extension = 'yml')
|
29 |
+
{
|
30 |
+
$this->extension = $extension;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* {@inheritdoc}
|
35 |
+
*/
|
36 |
+
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
37 |
+
{
|
38 |
+
if (!class_exists('Symfony\Component\Yaml\Yaml')) {
|
39 |
+
throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.');
|
40 |
+
}
|
41 |
+
|
42 |
+
$data = $messages->all($domain);
|
43 |
+
|
44 |
+
if (isset($options['as_tree']) && $options['as_tree']) {
|
45 |
+
$data = ArrayConverter::expandToTree($data);
|
46 |
+
}
|
47 |
+
|
48 |
+
if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) {
|
49 |
+
return Yaml::dump($data, $inline);
|
50 |
+
}
|
51 |
+
|
52 |
+
return Yaml::dump($data);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* {@inheritdoc}
|
57 |
+
*/
|
58 |
+
protected function getExtension()
|
59 |
+
{
|
60 |
+
return $this->extension;
|
61 |
+
}
|
62 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/ExceptionInterface.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Exception interface for all exceptions thrown by the component.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
interface ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/InvalidArgumentException.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base InvalidArgumentException for the Translation component.
|
16 |
+
*
|
17 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
18 |
+
*/
|
19 |
+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/InvalidResourceException.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Thrown when a resource cannot be loaded.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/LogicException.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base LogicException for Translation component.
|
16 |
+
*
|
17 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
18 |
+
*/
|
19 |
+
class LogicException extends \LogicException implements ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/NotFoundResourceException.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Thrown when a resource does not exist.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Exception/RuntimeException.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Exception;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Base RuntimeException for the Translation component.
|
16 |
+
*
|
17 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
18 |
+
*/
|
19 |
+
class RuntimeException extends \RuntimeException implements ExceptionInterface
|
20 |
+
{
|
21 |
+
}
|
src/common/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Extractor;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Base class used by classes that extract translation messages from files.
|
18 |
+
*
|
19 |
+
* @author Marcos D. Sánchez <marcosdsanchez@gmail.com>
|
20 |
+
*/
|
21 |
+
abstract class AbstractFileExtractor
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* @param string|array $resource Files, a file or a directory
|
25 |
+
*
|
26 |
+
* @return array
|
27 |
+
*/
|
28 |
+
protected function extractFiles($resource)
|
29 |
+
{
|
30 |
+
if (is_array($resource) || $resource instanceof \Traversable) {
|
31 |
+
$files = array();
|
32 |
+
foreach ($resource as $file) {
|
33 |
+
if ($this->canBeExtracted($file)) {
|
34 |
+
$files[] = $this->toSplFileInfo($file);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
} elseif (is_file($resource)) {
|
38 |
+
$files = $this->canBeExtracted($resource) ? array($this->toSplFileInfo($resource)) : array();
|
39 |
+
} else {
|
40 |
+
$files = $this->extractFromDirectory($resource);
|
41 |
+
}
|
42 |
+
|
43 |
+
return $files;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @param string $file
|
48 |
+
*
|
49 |
+
* @return \SplFileInfo
|
50 |
+
*/
|
51 |
+
private function toSplFileInfo($file)
|
52 |
+
{
|
53 |
+
return ($file instanceof \SplFileInfo) ? $file : new \SplFileInfo($file);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @param string $file
|
58 |
+
*
|
59 |
+
* @return bool
|
60 |
+
*
|
61 |
+
* @throws InvalidArgumentException
|
62 |
+
*/
|
63 |
+
protected function isFile($file)
|
64 |
+
{
|
65 |
+
if (!is_file($file)) {
|
66 |
+
throw new InvalidArgumentException(sprintf('The "%s" file does not exist.', $file));
|
67 |
+
}
|
68 |
+
|
69 |
+
return true;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @param string $file
|
74 |
+
*
|
75 |
+
* @return bool
|
76 |
+
*/
|
77 |
+
abstract protected function canBeExtracted($file);
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @param string|array $resource Files, a file or a directory
|
81 |
+
*
|
82 |
+
* @return array files to be extracted
|
83 |
+
*/
|
84 |
+
abstract protected function extractFromDirectory($resource);
|
85 |
+
}
|
src/common/lib/vendor/symfony/translation/Extractor/ChainExtractor.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Extractor;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* ChainExtractor extracts translation messages from template files.
|
18 |
+
*
|
19 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
20 |
+
*/
|
21 |
+
class ChainExtractor implements ExtractorInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* The extractors.
|
25 |
+
*
|
26 |
+
* @var ExtractorInterface[]
|
27 |
+
*/
|
28 |
+
private $extractors = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Adds a loader to the translation extractor.
|
32 |
+
*
|
33 |
+
* @param string $format The format of the loader
|
34 |
+
* @param ExtractorInterface $extractor The loader
|
35 |
+
*/
|
36 |
+
public function addExtractor($format, ExtractorInterface $extractor)
|
37 |
+
{
|
38 |
+
$this->extractors[$format] = $extractor;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* {@inheritdoc}
|
43 |
+
*/
|
44 |
+
public function setPrefix($prefix)
|
45 |
+
{
|
46 |
+
foreach ($this->extractors as $extractor) {
|
47 |
+
$extractor->setPrefix($prefix);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* {@inheritdoc}
|
53 |
+
*/
|
54 |
+
public function extract($directory, MessageCatalogue $catalogue)
|
55 |
+
{
|
56 |
+
foreach ($this->extractors as $extractor) {
|
57 |
+
$extractor->extract($directory, $catalogue);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
src/common/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Extractor;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Extracts translation messages from a directory or files to the catalogue.
|
18 |
+
* New found messages are injected to the catalogue using the prefix.
|
19 |
+
*
|
20 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
21 |
+
*/
|
22 |
+
interface ExtractorInterface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Extracts translation messages from files, a file or a directory to the catalogue.
|
26 |
+
*
|
27 |
+
* @param string|array $resource Files, a file or a directory
|
28 |
+
* @param MessageCatalogue $catalogue The catalogue
|
29 |
+
*/
|
30 |
+
public function extract($resource, MessageCatalogue $catalogue);
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Sets the prefix that should be used for new found messages.
|
34 |
+
*
|
35 |
+
* @param string $prefix The prefix
|
36 |
+
*/
|
37 |
+
public function setPrefix($prefix);
|
38 |
+
}
|
src/common/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Extractor;
|
13 |
+
|
14 |
+
use Symfony\Component\Finder\Finder;
|
15 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* PhpExtractor extracts translation messages from a PHP template.
|
19 |
+
*
|
20 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
21 |
+
*/
|
22 |
+
class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
|
23 |
+
{
|
24 |
+
const MESSAGE_TOKEN = 300;
|
25 |
+
const METHOD_ARGUMENTS_TOKEN = 1000;
|
26 |
+
const DOMAIN_TOKEN = 1001;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Prefix for new found message.
|
30 |
+
*
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
private $prefix = '';
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The sequence that captures translation messages.
|
37 |
+
*
|
38 |
+
* @var array
|
39 |
+
*/
|
40 |
+
protected $sequences = array(
|
41 |
+
array(
|
42 |
+
'->',
|
43 |
+
'trans',
|
44 |
+
'(',
|
45 |
+
self::MESSAGE_TOKEN,
|
46 |
+
',',
|
47 |
+
self::METHOD_ARGUMENTS_TOKEN,
|
48 |
+
',',
|
49 |
+
self::DOMAIN_TOKEN,
|
50 |
+
),
|
51 |
+
array(
|
52 |
+
'->',
|
53 |
+
'transChoice',
|
54 |
+
'(',
|
55 |
+
self::MESSAGE_TOKEN,
|
56 |
+
',',
|
57 |
+
self::METHOD_ARGUMENTS_TOKEN,
|
58 |
+
',',
|
59 |
+
self::METHOD_ARGUMENTS_TOKEN,
|
60 |
+
',',
|
61 |
+
self::DOMAIN_TOKEN,
|
62 |
+
),
|
63 |
+
array(
|
64 |
+
'->',
|
65 |
+
'trans',
|
66 |
+
'(',
|
67 |
+
self::MESSAGE_TOKEN,
|
68 |
+
),
|
69 |
+
array(
|
70 |
+
'->',
|
71 |
+
'transChoice',
|
72 |
+
'(',
|
73 |
+
self::MESSAGE_TOKEN,
|
74 |
+
),
|
75 |
+
);
|
76 |
+
|
77 |
+
/**
|
78 |
+
* {@inheritdoc}
|
79 |
+
*/
|
80 |
+
public function extract($resource, MessageCatalogue $catalog)
|
81 |
+
{
|
82 |
+
$files = $this->extractFiles($resource);
|
83 |
+
foreach ($files as $file) {
|
84 |
+
$this->parseTokens(token_get_all(file_get_contents($file)), $catalog);
|
85 |
+
|
86 |
+
if (\PHP_VERSION_ID >= 70000) {
|
87 |
+
// PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
|
88 |
+
gc_mem_caches();
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* {@inheritdoc}
|
95 |
+
*/
|
96 |
+
public function setPrefix($prefix)
|
97 |
+
{
|
98 |
+
$this->prefix = $prefix;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Normalizes a token.
|
103 |
+
*
|
104 |
+
* @param mixed $token
|
105 |
+
*
|
106 |
+
* @return string
|
107 |
+
*/
|
108 |
+
protected function normalizeToken($token)
|
109 |
+
{
|
110 |
+
if (isset($token[1]) && 'b"' !== $token) {
|
111 |
+
return $token[1];
|
112 |
+
}
|
113 |
+
|
114 |
+
return $token;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Seeks to a non-whitespace token.
|
119 |
+
*/
|
120 |
+
private function seekToNextRelevantToken(\Iterator $tokenIterator)
|
121 |
+
{
|
122 |
+
for (; $tokenIterator->valid(); $tokenIterator->next()) {
|
123 |
+
$t = $tokenIterator->current();
|
124 |
+
if (T_WHITESPACE !== $t[0]) {
|
125 |
+
break;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
private function skipMethodArgument(\Iterator $tokenIterator)
|
131 |
+
{
|
132 |
+
$openBraces = 0;
|
133 |
+
|
134 |
+
for (; $tokenIterator->valid(); $tokenIterator->next()) {
|
135 |
+
$t = $tokenIterator->current();
|
136 |
+
|
137 |
+
if ('[' === $t[0] || '(' === $t[0]) {
|
138 |
+
++$openBraces;
|
139 |
+
}
|
140 |
+
|
141 |
+
if (']' === $t[0] || ')' === $t[0]) {
|
142 |
+
--$openBraces;
|
143 |
+
}
|
144 |
+
|
145 |
+
if ((0 === $openBraces && ',' === $t[0]) || (-1 === $openBraces && ')' === $t[0])) {
|
146 |
+
break;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Extracts the message from the iterator while the tokens
|
153 |
+
* match allowed message tokens.
|
154 |
+
*/
|
155 |
+
private function getValue(\Iterator $tokenIterator)
|
156 |
+
{
|
157 |
+
$message = '';
|
158 |
+
$docToken = '';
|
159 |
+
|
160 |
+
for (; $tokenIterator->valid(); $tokenIterator->next()) {
|
161 |
+
$t = $tokenIterator->current();
|
162 |
+
if (!isset($t[1])) {
|
163 |
+
break;
|
164 |
+
}
|
165 |
+
|
166 |
+
switch ($t[0]) {
|
167 |
+
case T_START_HEREDOC:
|
168 |
+
$docToken = $t[1];
|
169 |
+
break;
|
170 |
+
case T_ENCAPSED_AND_WHITESPACE:
|
171 |
+
case T_CONSTANT_ENCAPSED_STRING:
|
172 |
+
$message .= $t[1];
|
173 |
+
break;
|
174 |
+
case T_END_HEREDOC:
|
175 |
+
return PhpStringTokenParser::parseDocString($docToken, $message);
|
176 |
+
default:
|
177 |
+
break 2;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
if ($message) {
|
182 |
+
$message = PhpStringTokenParser::parse($message);
|
183 |
+
}
|
184 |
+
|
185 |
+
return $message;
|
186 |
+
}
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Extracts trans message from PHP tokens.
|
190 |
+
*
|
191 |
+
* @param array $tokens
|
192 |
+
* @param MessageCatalogue $catalog
|
193 |
+
*/
|
194 |
+
protected function parseTokens($tokens, MessageCatalogue $catalog)
|
195 |
+
{
|
196 |
+
$tokenIterator = new \ArrayIterator($tokens);
|
197 |
+
|
198 |
+
for ($key = 0; $key < $tokenIterator->count(); ++$key) {
|
199 |
+
foreach ($this->sequences as $sequence) {
|
200 |
+
$message = '';
|
201 |
+
$domain = 'messages';
|
202 |
+
$tokenIterator->seek($key);
|
203 |
+
|
204 |
+
foreach ($sequence as $sequenceKey => $item) {
|
205 |
+
$this->seekToNextRelevantToken($tokenIterator);
|
206 |
+
|
207 |
+
if ($this->normalizeToken($tokenIterator->current()) === $item) {
|
208 |
+
$tokenIterator->next();
|
209 |
+
continue;
|
210 |
+
} elseif (self::MESSAGE_TOKEN === $item) {
|
211 |
+
$message = $this->getValue($tokenIterator);
|
212 |
+
|
213 |
+
if (count($sequence) === ($sequenceKey + 1)) {
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
} elseif (self::METHOD_ARGUMENTS_TOKEN === $item) {
|
217 |
+
$this->skipMethodArgument($tokenIterator);
|
218 |
+
} elseif (self::DOMAIN_TOKEN === $item) {
|
219 |
+
$domain = $this->getValue($tokenIterator);
|
220 |
+
|
221 |
+
break;
|
222 |
+
} else {
|
223 |
+
break;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
if ($message) {
|
228 |
+
$catalog->set($message, $this->prefix.$message, $domain);
|
229 |
+
break;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* @param string $file
|
237 |
+
*
|
238 |
+
* @return bool
|
239 |
+
*
|
240 |
+
* @throws \InvalidArgumentException
|
241 |
+
*/
|
242 |
+
protected function canBeExtracted($file)
|
243 |
+
{
|
244 |
+
return $this->isFile($file) && 'php' === pathinfo($file, PATHINFO_EXTENSION);
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* @param string|array $directory
|
249 |
+
*
|
250 |
+
* @return array
|
251 |
+
*/
|
252 |
+
protected function extractFromDirectory($directory)
|
253 |
+
{
|
254 |
+
$finder = new Finder();
|
255 |
+
|
256 |
+
return $finder->files()->name('*.php')->in($directory);
|
257 |
+
}
|
258 |
+
}
|
src/common/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Extractor;
|
13 |
+
|
14 |
+
/*
|
15 |
+
* The following is derived from code at http://github.com/nikic/PHP-Parser
|
16 |
+
*
|
17 |
+
* Copyright (c) 2011 by Nikita Popov
|
18 |
+
*
|
19 |
+
* Some rights reserved.
|
20 |
+
*
|
21 |
+
* Redistribution and use in source and binary forms, with or without
|
22 |
+
* modification, are permitted provided that the following conditions are
|
23 |
+
* met:
|
24 |
+
*
|
25 |
+
* * Redistributions of source code must retain the above copyright
|
26 |
+
* notice, this list of conditions and the following disclaimer.
|
27 |
+
*
|
28 |
+
* * Redistributions in binary form must reproduce the above
|
29 |
+
* copyright notice, this list of conditions and the following
|
30 |
+
* disclaimer in the documentation and/or other materials provided
|
31 |
+
* with the distribution.
|
32 |
+
*
|
33 |
+
* * The names of the contributors may not be used to endorse or
|
34 |
+
* promote products derived from this software without specific
|
35 |
+
* prior written permission.
|
36 |
+
*
|
37 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
38 |
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
39 |
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
40 |
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
41 |
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
42 |
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
43 |
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
44 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
45 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
46 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
47 |
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
48 |
+
*/
|
49 |
+
|
50 |
+
class PhpStringTokenParser
|
51 |
+
{
|
52 |
+
protected static $replacements = array(
|
53 |
+
'\\' => '\\',
|
54 |
+
'$' => '$',
|
55 |
+
'n' => "\n",
|
56 |
+
'r' => "\r",
|
57 |
+
't' => "\t",
|
58 |
+
'f' => "\f",
|
59 |
+
'v' => "\v",
|
60 |
+
'e' => "\x1B",
|
61 |
+
);
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Parses a string token.
|
65 |
+
*
|
66 |
+
* @param string $str String token content
|
67 |
+
*
|
68 |
+
* @return string The parsed string
|
69 |
+
*/
|
70 |
+
public static function parse($str)
|
71 |
+
{
|
72 |
+
$bLength = 0;
|
73 |
+
if ('b' === $str[0]) {
|
74 |
+
$bLength = 1;
|
75 |
+
}
|
76 |
+
|
77 |
+
if ('\'' === $str[$bLength]) {
|
78 |
+
return str_replace(
|
79 |
+
array('\\\\', '\\\''),
|
80 |
+
array('\\', '\''),
|
81 |
+
substr($str, $bLength + 1, -1)
|
82 |
+
);
|
83 |
+
} else {
|
84 |
+
return self::parseEscapeSequences(substr($str, $bLength + 1, -1), '"');
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Parses escape sequences in strings (all string types apart from single quoted).
|
90 |
+
*
|
91 |
+
* @param string $str String without quotes
|
92 |
+
* @param null|string $quote Quote type
|
93 |
+
*
|
94 |
+
* @return string String with escape sequences parsed
|
95 |
+
*/
|
96 |
+
public static function parseEscapeSequences($str, $quote)
|
97 |
+
{
|
98 |
+
if (null !== $quote) {
|
99 |
+
$str = str_replace('\\'.$quote, $quote, $str);
|
100 |
+
}
|
101 |
+
|
102 |
+
return preg_replace_callback(
|
103 |
+
'~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~',
|
104 |
+
array(__CLASS__, 'parseCallback'),
|
105 |
+
$str
|
106 |
+
);
|
107 |
+
}
|
108 |
+
|
109 |
+
private static function parseCallback($matches)
|
110 |
+
{
|
111 |
+
$str = $matches[1];
|
112 |
+
|
113 |
+
if (isset(self::$replacements[$str])) {
|
114 |
+
return self::$replacements[$str];
|
115 |
+
} elseif ('x' === $str[0] || 'X' === $str[0]) {
|
116 |
+
return chr(hexdec($str));
|
117 |
+
} else {
|
118 |
+
return chr(octdec($str));
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Parses a constant doc string.
|
124 |
+
*
|
125 |
+
* @param string $startToken Doc string start token content (<<<SMTHG)
|
126 |
+
* @param string $str String token content
|
127 |
+
*
|
128 |
+
* @return string Parsed string
|
129 |
+
*/
|
130 |
+
public static function parseDocString($startToken, $str)
|
131 |
+
{
|
132 |
+
// strip last newline (thanks tokenizer for sticking it into the string!)
|
133 |
+
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
|
134 |
+
|
135 |
+
// nowdoc string
|
136 |
+
if (false !== strpos($startToken, '\'')) {
|
137 |
+
return $str;
|
138 |
+
}
|
139 |
+
|
140 |
+
return self::parseEscapeSequences($str, null);
|
141 |
+
}
|
142 |
+
}
|
src/common/lib/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Formatter;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
16 |
+
*/
|
17 |
+
interface ChoiceMessageFormatterInterface
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Formats a localized message pattern with given arguments.
|
21 |
+
*
|
22 |
+
* @param string $message The message (may also be an object that can be cast to string)
|
23 |
+
* @param int $number The number to use to find the indice of the message
|
24 |
+
* @param string $locale The message locale
|
25 |
+
* @param array $parameters An array of parameters for the message
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function choiceFormat($message, $number, $locale, array $parameters = array());
|
30 |
+
}
|
src/common/lib/vendor/symfony/translation/Formatter/MessageFormatter.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Formatter;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageSelector;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
18 |
+
*/
|
19 |
+
class MessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface
|
20 |
+
{
|
21 |
+
private $selector;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @param MessageSelector|null $selector The message selector for pluralization
|
25 |
+
*/
|
26 |
+
public function __construct(MessageSelector $selector = null)
|
27 |
+
{
|
28 |
+
$this->selector = $selector ?: new MessageSelector();
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* {@inheritdoc}
|
33 |
+
*/
|
34 |
+
public function format($message, $locale, array $parameters = array())
|
35 |
+
{
|
36 |
+
return strtr($message, $parameters);
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* {@inheritdoc}
|
41 |
+
*/
|
42 |
+
public function choiceFormat($message, $number, $locale, array $parameters = array())
|
43 |
+
{
|
44 |
+
$parameters = array_merge(array('%count%' => $number), $parameters);
|
45 |
+
|
46 |
+
return $this->format($this->selector->choose($message, (int) $number, $locale), $locale, $parameters);
|
47 |
+
}
|
48 |
+
}
|
src/common/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Formatter;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
16 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
17 |
+
*/
|
18 |
+
interface MessageFormatterInterface
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Formats a localized message pattern with given arguments.
|
22 |
+
*
|
23 |
+
* @param string $message The message (may also be an object that can be cast to string)
|
24 |
+
* @param string $locale The message locale
|
25 |
+
* @param array $parameters An array of parameters for the message
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function format($message, $locale, array $parameters = array());
|
30 |
+
}
|
src/common/lib/vendor/symfony/translation/IdentityTranslator.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* IdentityTranslator does not translate anything.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class IdentityTranslator implements TranslatorInterface
|
20 |
+
{
|
21 |
+
private $selector;
|
22 |
+
private $locale;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @param MessageSelector|null $selector The message selector for pluralization
|
26 |
+
*/
|
27 |
+
public function __construct(MessageSelector $selector = null)
|
28 |
+
{
|
29 |
+
$this->selector = $selector ?: new MessageSelector();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* {@inheritdoc}
|
34 |
+
*/
|
35 |
+
public function setLocale($locale)
|
36 |
+
{
|
37 |
+
$this->locale = $locale;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* {@inheritdoc}
|
42 |
+
*/
|
43 |
+
public function getLocale()
|
44 |
+
{
|
45 |
+
return $this->locale ?: \Locale::getDefault();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* {@inheritdoc}
|
50 |
+
*/
|
51 |
+
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
|
52 |
+
{
|
53 |
+
return strtr((string) $id, $parameters);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* {@inheritdoc}
|
58 |
+
*/
|
59 |
+
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
|
60 |
+
{
|
61 |
+
return strtr($this->selector->choose((string) $id, (int) $number, $locale ?: $this->getLocale()), $parameters);
|
62 |
+
}
|
63 |
+
}
|
src/common/lib/vendor/symfony/translation/Interval.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Tests if a given number belongs to a given math interval.
|
18 |
+
*
|
19 |
+
* An interval can represent a finite set of numbers:
|
20 |
+
*
|
21 |
+
* {1,2,3,4}
|
22 |
+
*
|
23 |
+
* An interval can represent numbers between two numbers:
|
24 |
+
*
|
25 |
+
* [1, +Inf]
|
26 |
+
* ]-1,2[
|
27 |
+
*
|
28 |
+
* The left delimiter can be [ (inclusive) or ] (exclusive).
|
29 |
+
* The right delimiter can be [ (exclusive) or ] (inclusive).
|
30 |
+
* Beside numbers, you can use -Inf and +Inf for the infinite.
|
31 |
+
*
|
32 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
33 |
+
*
|
34 |
+
* @see http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation
|
35 |
+
*/
|
36 |
+
class Interval
|
37 |
+
{
|
38 |
+
/**
|
39 |
+
* Tests if the given number is in the math interval.
|
40 |
+
*
|
41 |
+
* @param int $number A number
|
42 |
+
* @param string $interval An interval
|
43 |
+
*
|
44 |
+
* @return bool
|
45 |
+
*
|
46 |
+
* @throws InvalidArgumentException
|
47 |
+
*/
|
48 |
+
public static function test($number, $interval)
|
49 |
+
{
|
50 |
+
$interval = trim($interval);
|
51 |
+
|
52 |
+
if (!preg_match('/^'.self::getIntervalRegexp().'$/x', $interval, $matches)) {
|
53 |
+
throw new InvalidArgumentException(sprintf('"%s" is not a valid interval.', $interval));
|
54 |
+
}
|
55 |
+
|
56 |
+
if ($matches[1]) {
|
57 |
+
foreach (explode(',', $matches[2]) as $n) {
|
58 |
+
if ($number == $n) {
|
59 |
+
return true;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
} else {
|
63 |
+
$leftNumber = self::convertNumber($matches['left']);
|
64 |
+
$rightNumber = self::convertNumber($matches['right']);
|
65 |
+
|
66 |
+
return
|
67 |
+
('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber)
|
68 |
+
&& (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber)
|
69 |
+
;
|
70 |
+
}
|
71 |
+
|
72 |
+
return false;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Returns a Regexp that matches valid intervals.
|
77 |
+
*
|
78 |
+
* @return string A Regexp (without the delimiters)
|
79 |
+
*/
|
80 |
+
public static function getIntervalRegexp()
|
81 |
+
{
|
82 |
+
return <<<EOF
|
83 |
+
({\s*
|
84 |
+
(\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)
|
85 |
+
\s*})
|
86 |
+
|
87 |
+
|
|
88 |
+
|
89 |
+
(?P<left_delimiter>[\[\]])
|
90 |
+
\s*
|
91 |
+
(?P<left>-Inf|\-?\d+(\.\d+)?)
|
92 |
+
\s*,\s*
|
93 |
+
(?P<right>\+?Inf|\-?\d+(\.\d+)?)
|
94 |
+
\s*
|
95 |
+
(?P<right_delimiter>[\[\]])
|
96 |
+
EOF;
|
97 |
+
}
|
98 |
+
|
99 |
+
private static function convertNumber($number)
|
100 |
+
{
|
101 |
+
if ('-Inf' === $number) {
|
102 |
+
return log(0);
|
103 |
+
} elseif ('+Inf' === $number || 'Inf' === $number) {
|
104 |
+
return -log(0);
|
105 |
+
}
|
106 |
+
|
107 |
+
return (float) $number;
|
108 |
+
}
|
109 |
+
}
|
src/common/lib/vendor/symfony/translation/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2004-2017 Fabien Potencier
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
8 |
+
to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in all
|
11 |
+
copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
src/common/lib/vendor/symfony/translation/Loader/ArrayLoader.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* ArrayLoader loads translations from a PHP array.
|
18 |
+
*
|
19 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
20 |
+
*/
|
21 |
+
class ArrayLoader implements LoaderInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function load($resource, $locale, $domain = 'messages')
|
27 |
+
{
|
28 |
+
$this->flatten($resource);
|
29 |
+
$catalogue = new MessageCatalogue($locale);
|
30 |
+
$catalogue->add($resource, $domain);
|
31 |
+
|
32 |
+
return $catalogue;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Flattens an nested array of translations.
|
37 |
+
*
|
38 |
+
* The scheme used is:
|
39 |
+
* 'key' => array('key2' => array('key3' => 'value'))
|
40 |
+
* Becomes:
|
41 |
+
* 'key.key2.key3' => 'value'
|
42 |
+
*
|
43 |
+
* This function takes an array by reference and will modify it
|
44 |
+
*
|
45 |
+
* @param array &$messages The array that will be flattened
|
46 |
+
* @param array $subnode Current subnode being parsed, used internally for recursive calls
|
47 |
+
* @param string $path Current path being parsed, used internally for recursive calls
|
48 |
+
*/
|
49 |
+
private function flatten(array &$messages, array $subnode = null, $path = null)
|
50 |
+
{
|
51 |
+
if (null === $subnode) {
|
52 |
+
$subnode = &$messages;
|
53 |
+
}
|
54 |
+
foreach ($subnode as $key => $value) {
|
55 |
+
if (is_array($value)) {
|
56 |
+
$nodePath = $path ? $path.'.'.$key : $key;
|
57 |
+
$this->flatten($messages, $value, $nodePath);
|
58 |
+
if (null === $path) {
|
59 |
+
unset($messages[$key]);
|
60 |
+
}
|
61 |
+
} elseif (null !== $path) {
|
62 |
+
$messages[$path.'.'.$key] = $value;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/CsvFileLoader.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* CsvFileLoader loads translations from CSV files.
|
18 |
+
*
|
19 |
+
* @author Saša Stamenković <umpirsky@gmail.com>
|
20 |
+
*/
|
21 |
+
class CsvFileLoader extends FileLoader
|
22 |
+
{
|
23 |
+
private $delimiter = ';';
|
24 |
+
private $enclosure = '"';
|
25 |
+
private $escape = '\\';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* {@inheritdoc}
|
29 |
+
*/
|
30 |
+
protected function loadResource($resource)
|
31 |
+
{
|
32 |
+
$messages = array();
|
33 |
+
|
34 |
+
try {
|
35 |
+
$file = new \SplFileObject($resource, 'rb');
|
36 |
+
} catch (\RuntimeException $e) {
|
37 |
+
throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e);
|
38 |
+
}
|
39 |
+
|
40 |
+
$file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY);
|
41 |
+
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
|
42 |
+
|
43 |
+
foreach ($file as $data) {
|
44 |
+
if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === count($data)) {
|
45 |
+
$messages[$data[0]] = $data[1];
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
return $messages;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Sets the delimiter, enclosure, and escape character for CSV.
|
54 |
+
*
|
55 |
+
* @param string $delimiter Delimiter character
|
56 |
+
* @param string $enclosure Enclosure character
|
57 |
+
* @param string $escape Escape character
|
58 |
+
*/
|
59 |
+
public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\')
|
60 |
+
{
|
61 |
+
$this->delimiter = $delimiter;
|
62 |
+
$this->enclosure = $enclosure;
|
63 |
+
$this->escape = $escape;
|
64 |
+
}
|
65 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/FileLoader.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
15 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
16 |
+
use Symfony\Component\Config\Resource\FileResource;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
20 |
+
*/
|
21 |
+
abstract class FileLoader extends ArrayLoader
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
public function load($resource, $locale, $domain = 'messages')
|
27 |
+
{
|
28 |
+
if (!stream_is_local($resource)) {
|
29 |
+
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
30 |
+
}
|
31 |
+
|
32 |
+
if (!file_exists($resource)) {
|
33 |
+
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
34 |
+
}
|
35 |
+
|
36 |
+
$messages = $this->loadResource($resource);
|
37 |
+
|
38 |
+
// empty resource
|
39 |
+
if (null === $messages) {
|
40 |
+
$messages = array();
|
41 |
+
}
|
42 |
+
|
43 |
+
// not an array
|
44 |
+
if (!is_array($messages)) {
|
45 |
+
throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource));
|
46 |
+
}
|
47 |
+
|
48 |
+
$catalogue = parent::load($messages, $locale, $domain);
|
49 |
+
|
50 |
+
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
51 |
+
$catalogue->addResource(new FileResource($resource));
|
52 |
+
}
|
53 |
+
|
54 |
+
return $catalogue;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param string $resource
|
59 |
+
*
|
60 |
+
* @return array
|
61 |
+
*
|
62 |
+
* @throws InvalidResourceException if stream content has an invalid format
|
63 |
+
*/
|
64 |
+
abstract protected function loadResource($resource);
|
65 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
16 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
17 |
+
use Symfony\Component\Config\Resource\FileResource;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* IcuResFileLoader loads translations from a resource bundle.
|
21 |
+
*
|
22 |
+
* @author stealth35
|
23 |
+
*/
|
24 |
+
class IcuDatFileLoader extends IcuResFileLoader
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
public function load($resource, $locale, $domain = 'messages')
|
30 |
+
{
|
31 |
+
if (!stream_is_local($resource.'.dat')) {
|
32 |
+
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
33 |
+
}
|
34 |
+
|
35 |
+
if (!file_exists($resource.'.dat')) {
|
36 |
+
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
37 |
+
}
|
38 |
+
|
39 |
+
try {
|
40 |
+
$rb = new \ResourceBundle($locale, $resource);
|
41 |
+
} catch (\Exception $e) {
|
42 |
+
// HHVM compatibility: constructor throws on invalid resource
|
43 |
+
$rb = null;
|
44 |
+
}
|
45 |
+
|
46 |
+
if (!$rb) {
|
47 |
+
throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource));
|
48 |
+
} elseif (intl_is_failure($rb->getErrorCode())) {
|
49 |
+
throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode());
|
50 |
+
}
|
51 |
+
|
52 |
+
$messages = $this->flatten($rb);
|
53 |
+
$catalogue = new MessageCatalogue($locale);
|
54 |
+
$catalogue->add($messages, $domain);
|
55 |
+
|
56 |
+
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
57 |
+
$catalogue->addResource(new FileResource($resource.'.dat'));
|
58 |
+
}
|
59 |
+
|
60 |
+
return $catalogue;
|
61 |
+
}
|
62 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
16 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
17 |
+
use Symfony\Component\Config\Resource\DirectoryResource;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* IcuResFileLoader loads translations from a resource bundle.
|
21 |
+
*
|
22 |
+
* @author stealth35
|
23 |
+
*/
|
24 |
+
class IcuResFileLoader implements LoaderInterface
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
public function load($resource, $locale, $domain = 'messages')
|
30 |
+
{
|
31 |
+
if (!stream_is_local($resource)) {
|
32 |
+
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
33 |
+
}
|
34 |
+
|
35 |
+
if (!is_dir($resource)) {
|
36 |
+
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
37 |
+
}
|
38 |
+
|
39 |
+
try {
|
40 |
+
$rb = new \ResourceBundle($locale, $resource);
|
41 |
+
} catch (\Exception $e) {
|
42 |
+
// HHVM compatibility: constructor throws on invalid resource
|
43 |
+
$rb = null;
|
44 |
+
}
|
45 |
+
|
46 |
+
if (!$rb) {
|
47 |
+
throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource));
|
48 |
+
} elseif (intl_is_failure($rb->getErrorCode())) {
|
49 |
+
throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode());
|
50 |
+
}
|
51 |
+
|
52 |
+
$messages = $this->flatten($rb);
|
53 |
+
$catalogue = new MessageCatalogue($locale);
|
54 |
+
$catalogue->add($messages, $domain);
|
55 |
+
|
56 |
+
if (class_exists('Symfony\Component\Config\Resource\DirectoryResource')) {
|
57 |
+
$catalogue->addResource(new DirectoryResource($resource));
|
58 |
+
}
|
59 |
+
|
60 |
+
return $catalogue;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Flattens an ResourceBundle.
|
65 |
+
*
|
66 |
+
* The scheme used is:
|
67 |
+
* key { key2 { key3 { "value" } } }
|
68 |
+
* Becomes:
|
69 |
+
* 'key.key2.key3' => 'value'
|
70 |
+
*
|
71 |
+
* This function takes an array by reference and will modify it
|
72 |
+
*
|
73 |
+
* @param \ResourceBundle $rb The ResourceBundle that will be flattened
|
74 |
+
* @param array $messages Used internally for recursive calls
|
75 |
+
* @param string $path Current path being parsed, used internally for recursive calls
|
76 |
+
*
|
77 |
+
* @return array the flattened ResourceBundle
|
78 |
+
*/
|
79 |
+
protected function flatten(\ResourceBundle $rb, array &$messages = array(), $path = null)
|
80 |
+
{
|
81 |
+
foreach ($rb as $key => $value) {
|
82 |
+
$nodePath = $path ? $path.'.'.$key : $key;
|
83 |
+
if ($value instanceof \ResourceBundle) {
|
84 |
+
$this->flatten($value, $messages, $nodePath);
|
85 |
+
} else {
|
86 |
+
$messages[$nodePath] = $value;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
return $messages;
|
91 |
+
}
|
92 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/IniFileLoader.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* IniFileLoader loads translations from an ini file.
|
16 |
+
*
|
17 |
+
* @author stealth35
|
18 |
+
*/
|
19 |
+
class IniFileLoader extends FileLoader
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* {@inheritdoc}
|
23 |
+
*/
|
24 |
+
protected function loadResource($resource)
|
25 |
+
{
|
26 |
+
return parse_ini_file($resource, true);
|
27 |
+
}
|
28 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/JsonFileLoader.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* JsonFileLoader loads translations from an json file.
|
18 |
+
*
|
19 |
+
* @author singles
|
20 |
+
*/
|
21 |
+
class JsonFileLoader extends FileLoader
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* {@inheritdoc}
|
25 |
+
*/
|
26 |
+
protected function loadResource($resource)
|
27 |
+
{
|
28 |
+
$messages = array();
|
29 |
+
if ($data = file_get_contents($resource)) {
|
30 |
+
$messages = json_decode($data, true);
|
31 |
+
|
32 |
+
if (0 < $errorCode = json_last_error()) {
|
33 |
+
throw new InvalidResourceException(sprintf('Error parsing JSON - %s', $this->getJSONErrorMessage($errorCode)));
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
return $messages;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Translates JSON_ERROR_* constant into meaningful message.
|
42 |
+
*
|
43 |
+
* @param int $errorCode Error code returned by json_last_error() call
|
44 |
+
*
|
45 |
+
* @return string Message string
|
46 |
+
*/
|
47 |
+
private function getJSONErrorMessage($errorCode)
|
48 |
+
{
|
49 |
+
switch ($errorCode) {
|
50 |
+
case JSON_ERROR_DEPTH:
|
51 |
+
return 'Maximum stack depth exceeded';
|
52 |
+
case JSON_ERROR_STATE_MISMATCH:
|
53 |
+
return 'Underflow or the modes mismatch';
|
54 |
+
case JSON_ERROR_CTRL_CHAR:
|
55 |
+
return 'Unexpected control character found';
|
56 |
+
case JSON_ERROR_SYNTAX:
|
57 |
+
return 'Syntax error, malformed JSON';
|
58 |
+
case JSON_ERROR_UTF8:
|
59 |
+
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
60 |
+
default:
|
61 |
+
return 'Unknown error';
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/LoaderInterface.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
16 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* LoaderInterface is the interface implemented by all translation loaders.
|
20 |
+
*
|
21 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
22 |
+
*/
|
23 |
+
interface LoaderInterface
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Loads a locale.
|
27 |
+
*
|
28 |
+
* @param mixed $resource A resource
|
29 |
+
* @param string $locale A locale
|
30 |
+
* @param string $domain The domain
|
31 |
+
*
|
32 |
+
* @return MessageCatalogue A MessageCatalogue instance
|
33 |
+
*
|
34 |
+
* @throws NotFoundResourceException when the resource cannot be found
|
35 |
+
* @throws InvalidResourceException when the resource cannot be loaded
|
36 |
+
*/
|
37 |
+
public function load($resource, $locale, $domain = 'messages');
|
38 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/MoFileLoader.php
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
|
18 |
+
*/
|
19 |
+
class MoFileLoader extends FileLoader
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Magic used for validating the format of a MO file as well as
|
23 |
+
* detecting if the machine used to create that file was little endian.
|
24 |
+
*/
|
25 |
+
const MO_LITTLE_ENDIAN_MAGIC = 0x950412de;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Magic used for validating the format of a MO file as well as
|
29 |
+
* detecting if the machine used to create that file was big endian.
|
30 |
+
*/
|
31 |
+
const MO_BIG_ENDIAN_MAGIC = 0xde120495;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The size of the header of a MO file in bytes.
|
35 |
+
*/
|
36 |
+
const MO_HEADER_SIZE = 28;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Parses machine object (MO) format, independent of the machine's endian it
|
40 |
+
* was created on. Both 32bit and 64bit systems are supported.
|
41 |
+
*
|
42 |
+
* {@inheritdoc}
|
43 |
+
*/
|
44 |
+
protected function loadResource($resource)
|
45 |
+
{
|
46 |
+
$stream = fopen($resource, 'r');
|
47 |
+
|
48 |
+
$stat = fstat($stream);
|
49 |
+
|
50 |
+
if ($stat['size'] < self::MO_HEADER_SIZE) {
|
51 |
+
throw new InvalidResourceException('MO stream content has an invalid format.');
|
52 |
+
}
|
53 |
+
$magic = unpack('V1', fread($stream, 4));
|
54 |
+
$magic = hexdec(substr(dechex(current($magic)), -8));
|
55 |
+
|
56 |
+
if (self::MO_LITTLE_ENDIAN_MAGIC == $magic) {
|
57 |
+
$isBigEndian = false;
|
58 |
+
} elseif (self::MO_BIG_ENDIAN_MAGIC == $magic) {
|
59 |
+
$isBigEndian = true;
|
60 |
+
} else {
|
61 |
+
throw new InvalidResourceException('MO stream content has an invalid format.');
|
62 |
+
}
|
63 |
+
|
64 |
+
// formatRevision
|
65 |
+
$this->readLong($stream, $isBigEndian);
|
66 |
+
$count = $this->readLong($stream, $isBigEndian);
|
67 |
+
$offsetId = $this->readLong($stream, $isBigEndian);
|
68 |
+
$offsetTranslated = $this->readLong($stream, $isBigEndian);
|
69 |
+
// sizeHashes
|
70 |
+
$this->readLong($stream, $isBigEndian);
|
71 |
+
// offsetHashes
|
72 |
+
$this->readLong($stream, $isBigEndian);
|
73 |
+
|
74 |
+
$messages = array();
|
75 |
+
|
76 |
+
for ($i = 0; $i < $count; ++$i) {
|
77 |
+
$pluralId = null;
|
78 |
+
$translated = null;
|
79 |
+
|
80 |
+
fseek($stream, $offsetId + $i * 8);
|
81 |
+
|
82 |
+
$length = $this->readLong($stream, $isBigEndian);
|
83 |
+
$offset = $this->readLong($stream, $isBigEndian);
|
84 |
+
|
85 |
+
if ($length < 1) {
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
|
89 |
+
fseek($stream, $offset);
|
90 |
+
$singularId = fread($stream, $length);
|
91 |
+
|
92 |
+
if (false !== strpos($singularId, "\000")) {
|
93 |
+
list($singularId, $pluralId) = explode("\000", $singularId);
|
94 |
+
}
|
95 |
+
|
96 |
+
fseek($stream, $offsetTranslated + $i * 8);
|
97 |
+
$length = $this->readLong($stream, $isBigEndian);
|
98 |
+
$offset = $this->readLong($stream, $isBigEndian);
|
99 |
+
|
100 |
+
if ($length < 1) {
|
101 |
+
continue;
|
102 |
+
}
|
103 |
+
|
104 |
+
fseek($stream, $offset);
|
105 |
+
$translated = fread($stream, $length);
|
106 |
+
|
107 |
+
if (false !== strpos($translated, "\000")) {
|
108 |
+
$translated = explode("\000", $translated);
|
109 |
+
}
|
110 |
+
|
111 |
+
$ids = array('singular' => $singularId, 'plural' => $pluralId);
|
112 |
+
$item = compact('ids', 'translated');
|
113 |
+
|
114 |
+
if (is_array($item['translated'])) {
|
115 |
+
$messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]);
|
116 |
+
if (isset($item['ids']['plural'])) {
|
117 |
+
$plurals = array();
|
118 |
+
foreach ($item['translated'] as $plural => $translated) {
|
119 |
+
$plurals[] = sprintf('{%d} %s', $plural, $translated);
|
120 |
+
}
|
121 |
+
$messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals));
|
122 |
+
}
|
123 |
+
} elseif (!empty($item['ids']['singular'])) {
|
124 |
+
$messages[$item['ids']['singular']] = stripcslashes($item['translated']);
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
fclose($stream);
|
129 |
+
|
130 |
+
return array_filter($messages);
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Reads an unsigned long from stream respecting endianness.
|
135 |
+
*
|
136 |
+
* @param resource $stream
|
137 |
+
* @param bool $isBigEndian
|
138 |
+
*
|
139 |
+
* @return int
|
140 |
+
*/
|
141 |
+
private function readLong($stream, $isBigEndian)
|
142 |
+
{
|
143 |
+
$result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4));
|
144 |
+
$result = current($result);
|
145 |
+
|
146 |
+
return (int) substr($result, -8);
|
147 |
+
}
|
148 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/PhpFileLoader.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* PhpFileLoader loads translations from PHP files returning an array of translations.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class PhpFileLoader extends FileLoader
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* {@inheritdoc}
|
23 |
+
*/
|
24 |
+
protected function loadResource($resource)
|
25 |
+
{
|
26 |
+
return require $resource;
|
27 |
+
}
|
28 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/PoFileLoader.php
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
|
16 |
+
* @copyright Copyright (c) 2012, Clemens Tolboom
|
17 |
+
*/
|
18 |
+
class PoFileLoader extends FileLoader
|
19 |
+
{
|
20 |
+
/**
|
21 |
+
* Parses portable object (PO) format.
|
22 |
+
*
|
23 |
+
* From http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files
|
24 |
+
* we should be able to parse files having:
|
25 |
+
*
|
26 |
+
* white-space
|
27 |
+
* # translator-comments
|
28 |
+
* #. extracted-comments
|
29 |
+
* #: reference...
|
30 |
+
* #, flag...
|
31 |
+
* #| msgid previous-untranslated-string
|
32 |
+
* msgid untranslated-string
|
33 |
+
* msgstr translated-string
|
34 |
+
*
|
35 |
+
* extra or different lines are:
|
36 |
+
*
|
37 |
+
* #| msgctxt previous-context
|
38 |
+
* #| msgid previous-untranslated-string
|
39 |
+
* msgctxt context
|
40 |
+
*
|
41 |
+
* #| msgid previous-untranslated-string-singular
|
42 |
+
* #| msgid_plural previous-untranslated-string-plural
|
43 |
+
* msgid untranslated-string-singular
|
44 |
+
* msgid_plural untranslated-string-plural
|
45 |
+
* msgstr[0] translated-string-case-0
|
46 |
+
* ...
|
47 |
+
* msgstr[N] translated-string-case-n
|
48 |
+
*
|
49 |
+
* The definition states:
|
50 |
+
* - white-space and comments are optional.
|
51 |
+
* - msgid "" that an empty singleline defines a header.
|
52 |
+
*
|
53 |
+
* This parser sacrifices some features of the reference implementation the
|
54 |
+
* differences to that implementation are as follows.
|
55 |
+
* - No support for comments spanning multiple lines.
|
56 |
+
* - Translator and extracted comments are treated as being the same type.
|
57 |
+
* - Message IDs are allowed to have other encodings as just US-ASCII.
|
58 |
+
*
|
59 |
+
* Items with an empty id are ignored.
|
60 |
+
*
|
61 |
+
* {@inheritdoc}
|
62 |
+
*/
|
63 |
+
protected function loadResource($resource)
|
64 |
+
{
|
65 |
+
$stream = fopen($resource, 'r');
|
66 |
+
|
67 |
+
$defaults = array(
|
68 |
+
'ids' => array(),
|
69 |
+
'translated' => null,
|
70 |
+
);
|
71 |
+
|
72 |
+
$messages = array();
|
73 |
+
$item = $defaults;
|
74 |
+
$flags = array();
|
75 |
+
|
76 |
+
while ($line = fgets($stream)) {
|
77 |
+
$line = trim($line);
|
78 |
+
|
79 |
+
if ('' === $line) {
|
80 |
+
// Whitespace indicated current item is done
|
81 |
+
if (!in_array('fuzzy', $flags)) {
|
82 |
+
$this->addMessage($messages, $item);
|
83 |
+
}
|
84 |
+
$item = $defaults;
|
85 |
+
$flags = array();
|
86 |
+
} elseif ('#,' === substr($line, 0, 2)) {
|
87 |
+
$flags = array_map('trim', explode(',', substr($line, 2)));
|
88 |
+
} elseif ('msgid "' === substr($line, 0, 7)) {
|
89 |
+
// We start a new msg so save previous
|
90 |
+
// TODO: this fails when comments or contexts are added
|
91 |
+
$this->addMessage($messages, $item);
|
92 |
+
$item = $defaults;
|
93 |
+
$item['ids']['singular'] = substr($line, 7, -1);
|
94 |
+
} elseif ('msgstr "' === substr($line, 0, 8)) {
|
95 |
+
$item['translated'] = substr($line, 8, -1);
|
96 |
+
} elseif ('"' === $line[0]) {
|
97 |
+
$continues = isset($item['translated']) ? 'translated' : 'ids';
|
98 |
+
|
99 |
+
if (is_array($item[$continues])) {
|
100 |
+
end($item[$continues]);
|
101 |
+
$item[$continues][key($item[$continues])] .= substr($line, 1, -1);
|
102 |
+
} else {
|
103 |
+
$item[$continues] .= substr($line, 1, -1);
|
104 |
+
}
|
105 |
+
} elseif ('msgid_plural "' === substr($line, 0, 14)) {
|
106 |
+
$item['ids']['plural'] = substr($line, 14, -1);
|
107 |
+
} elseif ('msgstr[' === substr($line, 0, 7)) {
|
108 |
+
$size = strpos($line, ']');
|
109 |
+
$item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
// save last item
|
113 |
+
if (!in_array('fuzzy', $flags)) {
|
114 |
+
$this->addMessage($messages, $item);
|
115 |
+
}
|
116 |
+
fclose($stream);
|
117 |
+
|
118 |
+
return $messages;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Save a translation item to the messages.
|
123 |
+
*
|
124 |
+
* A .po file could contain by error missing plural indexes. We need to
|
125 |
+
* fix these before saving them.
|
126 |
+
*/
|
127 |
+
private function addMessage(array &$messages, array $item)
|
128 |
+
{
|
129 |
+
if (is_array($item['translated'])) {
|
130 |
+
$messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]);
|
131 |
+
if (isset($item['ids']['plural'])) {
|
132 |
+
$plurals = $item['translated'];
|
133 |
+
// PO are by definition indexed so sort by index.
|
134 |
+
ksort($plurals);
|
135 |
+
// Make sure every index is filled.
|
136 |
+
end($plurals);
|
137 |
+
$count = key($plurals);
|
138 |
+
// Fill missing spots with '-'.
|
139 |
+
$empties = array_fill(0, $count + 1, '-');
|
140 |
+
$plurals += $empties;
|
141 |
+
ksort($plurals);
|
142 |
+
$messages[stripcslashes($item['ids']['plural'])] = stripcslashes(implode('|', $plurals));
|
143 |
+
}
|
144 |
+
} elseif (!empty($item['ids']['singular'])) {
|
145 |
+
$messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']);
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/QtFileLoader.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Config\Util\XmlUtils;
|
15 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
16 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
17 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
18 |
+
use Symfony\Component\Config\Resource\FileResource;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* QtFileLoader loads translations from QT Translations XML files.
|
22 |
+
*
|
23 |
+
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
24 |
+
*/
|
25 |
+
class QtFileLoader implements LoaderInterface
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* {@inheritdoc}
|
29 |
+
*/
|
30 |
+
public function load($resource, $locale, $domain = 'messages')
|
31 |
+
{
|
32 |
+
if (!stream_is_local($resource)) {
|
33 |
+
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
34 |
+
}
|
35 |
+
|
36 |
+
if (!file_exists($resource)) {
|
37 |
+
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
38 |
+
}
|
39 |
+
|
40 |
+
try {
|
41 |
+
$dom = XmlUtils::loadFile($resource);
|
42 |
+
} catch (\InvalidArgumentException $e) {
|
43 |
+
throw new InvalidResourceException(sprintf('Unable to load "%s".', $resource), $e->getCode(), $e);
|
44 |
+
}
|
45 |
+
|
46 |
+
$internalErrors = libxml_use_internal_errors(true);
|
47 |
+
libxml_clear_errors();
|
48 |
+
|
49 |
+
$xpath = new \DOMXPath($dom);
|
50 |
+
$nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]');
|
51 |
+
|
52 |
+
$catalogue = new MessageCatalogue($locale);
|
53 |
+
if (1 == $nodes->length) {
|
54 |
+
$translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message');
|
55 |
+
foreach ($translations as $translation) {
|
56 |
+
$translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue;
|
57 |
+
|
58 |
+
if (!empty($translationValue)) {
|
59 |
+
$catalogue->set(
|
60 |
+
(string) $translation->getElementsByTagName('source')->item(0)->nodeValue,
|
61 |
+
$translationValue,
|
62 |
+
$domain
|
63 |
+
);
|
64 |
+
}
|
65 |
+
$translation = $translation->nextSibling;
|
66 |
+
}
|
67 |
+
|
68 |
+
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
69 |
+
$catalogue->addResource(new FileResource($resource));
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
libxml_use_internal_errors($internalErrors);
|
74 |
+
|
75 |
+
return $catalogue;
|
76 |
+
}
|
77 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/XliffFileLoader.php
ADDED
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Config\Util\XmlUtils;
|
15 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
16 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
17 |
+
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
18 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
19 |
+
use Symfony\Component\Config\Resource\FileResource;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* XliffFileLoader loads translations from XLIFF files.
|
23 |
+
*
|
24 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
25 |
+
*/
|
26 |
+
class XliffFileLoader implements LoaderInterface
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* {@inheritdoc}
|
30 |
+
*/
|
31 |
+
public function load($resource, $locale, $domain = 'messages')
|
32 |
+
{
|
33 |
+
if (!stream_is_local($resource)) {
|
34 |
+
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
35 |
+
}
|
36 |
+
|
37 |
+
if (!file_exists($resource)) {
|
38 |
+
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
39 |
+
}
|
40 |
+
|
41 |
+
$catalogue = new MessageCatalogue($locale);
|
42 |
+
$this->extract($resource, $catalogue, $domain);
|
43 |
+
|
44 |
+
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
45 |
+
$catalogue->addResource(new FileResource($resource));
|
46 |
+
}
|
47 |
+
|
48 |
+
return $catalogue;
|
49 |
+
}
|
50 |
+
|
51 |
+
private function extract($resource, MessageCatalogue $catalogue, $domain)
|
52 |
+
{
|
53 |
+
try {
|
54 |
+
$dom = XmlUtils::loadFile($resource);
|
55 |
+
} catch (\InvalidArgumentException $e) {
|
56 |
+
throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $resource, $e->getMessage()), $e->getCode(), $e);
|
57 |
+
}
|
58 |
+
|
59 |
+
$xliffVersion = $this->getVersionNumber($dom);
|
60 |
+
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion));
|
61 |
+
|
62 |
+
if ('1.2' === $xliffVersion) {
|
63 |
+
$this->extractXliff1($dom, $catalogue, $domain);
|
64 |
+
}
|
65 |
+
|
66 |
+
if ('2.0' === $xliffVersion) {
|
67 |
+
$this->extractXliff2($dom, $catalogue, $domain);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Extract messages and metadata from DOMDocument into a MessageCatalogue.
|
73 |
+
*
|
74 |
+
* @param \DOMDocument $dom Source to extract messages and metadata
|
75 |
+
* @param MessageCatalogue $catalogue Catalogue where we'll collect messages and metadata
|
76 |
+
* @param string $domain The domain
|
77 |
+
*/
|
78 |
+
private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, $domain)
|
79 |
+
{
|
80 |
+
$xml = simplexml_import_dom($dom);
|
81 |
+
$encoding = strtoupper($dom->encoding);
|
82 |
+
|
83 |
+
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:1.2');
|
84 |
+
foreach ($xml->xpath('//xliff:trans-unit') as $translation) {
|
85 |
+
$attributes = $translation->attributes();
|
86 |
+
|
87 |
+
if (!(isset($attributes['resname']) || isset($translation->source))) {
|
88 |
+
continue;
|
89 |
+
}
|
90 |
+
|
91 |
+
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
|
92 |
+
// If the xlf file has another encoding specified, try to convert it because
|
93 |
+
// simple_xml will always return utf-8 encoded values
|
94 |
+
$target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding);
|
95 |
+
|
96 |
+
$catalogue->set((string) $source, $target, $domain);
|
97 |
+
|
98 |
+
$metadata = array();
|
99 |
+
if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) {
|
100 |
+
$metadata['notes'] = $notes;
|
101 |
+
}
|
102 |
+
|
103 |
+
if (isset($translation->target) && $translation->target->attributes()) {
|
104 |
+
$metadata['target-attributes'] = array();
|
105 |
+
foreach ($translation->target->attributes() as $key => $value) {
|
106 |
+
$metadata['target-attributes'][$key] = (string) $value;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
if (isset($attributes['id'])) {
|
111 |
+
$metadata['id'] = (string) $attributes['id'];
|
112 |
+
}
|
113 |
+
|
114 |
+
$catalogue->setMetadata((string) $source, $metadata, $domain);
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* @param \DOMDocument $dom
|
120 |
+
* @param MessageCatalogue $catalogue
|
121 |
+
* @param string $domain
|
122 |
+
*/
|
123 |
+
private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, $domain)
|
124 |
+
{
|
125 |
+
$xml = simplexml_import_dom($dom);
|
126 |
+
$encoding = strtoupper($dom->encoding);
|
127 |
+
|
128 |
+
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0');
|
129 |
+
|
130 |
+
foreach ($xml->xpath('//xliff:unit') as $unit) {
|
131 |
+
$segment = $unit->segment;
|
132 |
+
$source = $segment->source;
|
133 |
+
|
134 |
+
// If the xlf file has another encoding specified, try to convert it because
|
135 |
+
// simple_xml will always return utf-8 encoded values
|
136 |
+
$target = $this->utf8ToCharset((string) (isset($segment->target) ? $segment->target : $source), $encoding);
|
137 |
+
|
138 |
+
$catalogue->set((string) $source, $target, $domain);
|
139 |
+
|
140 |
+
$metadata = array();
|
141 |
+
if (isset($segment->target) && $segment->target->attributes()) {
|
142 |
+
$metadata['target-attributes'] = array();
|
143 |
+
foreach ($segment->target->attributes() as $key => $value) {
|
144 |
+
$metadata['target-attributes'][$key] = (string) $value;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
if (isset($unit->notes)) {
|
149 |
+
$metadata['notes'] = array();
|
150 |
+
foreach ($unit->notes->note as $noteNode) {
|
151 |
+
$note = array();
|
152 |
+
foreach ($noteNode->attributes() as $key => $value) {
|
153 |
+
$note[$key] = (string) $value;
|
154 |
+
}
|
155 |
+
$note['content'] = (string) $noteNode;
|
156 |
+
$metadata['notes'][] = $note;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
$catalogue->setMetadata((string) $source, $metadata, $domain);
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Convert a UTF8 string to the specified encoding.
|
166 |
+
*
|
167 |
+
* @param string $content String to decode
|
168 |
+
* @param string $encoding Target encoding
|
169 |
+
*
|
170 |
+
* @return string
|
171 |
+
*/
|
172 |
+
private function utf8ToCharset($content, $encoding = null)
|
173 |
+
{
|
174 |
+
if ('UTF-8' !== $encoding && !empty($encoding)) {
|
175 |
+
return mb_convert_encoding($content, $encoding, 'UTF-8');
|
176 |
+
}
|
177 |
+
|
178 |
+
return $content;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Validates and parses the given file into a DOMDocument.
|
183 |
+
*
|
184 |
+
* @param string $file
|
185 |
+
* @param \DOMDocument $dom
|
186 |
+
* @param string $schema source of the schema
|
187 |
+
*
|
188 |
+
* @throws InvalidResourceException
|
189 |
+
*/
|
190 |
+
private function validateSchema($file, \DOMDocument $dom, $schema)
|
191 |
+
{
|
192 |
+
$internalErrors = libxml_use_internal_errors(true);
|
193 |
+
|
194 |
+
$disableEntities = libxml_disable_entity_loader(false);
|
195 |
+
|
196 |
+
if (!@$dom->schemaValidateSource($schema)) {
|
197 |
+
libxml_disable_entity_loader($disableEntities);
|
198 |
+
|
199 |
+
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors))));
|
200 |
+
}
|
201 |
+
|
202 |
+
libxml_disable_entity_loader($disableEntities);
|
203 |
+
|
204 |
+
$dom->normalizeDocument();
|
205 |
+
|
206 |
+
libxml_clear_errors();
|
207 |
+
libxml_use_internal_errors($internalErrors);
|
208 |
+
}
|
209 |
+
|
210 |
+
private function getSchema($xliffVersion)
|
211 |
+
{
|
212 |
+
if ('1.2' === $xliffVersion) {
|
213 |
+
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');
|
214 |
+
$xmlUri = 'http://www.w3.org/2001/xml.xsd';
|
215 |
+
} elseif ('2.0' === $xliffVersion) {
|
216 |
+
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-2.0.xsd');
|
217 |
+
$xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd';
|
218 |
+
} else {
|
219 |
+
throw new InvalidArgumentException(sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion));
|
220 |
+
}
|
221 |
+
|
222 |
+
return $this->fixXmlLocation($schemaSource, $xmlUri);
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Internally changes the URI of a dependent xsd to be loaded locally.
|
227 |
+
*
|
228 |
+
* @param string $schemaSource Current content of schema file
|
229 |
+
* @param string $xmlUri External URI of XML to convert to local
|
230 |
+
*
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
private function fixXmlLocation($schemaSource, $xmlUri)
|
234 |
+
{
|
235 |
+
$newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
|
236 |
+
$parts = explode('/', $newPath);
|
237 |
+
if (0 === stripos($newPath, 'phar://')) {
|
238 |
+
$tmpfile = tempnam(sys_get_temp_dir(), 'symfony');
|
239 |
+
if ($tmpfile) {
|
240 |
+
copy($newPath, $tmpfile);
|
241 |
+
$parts = explode('/', str_replace('\\', '/', $tmpfile));
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
|
246 |
+
$newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
|
247 |
+
|
248 |
+
return str_replace($xmlUri, $newPath, $schemaSource);
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Returns the XML errors of the internal XML parser.
|
253 |
+
*
|
254 |
+
* @param bool $internalErrors
|
255 |
+
*
|
256 |
+
* @return array An array of errors
|
257 |
+
*/
|
258 |
+
private function getXmlErrors($internalErrors)
|
259 |
+
{
|
260 |
+
$errors = array();
|
261 |
+
foreach (libxml_get_errors() as $error) {
|
262 |
+
$errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)',
|
263 |
+
LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
|
264 |
+
$error->code,
|
265 |
+
trim($error->message),
|
266 |
+
$error->file ?: 'n/a',
|
267 |
+
$error->line,
|
268 |
+
$error->column
|
269 |
+
);
|
270 |
+
}
|
271 |
+
|
272 |
+
libxml_clear_errors();
|
273 |
+
libxml_use_internal_errors($internalErrors);
|
274 |
+
|
275 |
+
return $errors;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Gets xliff file version based on the root "version" attribute.
|
280 |
+
* Defaults to 1.2 for backwards compatibility.
|
281 |
+
*
|
282 |
+
* @param \DOMDocument $dom
|
283 |
+
*
|
284 |
+
* @throws InvalidArgumentException
|
285 |
+
*
|
286 |
+
* @return string
|
287 |
+
*/
|
288 |
+
private function getVersionNumber(\DOMDocument $dom)
|
289 |
+
{
|
290 |
+
/** @var \DOMNode $xliff */
|
291 |
+
foreach ($dom->getElementsByTagName('xliff') as $xliff) {
|
292 |
+
$version = $xliff->attributes->getNamedItem('version');
|
293 |
+
if ($version) {
|
294 |
+
return $version->nodeValue;
|
295 |
+
}
|
296 |
+
|
297 |
+
$namespace = $xliff->attributes->getNamedItem('xmlns');
|
298 |
+
if ($namespace) {
|
299 |
+
if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) {
|
300 |
+
throw new InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s"', $namespace));
|
301 |
+
}
|
302 |
+
|
303 |
+
return substr($namespace, 34);
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
// Falls back to v1.2
|
308 |
+
return '1.2';
|
309 |
+
}
|
310 |
+
|
311 |
+
/**
|
312 |
+
* @param \SimpleXMLElement|null $noteElement
|
313 |
+
* @param string|null $encoding
|
314 |
+
*
|
315 |
+
* @return array
|
316 |
+
*/
|
317 |
+
private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, $encoding = null)
|
318 |
+
{
|
319 |
+
$notes = array();
|
320 |
+
|
321 |
+
if (null === $noteElement) {
|
322 |
+
return $notes;
|
323 |
+
}
|
324 |
+
|
325 |
+
/** @var \SimpleXMLElement $xmlNote */
|
326 |
+
foreach ($noteElement as $xmlNote) {
|
327 |
+
$noteAttributes = $xmlNote->attributes();
|
328 |
+
$note = array('content' => $this->utf8ToCharset((string) $xmlNote, $encoding));
|
329 |
+
if (isset($noteAttributes['priority'])) {
|
330 |
+
$note['priority'] = (int) $noteAttributes['priority'];
|
331 |
+
}
|
332 |
+
|
333 |
+
if (isset($noteAttributes['from'])) {
|
334 |
+
$note['from'] = (string) $noteAttributes['from'];
|
335 |
+
}
|
336 |
+
|
337 |
+
$notes[] = $note;
|
338 |
+
}
|
339 |
+
|
340 |
+
return $notes;
|
341 |
+
}
|
342 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/YamlFileLoader.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Loader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
15 |
+
use Symfony\Component\Translation\Exception\LogicException;
|
16 |
+
use Symfony\Component\Yaml\Parser as YamlParser;
|
17 |
+
use Symfony\Component\Yaml\Exception\ParseException;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* YamlFileLoader loads translations from Yaml files.
|
21 |
+
*
|
22 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
23 |
+
*/
|
24 |
+
class YamlFileLoader extends FileLoader
|
25 |
+
{
|
26 |
+
private $yamlParser;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* {@inheritdoc}
|
30 |
+
*/
|
31 |
+
protected function loadResource($resource)
|
32 |
+
{
|
33 |
+
if (null === $this->yamlParser) {
|
34 |
+
if (!class_exists('Symfony\Component\Yaml\Parser')) {
|
35 |
+
throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.');
|
36 |
+
}
|
37 |
+
|
38 |
+
$this->yamlParser = new YamlParser();
|
39 |
+
}
|
40 |
+
|
41 |
+
$prevErrorHandler = set_error_handler(function ($level, $message, $script, $line) use ($resource, &$prevErrorHandler) {
|
42 |
+
$message = E_USER_DEPRECATED === $level ? preg_replace('/ on line \d+/', ' in "'.$resource.'"$0', $message) : $message;
|
43 |
+
|
44 |
+
return $prevErrorHandler ? $prevErrorHandler($level, $message, $script, $line) : false;
|
45 |
+
});
|
46 |
+
|
47 |
+
try {
|
48 |
+
$messages = $this->yamlParser->parseFile($resource);
|
49 |
+
} catch (ParseException $e) {
|
50 |
+
throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e);
|
51 |
+
} finally {
|
52 |
+
restore_error_handler();
|
53 |
+
}
|
54 |
+
|
55 |
+
return $messages;
|
56 |
+
}
|
57 |
+
}
|
src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd
ADDED
@@ -0,0 +1,2223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<!--
|
4 |
+
|
5 |
+
May-19-2004:
|
6 |
+
- Changed the <choice> for ElemType_header, moving minOccurs="0" maxOccurs="unbounded" from its elements
|
7 |
+
to <choice> itself.
|
8 |
+
- Added <choice> for ElemType_trans-unit to allow "any order" for <context-group>, <count-group>, <prop-group>, <note>, and
|
9 |
+
<alt-trans>.
|
10 |
+
|
11 |
+
Oct-2005
|
12 |
+
- updated version info to 1.2
|
13 |
+
- equiv-trans attribute to <trans-unit> element
|
14 |
+
- merged-trans attribute for <group> element
|
15 |
+
- Add the <seg-source> element as optional in the <trans-unit> and <alt-trans> content models, at the same level as <source>
|
16 |
+
- Create a new value "seg" for the mtype attribute of the <mrk> element
|
17 |
+
- Add mid as an optional attribute for the <alt-trans> element
|
18 |
+
|
19 |
+
Nov-14-2005
|
20 |
+
- Changed name attribute for <context-group> from required to optional
|
21 |
+
- Added extension point at <xliff>
|
22 |
+
|
23 |
+
Jan-9-2006
|
24 |
+
- Added alttranstype type attribute to <alt-trans>, and values
|
25 |
+
|
26 |
+
Jan-10-2006
|
27 |
+
- Corrected error with overwritten purposeValueList
|
28 |
+
- Corrected name="AttrType_Version", attribute should have been "name"
|
29 |
+
|
30 |
+
-->
|
31 |
+
<xsd:schema xmlns:xlf="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:xliff:document:1.2" xml:lang="en">
|
32 |
+
<!-- Import for xml:lang and xml:space -->
|
33 |
+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
|
34 |
+
<!-- Attributes Lists -->
|
35 |
+
<xsd:simpleType name="XTend">
|
36 |
+
<xsd:restriction base="xsd:string">
|
37 |
+
<xsd:pattern value="x-[^\s]+"/>
|
38 |
+
</xsd:restriction>
|
39 |
+
</xsd:simpleType>
|
40 |
+
<xsd:simpleType name="context-typeValueList">
|
41 |
+
<xsd:annotation>
|
42 |
+
<xsd:documentation>Values for the attribute 'context-type'.</xsd:documentation>
|
43 |
+
</xsd:annotation>
|
44 |
+
<xsd:restriction base="xsd:string">
|
45 |
+
<xsd:enumeration value="database">
|
46 |
+
<xsd:annotation>
|
47 |
+
<xsd:documentation>Indicates a database content.</xsd:documentation>
|
48 |
+
</xsd:annotation>
|
49 |
+
</xsd:enumeration>
|
50 |
+
<xsd:enumeration value="element">
|
51 |
+
<xsd:annotation>
|
52 |
+
<xsd:documentation>Indicates the content of an element within an XML document.</xsd:documentation>
|
53 |
+
</xsd:annotation>
|
54 |
+
</xsd:enumeration>
|
55 |
+
<xsd:enumeration value="elementtitle">
|
56 |
+
<xsd:annotation>
|
57 |
+
<xsd:documentation>Indicates the name of an element within an XML document.</xsd:documentation>
|
58 |
+
</xsd:annotation>
|
59 |
+
</xsd:enumeration>
|
60 |
+
<xsd:enumeration value="linenumber">
|
61 |
+
<xsd:annotation>
|
62 |
+
<xsd:documentation>Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found.</xsd:documentation>
|
63 |
+
</xsd:annotation>
|
64 |
+
</xsd:enumeration>
|
65 |
+
<xsd:enumeration value="numparams">
|
66 |
+
<xsd:annotation>
|
67 |
+
<xsd:documentation>Indicates a the number of parameters contained within the <source>.</xsd:documentation>
|
68 |
+
</xsd:annotation>
|
69 |
+
</xsd:enumeration>
|
70 |
+
<xsd:enumeration value="paramnotes">
|
71 |
+
<xsd:annotation>
|
72 |
+
<xsd:documentation>Indicates notes pertaining to the parameters in the <source>.</xsd:documentation>
|
73 |
+
</xsd:annotation>
|
74 |
+
</xsd:enumeration>
|
75 |
+
<xsd:enumeration value="record">
|
76 |
+
<xsd:annotation>
|
77 |
+
<xsd:documentation>Indicates the content of a record within a database.</xsd:documentation>
|
78 |
+
</xsd:annotation>
|
79 |
+
</xsd:enumeration>
|
80 |
+
<xsd:enumeration value="recordtitle">
|
81 |
+
<xsd:annotation>
|
82 |
+
<xsd:documentation>Indicates the name of a record within a database.</xsd:documentation>
|
83 |
+
</xsd:annotation>
|
84 |
+
</xsd:enumeration>
|
85 |
+
<xsd:enumeration value="sourcefile">
|
86 |
+
<xsd:annotation>
|
87 |
+
<xsd:documentation>Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file.</xsd:documentation>
|
88 |
+
</xsd:annotation>
|
89 |
+
</xsd:enumeration>
|
90 |
+
</xsd:restriction>
|
91 |
+
</xsd:simpleType>
|
92 |
+
<xsd:simpleType name="count-typeValueList">
|
93 |
+
<xsd:annotation>
|
94 |
+
<xsd:documentation>Values for the attribute 'count-type'.</xsd:documentation>
|
95 |
+
</xsd:annotation>
|
96 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
97 |
+
<xsd:enumeration value="num-usages">
|
98 |
+
<xsd:annotation>
|
99 |
+
<xsd:documentation>Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts.</xsd:documentation>
|
100 |
+
</xsd:annotation>
|
101 |
+
</xsd:enumeration>
|
102 |
+
<xsd:enumeration value="repetition">
|
103 |
+
<xsd:annotation>
|
104 |
+
<xsd:documentation>Indicates the count units are translation units existing already in the same document.</xsd:documentation>
|
105 |
+
</xsd:annotation>
|
106 |
+
</xsd:enumeration>
|
107 |
+
<xsd:enumeration value="total">
|
108 |
+
<xsd:annotation>
|
109 |
+
<xsd:documentation>Indicates a total count.</xsd:documentation>
|
110 |
+
</xsd:annotation>
|
111 |
+
</xsd:enumeration>
|
112 |
+
</xsd:restriction>
|
113 |
+
</xsd:simpleType>
|
114 |
+
<xsd:simpleType name="InlineDelimitersValueList">
|
115 |
+
<xsd:annotation>
|
116 |
+
<xsd:documentation>Values for the attribute 'ctype' when used other elements than <ph> or <x>.</xsd:documentation>
|
117 |
+
</xsd:annotation>
|
118 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
119 |
+
<xsd:enumeration value="bold">
|
120 |
+
<xsd:annotation>
|
121 |
+
<xsd:documentation>Indicates a run of bolded text.</xsd:documentation>
|
122 |
+
</xsd:annotation>
|
123 |
+
</xsd:enumeration>
|
124 |
+
<xsd:enumeration value="italic">
|
125 |
+
<xsd:annotation>
|
126 |
+
<xsd:documentation>Indicates a run of text in italics.</xsd:documentation>
|
127 |
+
</xsd:annotation>
|
128 |
+
</xsd:enumeration>
|
129 |
+
<xsd:enumeration value="underlined">
|
130 |
+
<xsd:annotation>
|
131 |
+
<xsd:documentation>Indicates a run of underlined text.</xsd:documentation>
|
132 |
+
</xsd:annotation>
|
133 |
+
</xsd:enumeration>
|
134 |
+
<xsd:enumeration value="link">
|
135 |
+
<xsd:annotation>
|
136 |
+
<xsd:documentation>Indicates a run of hyper-text.</xsd:documentation>
|
137 |
+
</xsd:annotation>
|
138 |
+
</xsd:enumeration>
|
139 |
+
</xsd:restriction>
|
140 |
+
</xsd:simpleType>
|
141 |
+
<xsd:simpleType name="InlinePlaceholdersValueList">
|
142 |
+
<xsd:annotation>
|
143 |
+
<xsd:documentation>Values for the attribute 'ctype' when used with <ph> or <x>.</xsd:documentation>
|
144 |
+
</xsd:annotation>
|
145 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
146 |
+
<xsd:enumeration value="image">
|
147 |
+
<xsd:annotation>
|
148 |
+
<xsd:documentation>Indicates a inline image.</xsd:documentation>
|
149 |
+
</xsd:annotation>
|
150 |
+
</xsd:enumeration>
|
151 |
+
<xsd:enumeration value="pb">
|
152 |
+
<xsd:annotation>
|
153 |
+
<xsd:documentation>Indicates a page break.</xsd:documentation>
|
154 |
+
</xsd:annotation>
|
155 |
+
</xsd:enumeration>
|
156 |
+
<xsd:enumeration value="lb">
|
157 |
+
<xsd:annotation>
|
158 |
+
<xsd:documentation>Indicates a line break.</xsd:documentation>
|
159 |
+
</xsd:annotation>
|
160 |
+
</xsd:enumeration>
|
161 |
+
</xsd:restriction>
|
162 |
+
</xsd:simpleType>
|
163 |
+
<xsd:simpleType name="mime-typeValueList">
|
164 |
+
<xsd:restriction base="xsd:string">
|
165 |
+
<xsd:pattern value="(text|multipart|message|application|image|audio|video|model)(/.+)*"/>
|
166 |
+
</xsd:restriction>
|
167 |
+
</xsd:simpleType>
|
168 |
+
<xsd:simpleType name="datatypeValueList">
|
169 |
+
<xsd:annotation>
|
170 |
+
<xsd:documentation>Values for the attribute 'datatype'.</xsd:documentation>
|
171 |
+
</xsd:annotation>
|
172 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
173 |
+
<xsd:enumeration value="asp">
|
174 |
+
<xsd:annotation>
|
175 |
+
<xsd:documentation>Indicates Active Server Page data.</xsd:documentation>
|
176 |
+
</xsd:annotation>
|
177 |
+
</xsd:enumeration>
|
178 |
+
<xsd:enumeration value="c">
|
179 |
+
<xsd:annotation>
|
180 |
+
<xsd:documentation>Indicates C source file data.</xsd:documentation>
|
181 |
+
</xsd:annotation>
|
182 |
+
</xsd:enumeration>
|
183 |
+
<xsd:enumeration value="cdf">
|
184 |
+
<xsd:annotation>
|
185 |
+
<xsd:documentation>Indicates Channel Definition Format (CDF) data.</xsd:documentation>
|
186 |
+
</xsd:annotation>
|
187 |
+
</xsd:enumeration>
|
188 |
+
<xsd:enumeration value="cfm">
|
189 |
+
<xsd:annotation>
|
190 |
+
<xsd:documentation>Indicates ColdFusion data.</xsd:documentation>
|
191 |
+
</xsd:annotation>
|
192 |
+
</xsd:enumeration>
|
193 |
+
<xsd:enumeration value="cpp">
|
194 |
+
<xsd:annotation>
|
195 |
+
<xsd:documentation>Indicates C++ source file data.</xsd:documentation>
|
196 |
+
</xsd:annotation>
|
197 |
+
</xsd:enumeration>
|
198 |
+
<xsd:enumeration value="csharp">
|
199 |
+
<xsd:annotation>
|
200 |
+
<xsd:documentation>Indicates C-Sharp data.</xsd:documentation>
|
201 |
+
</xsd:annotation>
|
202 |
+
</xsd:enumeration>
|
203 |
+
<xsd:enumeration value="cstring">
|
204 |
+
<xsd:annotation>
|
205 |
+
<xsd:documentation>Indicates strings from C, ASM, and driver files data.</xsd:documentation>
|
206 |
+
</xsd:annotation>
|
207 |
+
</xsd:enumeration>
|
208 |
+
<xsd:enumeration value="csv">
|
209 |
+
<xsd:annotation>
|
210 |
+
<xsd:documentation>Indicates comma-separated values data.</xsd:documentation>
|
211 |
+
</xsd:annotation>
|
212 |
+
</xsd:enumeration>
|
213 |
+
<xsd:enumeration value="database">
|
214 |
+
<xsd:annotation>
|
215 |
+
<xsd:documentation>Indicates database data.</xsd:documentation>
|
216 |
+
</xsd:annotation>
|
217 |
+
</xsd:enumeration>
|
218 |
+
<xsd:enumeration value="documentfooter">
|
219 |
+
<xsd:annotation>
|
220 |
+
<xsd:documentation>Indicates portions of document that follows data and contains metadata.</xsd:documentation>
|
221 |
+
</xsd:annotation>
|
222 |
+
</xsd:enumeration>
|
223 |
+
<xsd:enumeration value="documentheader">
|
224 |
+
<xsd:annotation>
|
225 |
+
<xsd:documentation>Indicates portions of document that precedes data and contains metadata.</xsd:documentation>
|
226 |
+
</xsd:annotation>
|
227 |
+
</xsd:enumeration>
|
228 |
+
<xsd:enumeration value="filedialog">
|
229 |
+
<xsd:annotation>
|
230 |
+
<xsd:documentation>Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import).</xsd:documentation>
|
231 |
+
</xsd:annotation>
|
232 |
+
</xsd:enumeration>
|
233 |
+
<xsd:enumeration value="form">
|
234 |
+
<xsd:annotation>
|
235 |
+
<xsd:documentation>Indicates standard user input screen data.</xsd:documentation>
|
236 |
+
</xsd:annotation>
|
237 |
+
</xsd:enumeration>
|
238 |
+
<xsd:enumeration value="html">
|
239 |
+
<xsd:annotation>
|
240 |
+
<xsd:documentation>Indicates HyperText Markup Language (HTML) data - document instance.</xsd:documentation>
|
241 |
+
</xsd:annotation>
|
242 |
+
</xsd:enumeration>
|
243 |
+
<xsd:enumeration value="htmlbody">
|
244 |
+
<xsd:annotation>
|
245 |
+
<xsd:documentation>Indicates content within an HTML document’s <body> element.</xsd:documentation>
|
246 |
+
</xsd:annotation>
|
247 |
+
</xsd:enumeration>
|
248 |
+
<xsd:enumeration value="ini">
|
249 |
+
<xsd:annotation>
|
250 |
+
<xsd:documentation>Indicates Windows INI file data.</xsd:documentation>
|
251 |
+
</xsd:annotation>
|
252 |
+
</xsd:enumeration>
|
253 |
+
<xsd:enumeration value="interleaf">
|
254 |
+
<xsd:annotation>
|
255 |
+
<xsd:documentation>Indicates Interleaf data.</xsd:documentation>
|
256 |
+
</xsd:annotation>
|
257 |
+
</xsd:enumeration>
|
258 |
+
<xsd:enumeration value="javaclass">
|
259 |
+
<xsd:annotation>
|
260 |
+
<xsd:documentation>Indicates Java source file data (extension '.java').</xsd:documentation>
|
261 |
+
</xsd:annotation>
|
262 |
+
</xsd:enumeration>
|
263 |
+
<xsd:enumeration value="javapropertyresourcebundle">
|
264 |
+
<xsd:annotation>
|
265 |
+
<xsd:documentation>Indicates Java property resource bundle data.</xsd:documentation>
|
266 |
+
</xsd:annotation>
|
267 |
+
</xsd:enumeration>
|
268 |
+
<xsd:enumeration value="javalistresourcebundle">
|
269 |
+
<xsd:annotation>
|
270 |
+
<xsd:documentation>Indicates Java list resource bundle data.</xsd:documentation>
|
271 |
+
</xsd:annotation>
|
272 |
+
</xsd:enumeration>
|
273 |
+
<xsd:enumeration value="javascript">
|
274 |
+
<xsd:annotation>
|
275 |
+
<xsd:documentation>Indicates JavaScript source file data.</xsd:documentation>
|
276 |
+
</xsd:annotation>
|
277 |
+
</xsd:enumeration>
|
278 |
+
<xsd:enumeration value="jscript">
|
279 |
+
<xsd:annotation>
|
280 |
+
<xsd:documentation>Indicates JScript source file data.</xsd:documentation>
|
281 |
+
</xsd:annotation>
|
282 |
+
</xsd:enumeration>
|
283 |
+
<xsd:enumeration value="layout">
|
284 |
+
<xsd:annotation>
|
285 |
+
<xsd:documentation>Indicates information relating to formatting.</xsd:documentation>
|
286 |
+
</xsd:annotation>
|
287 |
+
</xsd:enumeration>
|
288 |
+
<xsd:enumeration value="lisp">
|
289 |
+
<xsd:annotation>
|
290 |
+
<xsd:documentation>Indicates LISP source file data.</xsd:documentation>
|
291 |
+
</xsd:annotation>
|
292 |
+
</xsd:enumeration>
|
293 |
+
<xsd:enumeration value="margin">
|
294 |
+
<xsd:annotation>
|
295 |
+
<xsd:documentation>Indicates information relating to margin formats.</xsd:documentation>
|
296 |
+
</xsd:annotation>
|
297 |
+
</xsd:enumeration>
|
298 |
+
<xsd:enumeration value="menufile">
|
299 |
+
<xsd:annotation>
|
300 |
+
<xsd:documentation>Indicates a file containing menu.</xsd:documentation>
|
301 |
+
</xsd:annotation>
|
302 |
+
</xsd:enumeration>
|
303 |
+
<xsd:enumeration value="messagefile">
|
304 |
+
<xsd:annotation>
|
305 |
+
<xsd:documentation>Indicates numerically identified string table.</xsd:documentation>
|
306 |
+
</xsd:annotation>
|
307 |
+
</xsd:enumeration>
|
308 |
+
<xsd:enumeration value="mif">
|
309 |
+
<xsd:annotation>
|
310 |
+
<xsd:documentation>Indicates Maker Interchange Format (MIF) data.</xsd:documentation>
|
311 |
+
</xsd:annotation>
|
312 |
+
</xsd:enumeration>
|
313 |
+
<xsd:enumeration value="mimetype">
|
314 |
+
<xsd:annotation>
|
315 |
+
<xsd:documentation>Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute.</xsd:documentation>
|
316 |
+
</xsd:annotation>
|
317 |
+
</xsd:enumeration>
|
318 |
+
<xsd:enumeration value="mo">
|
319 |
+
<xsd:annotation>
|
320 |
+
<xsd:documentation>Indicates GNU Machine Object data.</xsd:documentation>
|
321 |
+
</xsd:annotation>
|
322 |
+
</xsd:enumeration>
|
323 |
+
<xsd:enumeration value="msglib">
|
324 |
+
<xsd:annotation>
|
325 |
+
<xsd:documentation>Indicates Message Librarian strings created by Novell's Message Librarian Tool.</xsd:documentation>
|
326 |
+
</xsd:annotation>
|
327 |
+
</xsd:enumeration>
|
328 |
+
<xsd:enumeration value="pagefooter">
|
329 |
+
<xsd:annotation>
|
330 |
+
<xsd:documentation>Indicates information to be displayed at the bottom of each page of a document.</xsd:documentation>
|
331 |
+
</xsd:annotation>
|
332 |
+
</xsd:enumeration>
|
333 |
+
<xsd:enumeration value="pageheader">
|
334 |
+
<xsd:annotation>
|
335 |
+
<xsd:documentation>Indicates information to be displayed at the top of each page of a document.</xsd:documentation>
|
336 |
+
</xsd:annotation>
|
337 |
+
</xsd:enumeration>
|
338 |
+
<xsd:enumeration value="parameters">
|
339 |
+
<xsd:annotation>
|
340 |
+
<xsd:documentation>Indicates a list of property values (e.g., settings within INI files or preferences dialog).</xsd:documentation>
|
341 |
+
</xsd:annotation>
|
342 |
+
</xsd:enumeration>
|
343 |
+
<xsd:enumeration value="pascal">
|
344 |
+
<xsd:annotation>
|
345 |
+
<xsd:documentation>Indicates Pascal source file data.</xsd:documentation>
|
346 |
+
</xsd:annotation>
|
347 |
+
</xsd:enumeration>
|
348 |
+
<xsd:enumeration value="php">
|
349 |
+
<xsd:annotation>
|
350 |
+
<xsd:documentation>Indicates Hypertext Preprocessor data.</xsd:documentation>
|
351 |
+
</xsd:annotation>
|
352 |
+
</xsd:enumeration>
|
353 |
+
<xsd:enumeration value="plaintext">
|
354 |
+
<xsd:annotation>
|
355 |
+
<xsd:documentation>Indicates plain text file (no formatting other than, possibly, wrapping).</xsd:documentation>
|
356 |
+
</xsd:annotation>
|
357 |
+
</xsd:enumeration>
|
358 |
+
<xsd:enumeration value="po">
|
359 |
+
<xsd:annotation>
|
360 |
+
<xsd:documentation>Indicates GNU Portable Object file.</xsd:documentation>
|
361 |
+
</xsd:annotation>
|
362 |
+
</xsd:enumeration>
|
363 |
+
<xsd:enumeration value="report">
|
364 |
+
<xsd:annotation>
|
365 |
+
<xsd:documentation>Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc.</xsd:documentation>
|
366 |
+
</xsd:annotation>
|
367 |
+
</xsd:enumeration>
|
368 |
+
<xsd:enumeration value="resources">
|
369 |
+
<xsd:annotation>
|
370 |
+
<xsd:documentation>Indicates Windows .NET binary resources.</xsd:documentation>
|
371 |
+
</xsd:annotation>
|
372 |
+
</xsd:enumeration>
|
373 |
+
<xsd:enumeration value="resx">
|
374 |
+
<xsd:annotation>
|
375 |
+
<xsd:documentation>Indicates Windows .NET Resources.</xsd:documentation>
|
376 |
+
</xsd:annotation>
|
377 |
+
</xsd:enumeration>
|
378 |
+
<xsd:enumeration value="rtf">
|
379 |
+
<xsd:annotation>
|
380 |
+
<xsd:documentation>Indicates Rich Text Format (RTF) data.</xsd:documentation>
|
381 |
+
</xsd:annotation>
|
382 |
+
</xsd:enumeration>
|
383 |
+
<xsd:enumeration value="sgml">
|
384 |
+
<xsd:annotation>
|
385 |
+
<xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - document instance.</xsd:documentation>
|
386 |
+
</xsd:annotation>
|
387 |
+
</xsd:enumeration>
|
388 |
+
<xsd:enumeration value="sgmldtd">
|
389 |
+
<xsd:annotation>
|
390 |
+
<xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD).</xsd:documentation>
|
391 |
+
</xsd:annotation>
|
392 |
+
</xsd:enumeration>
|
393 |
+
<xsd:enumeration value="svg">
|
394 |
+
<xsd:annotation>
|
395 |
+
<xsd:documentation>Indicates Scalable Vector Graphic (SVG) data.</xsd:documentation>
|
396 |
+
</xsd:annotation>
|
397 |
+
</xsd:enumeration>
|
398 |
+
<xsd:enumeration value="vbscript">
|
399 |
+
<xsd:annotation>
|
400 |
+
<xsd:documentation>Indicates VisualBasic Script source file.</xsd:documentation>
|
401 |
+
</xsd:annotation>
|
402 |
+
</xsd:enumeration>
|
403 |
+
<xsd:enumeration value="warning">
|
404 |
+
<xsd:annotation>
|
405 |
+
<xsd:documentation>Indicates warning message.</xsd:documentation>
|
406 |
+
</xsd:annotation>
|
407 |
+
</xsd:enumeration>
|
408 |
+
<xsd:enumeration value="winres">
|
409 |
+
<xsd:annotation>
|
410 |
+
<xsd:documentation>Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file).</xsd:documentation>
|
411 |
+
</xsd:annotation>
|
412 |
+
</xsd:enumeration>
|
413 |
+
<xsd:enumeration value="xhtml">
|
414 |
+
<xsd:annotation>
|
415 |
+
<xsd:documentation>Indicates Extensible HyperText Markup Language (XHTML) data - document instance.</xsd:documentation>
|
416 |
+
</xsd:annotation>
|
417 |
+
</xsd:enumeration>
|
418 |
+
<xsd:enumeration value="xml">
|
419 |
+
<xsd:annotation>
|
420 |
+
<xsd:documentation>Indicates Extensible Markup Language (XML) data - document instance.</xsd:documentation>
|
421 |
+
</xsd:annotation>
|
422 |
+
</xsd:enumeration>
|
423 |
+
<xsd:enumeration value="xmldtd">
|
424 |
+
<xsd:annotation>
|
425 |
+
<xsd:documentation>Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD).</xsd:documentation>
|
426 |
+
</xsd:annotation>
|
427 |
+
</xsd:enumeration>
|
428 |
+
<xsd:enumeration value="xsl">
|
429 |
+
<xsd:annotation>
|
430 |
+
<xsd:documentation>Indicates Extensible Stylesheet Language (XSL) data.</xsd:documentation>
|
431 |
+
</xsd:annotation>
|
432 |
+
</xsd:enumeration>
|
433 |
+
<xsd:enumeration value="xul">
|
434 |
+
<xsd:annotation>
|
435 |
+
<xsd:documentation>Indicates XUL elements.</xsd:documentation>
|
436 |
+
</xsd:annotation>
|
437 |
+
</xsd:enumeration>
|
438 |
+
</xsd:restriction>
|
439 |
+
</xsd:simpleType>
|
440 |
+
<xsd:simpleType name="mtypeValueList">
|
441 |
+
<xsd:annotation>
|
442 |
+
<xsd:documentation>Values for the attribute 'mtype'.</xsd:documentation>
|
443 |
+
</xsd:annotation>
|
444 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
445 |
+
<xsd:enumeration value="abbrev">
|
446 |
+
<xsd:annotation>
|
447 |
+
<xsd:documentation>Indicates the marked text is an abbreviation.</xsd:documentation>
|
448 |
+
</xsd:annotation>
|
449 |
+
</xsd:enumeration>
|
450 |
+
<xsd:enumeration value="abbreviated-form">
|
451 |
+
<xsd:annotation>
|
452 |
+
<xsd:documentation>ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept.</xsd:documentation>
|
453 |
+
</xsd:annotation>
|
454 |
+
</xsd:enumeration>
|
455 |
+
<xsd:enumeration value="abbreviation">
|
456 |
+
<xsd:annotation>
|
457 |
+
<xsd:documentation>ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective').</xsd:documentation>
|
458 |
+
</xsd:annotation>
|
459 |
+
</xsd:enumeration>
|
460 |
+
<xsd:enumeration value="acronym">
|
461 |
+
<xsd:annotation>
|
462 |
+
<xsd:documentation>ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging').</xsd:documentation>
|
463 |
+
</xsd:annotation>
|
464 |
+
</xsd:enumeration>
|
465 |
+
<xsd:enumeration value="appellation">
|
466 |
+
<xsd:annotation>
|
467 |
+
<xsd:documentation>ISO-12620: A proper-name term, such as the name of an agency or other proper entity.</xsd:documentation>
|
468 |
+
</xsd:annotation>
|
469 |
+
</xsd:enumeration>
|
470 |
+
<xsd:enumeration value="collocation">
|
471 |
+
<xsd:annotation>
|
472 |
+
<xsd:documentation>ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another.</xsd:documentation>
|
473 |
+
</xsd:annotation>
|
474 |
+
</xsd:enumeration>
|
475 |
+
<xsd:enumeration value="common-name">
|
476 |
+
<xsd:annotation>
|
477 |
+
<xsd:documentation>ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language.</xsd:documentation>
|
478 |
+
</xsd:annotation>
|
479 |
+
</xsd:enumeration>
|
480 |
+
<xsd:enumeration value="datetime">
|
481 |
+
<xsd:annotation>
|
482 |
+
<xsd:documentation>Indicates the marked text is a date and/or time.</xsd:documentation>
|
483 |
+
</xsd:annotation>
|
484 |
+
</xsd:enumeration>
|
485 |
+
<xsd:enumeration value="equation">
|
486 |
+
<xsd:annotation>
|
487 |
+
<xsd:documentation>ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign.</xsd:documentation>
|
488 |
+
</xsd:annotation>
|
489 |
+
</xsd:enumeration>
|
490 |
+
<xsd:enumeration value="expanded-form">
|
491 |
+
<xsd:annotation>
|
492 |
+
<xsd:documentation>ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form.</xsd:documentation>
|
493 |
+
</xsd:annotation>
|
494 |
+
</xsd:enumeration>
|
495 |
+
<xsd:enumeration value="formula">
|
496 |
+
<xsd:annotation>
|
497 |
+
<xsd:documentation>ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula.</xsd:documentation>
|
498 |
+
</xsd:annotation>
|
499 |
+
</xsd:enumeration>
|
500 |
+
<xsd:enumeration value="head-term">
|
501 |
+
<xsd:annotation>
|
502 |
+
<xsd:documentation>ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record.</xsd:documentation>
|
503 |
+
</xsd:annotation>
|
504 |
+
</xsd:enumeration>
|
505 |
+
<xsd:enumeration value="initialism">
|
506 |
+
<xsd:annotation>
|
507 |
+
<xsd:documentation>ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy').</xsd:documentation>
|
508 |
+
</xsd:annotation>
|
509 |
+
</xsd:enumeration>
|
510 |
+
<xsd:enumeration value="international-scientific-term">
|
511 |
+
<xsd:annotation>
|
512 |
+
<xsd:documentation>ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body.</xsd:documentation>
|
513 |
+
</xsd:annotation>
|
514 |
+
</xsd:enumeration>
|
515 |
+
<xsd:enumeration value="internationalism">
|
516 |
+
<xsd:annotation>
|
517 |
+
<xsd:documentation>ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages.</xsd:documentation>
|
518 |
+
</xsd:annotation>
|
519 |
+
</xsd:enumeration>
|
520 |
+
<xsd:enumeration value="logical-expression">
|
521 |
+
<xsd:annotation>
|
522 |
+
<xsd:documentation>ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like.</xsd:documentation>
|
523 |
+
</xsd:annotation>
|
524 |
+
</xsd:enumeration>
|
525 |
+
<xsd:enumeration value="materials-management-unit">
|
526 |
+
<xsd:annotation>
|
527 |
+
<xsd:documentation>ISO-12620 2.1.17: A unit to track object.</xsd:documentation>
|
528 |
+
</xsd:annotation>
|
529 |
+
</xsd:enumeration>
|
530 |
+
<xsd:enumeration value="name">
|
531 |
+
<xsd:annotation>
|
532 |
+
<xsd:documentation>Indicates the marked text is a name.</xsd:documentation>
|
533 |
+
</xsd:annotation>
|
534 |
+
</xsd:enumeration>
|
535 |
+
<xsd:enumeration value="near-synonym">
|
536 |
+
<xsd:annotation>
|
537 |
+
<xsd:documentation>ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others.</xsd:documentation>
|
538 |
+
</xsd:annotation>
|
539 |
+
</xsd:enumeration>
|
540 |
+
<xsd:enumeration value="part-number">
|
541 |
+
<xsd:annotation>
|
542 |
+
<xsd:documentation>ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system.</xsd:documentation>
|
543 |
+
</xsd:annotation>
|
544 |
+
</xsd:enumeration>
|
545 |
+
<xsd:enumeration value="phrase">
|
546 |
+
<xsd:annotation>
|
547 |
+
<xsd:documentation>Indicates the marked text is a phrase.</xsd:documentation>
|
548 |
+
</xsd:annotation>
|
549 |
+
</xsd:enumeration>
|
550 |
+
<xsd:enumeration value="phraseological-unit">
|
551 |
+
<xsd:annotation>
|
552 |
+
<xsd:documentation>ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase.</xsd:documentation>
|
553 |
+
</xsd:annotation>
|
554 |
+
</xsd:enumeration>
|
555 |
+
<xsd:enumeration value="protected">
|
556 |
+
<xsd:annotation>
|
557 |
+
<xsd:documentation>Indicates the marked text should not be translated.</xsd:documentation>
|
558 |
+
</xsd:annotation>
|
559 |
+
</xsd:enumeration>
|
560 |
+
<xsd:enumeration value="romanized-form">
|
561 |
+
<xsd:annotation>
|
562 |
+
<xsd:documentation>ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet.</xsd:documentation>
|
563 |
+
</xsd:annotation>
|
564 |
+
</xsd:enumeration>
|
565 |
+
<xsd:enumeration value="seg">
|
566 |
+
<xsd:annotation>
|
567 |
+
<xsd:documentation>Indicates that the marked text represents a segment.</xsd:documentation>
|
568 |
+
</xsd:annotation>
|
569 |
+
</xsd:enumeration>
|
570 |
+
<xsd:enumeration value="set-phrase">
|
571 |
+
<xsd:annotation>
|
572 |
+
<xsd:documentation>ISO-12620 2.1.18.2: A fixed, lexicalized phrase.</xsd:documentation>
|
573 |
+
</xsd:annotation>
|
574 |
+
</xsd:enumeration>
|
575 |
+
<xsd:enumeration value="short-form">
|
576 |
+
<xsd:annotation>
|
577 |
+
<xsd:documentation>ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs').</xsd:documentation>
|
578 |
+
</xsd:annotation>
|
579 |
+
</xsd:enumeration>
|
580 |
+
<xsd:enumeration value="sku">
|
581 |
+
<xsd:annotation>
|
582 |
+
<xsd:documentation>ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system.</xsd:documentation>
|
583 |
+
</xsd:annotation>
|
584 |
+
</xsd:enumeration>
|
585 |
+
<xsd:enumeration value="standard-text">
|
586 |
+
<xsd:annotation>
|
587 |
+
<xsd:documentation>ISO-12620 2.1.19: A fixed chunk of recurring text.</xsd:documentation>
|
588 |
+
</xsd:annotation>
|
589 |
+
</xsd:enumeration>
|
590 |
+
<xsd:enumeration value="symbol">
|
591 |
+
<xsd:annotation>
|
592 |
+
<xsd:documentation>ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof.</xsd:documentation>
|
593 |
+
</xsd:annotation>
|
594 |
+
</xsd:enumeration>
|
595 |
+
<xsd:enumeration value="synonym">
|
596 |
+
<xsd:annotation>
|
597 |
+
<xsd:documentation>ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry.</xsd:documentation>
|
598 |
+
</xsd:annotation>
|
599 |
+
</xsd:enumeration>
|
600 |
+
<xsd:enumeration value="synonymous-phrase">
|
601 |
+
<xsd:annotation>
|
602 |
+
<xsd:documentation>ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language.</xsd:documentation>
|
603 |
+
</xsd:annotation>
|
604 |
+
</xsd:enumeration>
|
605 |
+
<xsd:enumeration value="term">
|
606 |
+
<xsd:annotation>
|
607 |
+
<xsd:documentation>Indicates the marked text is a term.</xsd:documentation>
|
608 |
+
</xsd:annotation>
|
609 |
+
</xsd:enumeration>
|
610 |
+
<xsd:enumeration value="transcribed-form">
|
611 |
+
<xsd:annotation>
|
612 |
+
<xsd:documentation>ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted.</xsd:documentation>
|
613 |
+
</xsd:annotation>
|
614 |
+
</xsd:enumeration>
|
615 |
+
<xsd:enumeration value="transliterated-form">
|
616 |
+
<xsd:annotation>
|
617 |
+
<xsd:documentation>ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system.</xsd:documentation>
|
618 |
+
</xsd:annotation>
|
619 |
+
</xsd:enumeration>
|
620 |
+
<xsd:enumeration value="truncated-term">
|
621 |
+
<xsd:annotation>
|
622 |
+
<xsd:documentation>ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza').</xsd:documentation>
|
623 |
+
</xsd:annotation>
|
624 |
+
</xsd:enumeration>
|
625 |
+
<xsd:enumeration value="variant">
|
626 |
+
<xsd:annotation>
|
627 |
+
<xsd:documentation>ISO-12620 2.1.9: One of the alternate forms of a term.</xsd:documentation>
|
628 |
+
</xsd:annotation>
|
629 |
+
</xsd:enumeration>
|
630 |
+
</xsd:restriction>
|
631 |
+
</xsd:simpleType>
|
632 |
+
<xsd:simpleType name="restypeValueList">
|
633 |
+
<xsd:annotation>
|
634 |
+
<xsd:documentation>Values for the attribute 'restype'.</xsd:documentation>
|
635 |
+
</xsd:annotation>
|
636 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
637 |
+
<xsd:enumeration value="auto3state">
|
638 |
+
<xsd:annotation>
|
639 |
+
<xsd:documentation>Indicates a Windows RC AUTO3STATE control.</xsd:documentation>
|
640 |
+
</xsd:annotation>
|
641 |
+
</xsd:enumeration>
|
642 |
+
<xsd:enumeration value="autocheckbox">
|
643 |
+
<xsd:annotation>
|
644 |
+
<xsd:documentation>Indicates a Windows RC AUTOCHECKBOX control.</xsd:documentation>
|
645 |
+
</xsd:annotation>
|
646 |
+
</xsd:enumeration>
|
647 |
+
<xsd:enumeration value="autoradiobutton">
|
648 |
+
<xsd:annotation>
|
649 |
+
<xsd:documentation>Indicates a Windows RC AUTORADIOBUTTON control.</xsd:documentation>
|
650 |
+
</xsd:annotation>
|
651 |
+
</xsd:enumeration>
|
652 |
+
<xsd:enumeration value="bedit">
|
653 |
+
<xsd:annotation>
|
654 |
+
<xsd:documentation>Indicates a Windows RC BEDIT control.</xsd:documentation>
|
655 |
+
</xsd:annotation>
|
656 |
+
</xsd:enumeration>
|
657 |
+
<xsd:enumeration value="bitmap">
|
658 |
+
<xsd:annotation>
|
659 |
+
<xsd:documentation>Indicates a bitmap, for example a BITMAP resource in Windows.</xsd:documentation>
|
660 |
+
</xsd:annotation>
|
661 |
+
</xsd:enumeration>
|
662 |
+
<xsd:enumeration value="button">
|
663 |
+
<xsd:annotation>
|
664 |
+
<xsd:documentation>Indicates a button object, for example a BUTTON control Windows.</xsd:documentation>
|
665 |
+
</xsd:annotation>
|
666 |
+
</xsd:enumeration>
|
667 |
+
<xsd:enumeration value="caption">
|
668 |
+
<xsd:annotation>
|
669 |
+
<xsd:documentation>Indicates a caption, such as the caption of a dialog box.</xsd:documentation>
|
670 |
+
</xsd:annotation>
|
671 |
+
</xsd:enumeration>
|
672 |
+
<xsd:enumeration value="cell">
|
673 |
+
<xsd:annotation>
|
674 |
+
<xsd:documentation>Indicates the cell in a table, for example the content of the <td> element in HTML.</xsd:documentation>
|
675 |
+
</xsd:annotation>
|
676 |
+
</xsd:enumeration>
|
677 |
+
<xsd:enumeration value="checkbox">
|
678 |
+
<xsd:annotation>
|
679 |
+
<xsd:documentation>Indicates check box object, for example a CHECKBOX control in Windows.</xsd:documentation>
|
680 |
+
</xsd:annotation>
|
681 |
+
</xsd:enumeration>
|
682 |
+
<xsd:enumeration value="checkboxmenuitem">
|
683 |
+
<xsd:annotation>
|
684 |
+
<xsd:documentation>Indicates a menu item with an associated checkbox.</xsd:documentation>
|
685 |
+
</xsd:annotation>
|
686 |
+
</xsd:enumeration>
|
687 |
+
<xsd:enumeration value="checkedlistbox">
|
688 |
+
<xsd:annotation>
|
689 |
+
<xsd:documentation>Indicates a list box, but with a check-box for each item.</xsd:documentation>
|
690 |
+
</xsd:annotation>
|
691 |
+
</xsd:enumeration>
|
692 |
+
<xsd:enumeration value="colorchooser">
|
693 |
+
<xsd:annotation>
|
694 |
+
<xsd:documentation>Indicates a color selection dialog.</xsd:documentation>
|
695 |
+
</xsd:annotation>
|
696 |
+
</xsd:enumeration>
|
697 |
+
<xsd:enumeration value="combobox">
|
698 |
+
<xsd:annotation>
|
699 |
+
<xsd:documentation>Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows.</xsd:documentation>
|
700 |
+
</xsd:annotation>
|
701 |
+
</xsd:enumeration>
|
702 |
+
<xsd:enumeration value="comboboxexitem">
|
703 |
+
<xsd:annotation>
|
704 |
+
<xsd:documentation>Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234).</xsd:documentation>
|
705 |
+
</xsd:annotation>
|
706 |
+
</xsd:enumeration>
|
707 |
+
<xsd:enumeration value="comboboxitem">
|
708 |
+
<xsd:annotation>
|
709 |
+
<xsd:documentation>Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403).</xsd:documentation>
|
710 |
+
</xsd:annotation>
|
711 |
+
</xsd:enumeration>
|
712 |
+
<xsd:enumeration value="component">
|
713 |
+
<xsd:annotation>
|
714 |
+
<xsd:documentation>Indicates a UI base class element that cannot be represented by any other element.</xsd:documentation>
|
715 |
+
</xsd:annotation>
|
716 |
+
</xsd:enumeration>
|
717 |
+
<xsd:enumeration value="contextmenu">
|
718 |
+
<xsd:annotation>
|
719 |
+
<xsd:documentation>Indicates a context menu.</xsd:documentation>
|
720 |
+
</xsd:annotation>
|
721 |
+
</xsd:enumeration>
|
722 |
+
<xsd:enumeration value="ctext">
|
723 |
+
<xsd:annotation>
|
724 |
+
<xsd:documentation>Indicates a Windows RC CTEXT control.</xsd:documentation>
|
725 |
+
</xsd:annotation>
|
726 |
+
</xsd:enumeration>
|
727 |
+
<xsd:enumeration value="cursor">
|
728 |
+
<xsd:annotation>
|
729 |
+
<xsd:documentation>Indicates a cursor, for example a CURSOR resource in Windows.</xsd:documentation>
|
730 |
+
</xsd:annotation>
|
731 |
+
</xsd:enumeration>
|
732 |
+
<xsd:enumeration value="datetimepicker">
|
733 |
+
<xsd:annotation>
|
734 |
+
<xsd:documentation>Indicates a date/time picker.</xsd:documentation>
|
735 |
+
</xsd:annotation>
|
736 |
+
</xsd:enumeration>
|
737 |
+
<xsd:enumeration value="defpushbutton">
|
738 |
+
<xsd:annotation>
|
739 |
+
<xsd:documentation>Indicates a Windows RC DEFPUSHBUTTON control.</xsd:documentation>
|
740 |
+
</xsd:annotation>
|
741 |
+
</xsd:enumeration>
|
742 |
+
<xsd:enumeration value="dialog">
|
743 |
+
<xsd:annotation>
|
744 |
+
<xsd:documentation>Indicates a dialog box.</xsd:documentation>
|
745 |
+
</xsd:annotation>
|
746 |
+
</xsd:enumeration>
|
747 |
+
<xsd:enumeration value="dlginit">
|
748 |
+
<xsd:annotation>
|
749 |
+
<xsd:documentation>Indicates a Windows RC DLGINIT resource block.</xsd:documentation>
|
750 |
+
</xsd:annotation>
|
751 |
+
</xsd:enumeration>
|
752 |
+
<xsd:enumeration value="edit">
|
753 |
+
<xsd:annotation>
|
754 |
+
<xsd:documentation>Indicates an edit box object, for example an EDIT control in Windows.</xsd:documentation>
|
755 |
+
</xsd:annotation>
|
756 |
+
</xsd:enumeration>
|
757 |
+
<xsd:enumeration value="file">
|
758 |
+
<xsd:annotation>
|
759 |
+
<xsd:documentation>Indicates a filename.</xsd:documentation>
|
760 |
+
</xsd:annotation>
|
761 |
+
</xsd:enumeration>
|
762 |
+
<xsd:enumeration value="filechooser">
|
763 |
+
<xsd:annotation>
|
764 |
+
<xsd:documentation>Indicates a file dialog.</xsd:documentation>
|
765 |
+
</xsd:annotation>
|
766 |
+
</xsd:enumeration>
|
767 |
+
<xsd:enumeration value="fn">
|
768 |
+
<xsd:annotation>
|
769 |
+
<xsd:documentation>Indicates a footnote.</xsd:documentation>
|
770 |
+
</xsd:annotation>
|
771 |
+
</xsd:enumeration>
|
772 |
+
<xsd:enumeration value="font">
|
773 |
+
<xsd:annotation>
|
774 |
+
<xsd:documentation>Indicates a font name.</xsd:documentation>
|
775 |
+
</xsd:annotation>
|
776 |
+
</xsd:enumeration>
|
777 |
+
<xsd:enumeration value="footer">
|
778 |
+
<xsd:annotation>
|
779 |
+
<xsd:documentation>Indicates a footer.</xsd:documentation>
|
780 |
+
</xsd:annotation>
|
781 |
+
</xsd:enumeration>
|
782 |
+
<xsd:enumeration value="frame">
|
783 |
+
<xsd:annotation>
|
784 |
+
<xsd:documentation>Indicates a frame object.</xsd:documentation>
|
785 |
+
</xsd:annotation>
|
786 |
+
</xsd:enumeration>
|
787 |
+
<xsd:enumeration value="grid">
|
788 |
+
<xsd:annotation>
|
789 |
+
<xsd:documentation>Indicates a XUL grid element.</xsd:documentation>
|
790 |
+
</xsd:annotation>
|
791 |
+
</xsd:enumeration>
|
792 |
+
<xsd:enumeration value="groupbox">
|
793 |
+
<xsd:annotation>
|
794 |
+
<xsd:documentation>Indicates a groupbox object, for example a GROUPBOX control in Windows.</xsd:documentation>
|
795 |
+
</xsd:annotation>
|
796 |
+
</xsd:enumeration>
|
797 |
+
<xsd:enumeration value="header">
|
798 |
+
<xsd:annotation>
|
799 |
+
<xsd:documentation>Indicates a header item.</xsd:documentation>
|
800 |
+
</xsd:annotation>
|
801 |
+
</xsd:enumeration>
|
802 |
+
<xsd:enumeration value="heading">
|
803 |
+
<xsd:annotation>
|
804 |
+
<xsd:documentation>Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML.</xsd:documentation>
|
805 |
+
</xsd:annotation>
|
806 |
+
</xsd:enumeration>
|
807 |
+
<xsd:enumeration value="hedit">
|
808 |
+
<xsd:annotation>
|
809 |
+
<xsd:documentation>Indicates a Windows RC HEDIT control.</xsd:documentation>
|
810 |
+
</xsd:annotation>
|
811 |
+
</xsd:enumeration>
|
812 |
+
<xsd:enumeration value="hscrollbar">
|
813 |
+
<xsd:annotation>
|
814 |
+
<xsd:documentation>Indicates a horizontal scrollbar.</xsd:documentation>
|
815 |
+
</xsd:annotation>
|
816 |
+
</xsd:enumeration>
|
817 |
+
<xsd:enumeration value="icon">
|
818 |
+
<xsd:annotation>
|
819 |
+
<xsd:documentation>Indicates an icon, for example an ICON resource in Windows.</xsd:documentation>
|
820 |
+
</xsd:annotation>
|
821 |
+
</xsd:enumeration>
|
822 |
+
<xsd:enumeration value="iedit">
|
823 |
+
<xsd:annotation>
|
824 |
+
<xsd:documentation>Indicates a Windows RC IEDIT control.</xsd:documentation>
|
825 |
+
</xsd:annotation>
|
826 |
+
</xsd:enumeration>
|
827 |
+
<xsd:enumeration value="keywords">
|
828 |
+
<xsd:annotation>
|
829 |
+
<xsd:documentation>Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF.</xsd:documentation>
|
830 |
+
</xsd:annotation>
|
831 |
+
</xsd:enumeration>
|
832 |
+
<xsd:enumeration value="label">
|
833 |
+
<xsd:annotation>
|
834 |
+
<xsd:documentation>Indicates a label object.</xsd:documentation>
|
835 |
+
</xsd:annotation>
|
836 |
+
</xsd:enumeration>
|
837 |
+
<xsd:enumeration value="linklabel">
|
838 |
+
<xsd:annotation>
|
839 |
+
<xsd:documentation>Indicates a label that is also a HTML link (not necessarily a URL).</xsd:documentation>
|
840 |
+
</xsd:annotation>
|
841 |
+
</xsd:enumeration>
|
842 |
+
<xsd:enumeration value="list">
|
843 |
+
<xsd:annotation>
|
844 |
+
<xsd:documentation>Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML).</xsd:documentation>
|
845 |
+
</xsd:annotation>
|
846 |
+
</xsd:enumeration>
|
847 |
+
<xsd:enumeration value="listbox">
|
848 |
+
<xsd:annotation>
|
849 |
+
<xsd:documentation>Indicates a listbox object, for example an LISTBOX control in Windows.</xsd:documentation>
|
850 |
+
</xsd:annotation>
|
851 |
+
</xsd:enumeration>
|
852 |
+
<xsd:enumeration value="listitem">
|
853 |
+
<xsd:annotation>
|
854 |
+
<xsd:documentation>Indicates an list item (an entry in a list).</xsd:documentation>
|
855 |
+
</xsd:annotation>
|
856 |
+
</xsd:enumeration>
|
857 |
+
<xsd:enumeration value="ltext">
|
858 |
+
<xsd:annotation>
|
859 |
+
<xsd:documentation>Indicates a Windows RC LTEXT control.</xsd:documentation>
|
860 |
+
</xsd:annotation>
|
861 |
+
</xsd:enumeration>
|
862 |
+
<xsd:enumeration value="menu">
|
863 |
+
<xsd:annotation>
|
864 |
+
<xsd:documentation>Indicates a menu (a group of menu-items).</xsd:documentation>
|
865 |
+
</xsd:annotation>
|
866 |
+
</xsd:enumeration>
|
867 |
+
<xsd:enumeration value="menubar">
|
868 |
+
<xsd:annotation>
|
869 |
+
<xsd:documentation>Indicates a toolbar containing one or more tope level menus.</xsd:documentation>
|
870 |
+
</xsd:annotation>
|
871 |
+
</xsd:enumeration>
|
872 |
+
<xsd:enumeration value="menuitem">
|
873 |
+
<xsd:annotation>
|
874 |
+
<xsd:documentation>Indicates a menu item (an entry in a menu).</xsd:documentation>
|
875 |
+
</xsd:annotation>
|
876 |
+
</xsd:enumeration>
|
877 |
+
<xsd:enumeration value="menuseparator">
|
878 |
+
<xsd:annotation>
|
879 |
+
<xsd:documentation>Indicates a XUL menuseparator element.</xsd:documentation>
|
880 |
+
</xsd:annotation>
|
881 |
+
</xsd:enumeration>
|
882 |
+
<xsd:enumeration value="message">
|
883 |
+
<xsd:annotation>
|
884 |
+
<xsd:documentation>Indicates a message, for example an entry in a MESSAGETABLE resource in Windows.</xsd:documentation>
|
885 |
+
</xsd:annotation>
|
886 |
+
</xsd:enumeration>
|
887 |
+
<xsd:enumeration value="monthcalendar">
|
888 |
+
<xsd:annotation>
|
889 |
+
<xsd:documentation>Indicates a calendar control.</xsd:documentation>
|
890 |
+
</xsd:annotation>
|
891 |
+
</xsd:enumeration>
|
892 |
+
<xsd:enumeration value="numericupdown">
|
893 |
+
<xsd:annotation>
|
894 |
+
<xsd:documentation>Indicates an edit box beside a spin control.</xsd:documentation>
|
895 |
+
</xsd:annotation>
|
896 |
+
</xsd:enumeration>
|
897 |
+
<xsd:enumeration value="panel">
|
898 |
+
<xsd:annotation>
|
899 |
+
<xsd:documentation>Indicates a catch all for rectangular areas.</xsd:documentation>
|
900 |
+
</xsd:annotation>
|
901 |
+
</xsd:enumeration>
|
902 |
+
<xsd:enumeration value="popupmenu">
|
903 |
+
<xsd:annotation>
|
904 |
+
<xsd:documentation>Indicates a standalone menu not necessarily associated with a menubar.</xsd:documentation>
|
905 |
+
</xsd:annotation>
|
906 |
+
</xsd:enumeration>
|
907 |
+
<xsd:enumeration value="pushbox">
|
908 |
+
<xsd:annotation>
|
909 |
+
<xsd:documentation>Indicates a pushbox object, for example a PUSHBOX control in Windows.</xsd:documentation>
|
910 |
+
</xsd:annotation>
|
911 |
+
</xsd:enumeration>
|
912 |
+
<xsd:enumeration value="pushbutton">
|
913 |
+
<xsd:annotation>
|
914 |
+
<xsd:documentation>Indicates a Windows RC PUSHBUTTON control.</xsd:documentation>
|
915 |
+
</xsd:annotation>
|
916 |
+
</xsd:enumeration>
|
917 |
+
<xsd:enumeration value="radio">
|
918 |
+
<xsd:annotation>
|
919 |
+
<xsd:documentation>Indicates a radio button object.</xsd:documentation>
|
920 |
+
</xsd:annotation>
|
921 |
+
</xsd:enumeration>
|
922 |
+
<xsd:enumeration value="radiobuttonmenuitem">
|
923 |
+
<xsd:annotation>
|
924 |
+
<xsd:documentation>Indicates a menuitem with associated radio button.</xsd:documentation>
|
925 |
+
</xsd:annotation>
|
926 |
+
</xsd:enumeration>
|
927 |
+
<xsd:enumeration value="rcdata">
|
928 |
+
<xsd:annotation>
|
929 |
+
<xsd:documentation>Indicates raw data resources for an application.</xsd:documentation>
|
930 |
+
</xsd:annotation>
|
931 |
+
</xsd:enumeration>
|
932 |
+
<xsd:enumeration value="row">
|
933 |
+
<xsd:annotation>
|
934 |
+
<xsd:documentation>Indicates a row in a table.</xsd:documentation>
|
935 |
+
</xsd:annotation>
|
936 |
+
</xsd:enumeration>
|
937 |
+
<xsd:enumeration value="rtext">
|
938 |
+
<xsd:annotation>
|
939 |
+
<xsd:documentation>Indicates a Windows RC RTEXT control.</xsd:documentation>
|
940 |
+
</xsd:annotation>
|
941 |
+
</xsd:enumeration>
|
942 |
+
<xsd:enumeration value="scrollpane">
|
943 |
+
<xsd:annotation>
|
944 |
+
<xsd:documentation>Indicates a user navigable container used to show a portion of a document.</xsd:documentation>
|
945 |
+
</xsd:annotation>
|
946 |
+
</xsd:enumeration>
|
947 |
+
<xsd:enumeration value="separator">
|
948 |
+
<xsd:annotation>
|
949 |
+
<xsd:documentation>Indicates a generic divider object (e.g. menu group separator).</xsd:documentation>
|
950 |
+
</xsd:annotation>
|
951 |
+
</xsd:enumeration>
|
952 |
+
<xsd:enumeration value="shortcut">
|
953 |
+
<xsd:annotation>
|
954 |
+
<xsd:documentation>Windows accelerators, shortcuts in resource or property files.</xsd:documentation>
|
955 |
+
</xsd:annotation>
|
956 |
+
</xsd:enumeration>
|
957 |
+
<xsd:enumeration value="spinner">
|
958 |
+
<xsd:annotation>
|
959 |
+
<xsd:documentation>Indicates a UI control to indicate process activity but not progress.</xsd:documentation>
|
960 |
+
</xsd:annotation>
|
961 |
+
</xsd:enumeration>
|
962 |
+
<xsd:enumeration value="splitter">
|
963 |
+
<xsd:annotation>
|
964 |
+
<xsd:documentation>Indicates a splitter bar.</xsd:documentation>
|
965 |
+
</xsd:annotation>
|
966 |
+
</xsd:enumeration>
|
967 |
+
<xsd:enumeration value="state3">
|
968 |
+
<xsd:annotation>
|
969 |
+
<xsd:documentation>Indicates a Windows RC STATE3 control.</xsd:documentation>
|
970 |
+
</xsd:annotation>
|
971 |
+
</xsd:enumeration>
|
972 |
+
<xsd:enumeration value="statusbar">
|
973 |
+
<xsd:annotation>
|
974 |
+
<xsd:documentation>Indicates a window for providing feedback to the users, like 'read-only', etc.</xsd:documentation>
|
975 |
+
</xsd:annotation>
|
976 |
+
</xsd:enumeration>
|
977 |
+
<xsd:enumeration value="string">
|
978 |
+
<xsd:annotation>
|
979 |
+
<xsd:documentation>Indicates a string, for example an entry in a STRINGTABLE resource in Windows.</xsd:documentation>
|
980 |
+
</xsd:annotation>
|
981 |
+
</xsd:enumeration>
|
982 |
+
<xsd:enumeration value="tabcontrol">
|
983 |
+
<xsd:annotation>
|
984 |
+
<xsd:documentation>Indicates a layers of controls with a tab to select layers.</xsd:documentation>
|
985 |
+
</xsd:annotation>
|
986 |
+
</xsd:enumeration>
|
987 |
+
<xsd:enumeration value="table">
|
988 |
+
<xsd:annotation>
|
989 |
+
<xsd:documentation>Indicates a display and edits regular two-dimensional tables of cells.</xsd:documentation>
|
990 |
+
</xsd:annotation>
|
991 |
+
</xsd:enumeration>
|
992 |
+
<xsd:enumeration value="textbox">
|
993 |
+
<xsd:annotation>
|
994 |
+
<xsd:documentation>Indicates a XUL textbox element.</xsd:documentation>
|
995 |
+
</xsd:annotation>
|
996 |
+
</xsd:enumeration>
|
997 |
+
<xsd:enumeration value="togglebutton">
|
998 |
+
<xsd:annotation>
|
999 |
+
<xsd:documentation>Indicates a UI button that can be toggled to on or off state.</xsd:documentation>
|
1000 |
+
</xsd:annotation>
|
1001 |
+
</xsd:enumeration>
|
1002 |
+
<xsd:enumeration value="toolbar">
|
1003 |
+
<xsd:annotation>
|
1004 |
+
<xsd:documentation>Indicates an array of controls, usually buttons.</xsd:documentation>
|
1005 |
+
</xsd:annotation>
|
1006 |
+
</xsd:enumeration>
|
1007 |
+
<xsd:enumeration value="tooltip">
|
1008 |
+
<xsd:annotation>
|
1009 |
+
<xsd:documentation>Indicates a pop up tool tip text.</xsd:documentation>
|
1010 |
+
</xsd:annotation>
|
1011 |
+
</xsd:enumeration>
|
1012 |
+
<xsd:enumeration value="trackbar">
|
1013 |
+
<xsd:annotation>
|
1014 |
+
<xsd:documentation>Indicates a bar with a pointer indicating a position within a certain range.</xsd:documentation>
|
1015 |
+
</xsd:annotation>
|
1016 |
+
</xsd:enumeration>
|
1017 |
+
<xsd:enumeration value="tree">
|
1018 |
+
<xsd:annotation>
|
1019 |
+
<xsd:documentation>Indicates a control that displays a set of hierarchical data.</xsd:documentation>
|
1020 |
+
</xsd:annotation>
|
1021 |
+
</xsd:enumeration>
|
1022 |
+
<xsd:enumeration value="uri">
|
1023 |
+
<xsd:annotation>
|
1024 |
+
<xsd:documentation>Indicates a URI (URN or URL).</xsd:documentation>
|
1025 |
+
</xsd:annotation>
|
1026 |
+
</xsd:enumeration>
|
1027 |
+
<xsd:enumeration value="userbutton">
|
1028 |
+
<xsd:annotation>
|
1029 |
+
<xsd:documentation>Indicates a Windows RC USERBUTTON control.</xsd:documentation>
|
1030 |
+
</xsd:annotation>
|
1031 |
+
</xsd:enumeration>
|
1032 |
+
<xsd:enumeration value="usercontrol">
|
1033 |
+
<xsd:annotation>
|
1034 |
+
<xsd:documentation>Indicates a user-defined control like CONTROL control in Windows.</xsd:documentation>
|
1035 |
+
</xsd:annotation>
|
1036 |
+
</xsd:enumeration>
|
1037 |
+
<xsd:enumeration value="var">
|
1038 |
+
<xsd:annotation>
|
1039 |
+
<xsd:documentation>Indicates the text of a variable.</xsd:documentation>
|
1040 |
+
</xsd:annotation>
|
1041 |
+
</xsd:enumeration>
|
1042 |
+
<xsd:enumeration value="versioninfo">
|
1043 |
+
<xsd:annotation>
|
1044 |
+
<xsd:documentation>Indicates version information about a resource like VERSIONINFO in Windows.</xsd:documentation>
|
1045 |
+
</xsd:annotation>
|
1046 |
+
</xsd:enumeration>
|
1047 |
+
<xsd:enumeration value="vscrollbar">
|
1048 |
+
<xsd:annotation>
|
1049 |
+
<xsd:documentation>Indicates a vertical scrollbar.</xsd:documentation>
|
1050 |
+
</xsd:annotation>
|
1051 |
+
</xsd:enumeration>
|
1052 |
+
<xsd:enumeration value="window">
|
1053 |
+
<xsd:annotation>
|
1054 |
+
<xsd:documentation>Indicates a graphical window.</xsd:documentation>
|
1055 |
+
</xsd:annotation>
|
1056 |
+
</xsd:enumeration>
|
1057 |
+
</xsd:restriction>
|
1058 |
+
</xsd:simpleType>
|
1059 |
+
<xsd:simpleType name="size-unitValueList">
|
1060 |
+
<xsd:annotation>
|
1061 |
+
<xsd:documentation>Values for the attribute 'size-unit'.</xsd:documentation>
|
1062 |
+
</xsd:annotation>
|
1063 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1064 |
+
<xsd:enumeration value="byte">
|
1065 |
+
<xsd:annotation>
|
1066 |
+
<xsd:documentation>Indicates a size in 8-bit bytes.</xsd:documentation>
|
1067 |
+
</xsd:annotation>
|
1068 |
+
</xsd:enumeration>
|
1069 |
+
<xsd:enumeration value="char">
|
1070 |
+
<xsd:annotation>
|
1071 |
+
<xsd:documentation>Indicates a size in Unicode characters.</xsd:documentation>
|
1072 |
+
</xsd:annotation>
|
1073 |
+
</xsd:enumeration>
|
1074 |
+
<xsd:enumeration value="col">
|
1075 |
+
<xsd:annotation>
|
1076 |
+
<xsd:documentation>Indicates a size in columns. Used for HTML text area.</xsd:documentation>
|
1077 |
+
</xsd:annotation>
|
1078 |
+
</xsd:enumeration>
|
1079 |
+
<xsd:enumeration value="cm">
|
1080 |
+
<xsd:annotation>
|
1081 |
+
<xsd:documentation>Indicates a size in centimeters.</xsd:documentation>
|
1082 |
+
</xsd:annotation>
|
1083 |
+
</xsd:enumeration>
|
1084 |
+
<xsd:enumeration value="dlgunit">
|
1085 |
+
<xsd:annotation>
|
1086 |
+
<xsd:documentation>Indicates a size in dialog units, as defined in Windows resources.</xsd:documentation>
|
1087 |
+
</xsd:annotation>
|
1088 |
+
</xsd:enumeration>
|
1089 |
+
<xsd:enumeration value="em">
|
1090 |
+
<xsd:annotation>
|
1091 |
+
<xsd:documentation>Indicates a size in 'font-size' units (as defined in CSS).</xsd:documentation>
|
1092 |
+
</xsd:annotation>
|
1093 |
+
</xsd:enumeration>
|
1094 |
+
<xsd:enumeration value="ex">
|
1095 |
+
<xsd:annotation>
|
1096 |
+
<xsd:documentation>Indicates a size in 'x-height' units (as defined in CSS).</xsd:documentation>
|
1097 |
+
</xsd:annotation>
|
1098 |
+
</xsd:enumeration>
|
1099 |
+
<xsd:enumeration value="glyph">
|
1100 |
+
<xsd:annotation>
|
1101 |
+
<xsd:documentation>Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster'</xsd:documentation>
|
1102 |
+
</xsd:annotation>
|
1103 |
+
</xsd:enumeration>
|
1104 |
+
<xsd:enumeration value="in">
|
1105 |
+
<xsd:annotation>
|
1106 |
+
<xsd:documentation>Indicates a size in inches.</xsd:documentation>
|
1107 |
+
</xsd:annotation>
|
1108 |
+
</xsd:enumeration>
|
1109 |
+
<xsd:enumeration value="mm">
|
1110 |
+
<xsd:annotation>
|
1111 |
+
<xsd:documentation>Indicates a size in millimeters.</xsd:documentation>
|
1112 |
+
</xsd:annotation>
|
1113 |
+
</xsd:enumeration>
|
1114 |
+
<xsd:enumeration value="percent">
|
1115 |
+
<xsd:annotation>
|
1116 |
+
<xsd:documentation>Indicates a size in percentage.</xsd:documentation>
|
1117 |
+
</xsd:annotation>
|
1118 |
+
</xsd:enumeration>
|
1119 |
+
<xsd:enumeration value="pixel">
|
1120 |
+
<xsd:annotation>
|
1121 |
+
<xsd:documentation>Indicates a size in pixels.</xsd:documentation>
|
1122 |
+
</xsd:annotation>
|
1123 |
+
</xsd:enumeration>
|
1124 |
+
<xsd:enumeration value="point">
|
1125 |
+
<xsd:annotation>
|
1126 |
+
<xsd:documentation>Indicates a size in point.</xsd:documentation>
|
1127 |
+
</xsd:annotation>
|
1128 |
+
</xsd:enumeration>
|
1129 |
+
<xsd:enumeration value="row">
|
1130 |
+
<xsd:annotation>
|
1131 |
+
<xsd:documentation>Indicates a size in rows. Used for HTML text area.</xsd:documentation>
|
1132 |
+
</xsd:annotation>
|
1133 |
+
</xsd:enumeration>
|
1134 |
+
</xsd:restriction>
|
1135 |
+
</xsd:simpleType>
|
1136 |
+
<xsd:simpleType name="stateValueList">
|
1137 |
+
<xsd:annotation>
|
1138 |
+
<xsd:documentation>Values for the attribute 'state'.</xsd:documentation>
|
1139 |
+
</xsd:annotation>
|
1140 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1141 |
+
<xsd:enumeration value="final">
|
1142 |
+
<xsd:annotation>
|
1143 |
+
<xsd:documentation>Indicates the terminating state.</xsd:documentation>
|
1144 |
+
</xsd:annotation>
|
1145 |
+
</xsd:enumeration>
|
1146 |
+
<xsd:enumeration value="needs-adaptation">
|
1147 |
+
<xsd:annotation>
|
1148 |
+
<xsd:documentation>Indicates only non-textual information needs adaptation.</xsd:documentation>
|
1149 |
+
</xsd:annotation>
|
1150 |
+
</xsd:enumeration>
|
1151 |
+
<xsd:enumeration value="needs-l10n">
|
1152 |
+
<xsd:annotation>
|
1153 |
+
<xsd:documentation>Indicates both text and non-textual information needs adaptation.</xsd:documentation>
|
1154 |
+
</xsd:annotation>
|
1155 |
+
</xsd:enumeration>
|
1156 |
+
<xsd:enumeration value="needs-review-adaptation">
|
1157 |
+
<xsd:annotation>
|
1158 |
+
<xsd:documentation>Indicates only non-textual information needs review.</xsd:documentation>
|
1159 |
+
</xsd:annotation>
|
1160 |
+
</xsd:enumeration>
|
1161 |
+
<xsd:enumeration value="needs-review-l10n">
|
1162 |
+
<xsd:annotation>
|
1163 |
+
<xsd:documentation>Indicates both text and non-textual information needs review.</xsd:documentation>
|
1164 |
+
</xsd:annotation>
|
1165 |
+
</xsd:enumeration>
|
1166 |
+
<xsd:enumeration value="needs-review-translation">
|
1167 |
+
<xsd:annotation>
|
1168 |
+
<xsd:documentation>Indicates that only the text of the item needs to be reviewed.</xsd:documentation>
|
1169 |
+
</xsd:annotation>
|
1170 |
+
</xsd:enumeration>
|
1171 |
+
<xsd:enumeration value="needs-translation">
|
1172 |
+
<xsd:annotation>
|
1173 |
+
<xsd:documentation>Indicates that the item needs to be translated.</xsd:documentation>
|
1174 |
+
</xsd:annotation>
|
1175 |
+
</xsd:enumeration>
|
1176 |
+
<xsd:enumeration value="new">
|
1177 |
+
<xsd:annotation>
|
1178 |
+
<xsd:documentation>Indicates that the item is new. For example, translation units that were not in a previous version of the document.</xsd:documentation>
|
1179 |
+
</xsd:annotation>
|
1180 |
+
</xsd:enumeration>
|
1181 |
+
<xsd:enumeration value="signed-off">
|
1182 |
+
<xsd:annotation>
|
1183 |
+
<xsd:documentation>Indicates that changes are reviewed and approved.</xsd:documentation>
|
1184 |
+
</xsd:annotation>
|
1185 |
+
</xsd:enumeration>
|
1186 |
+
<xsd:enumeration value="translated">
|
1187 |
+
<xsd:annotation>
|
1188 |
+
<xsd:documentation>Indicates that the item has been translated.</xsd:documentation>
|
1189 |
+
</xsd:annotation>
|
1190 |
+
</xsd:enumeration>
|
1191 |
+
</xsd:restriction>
|
1192 |
+
</xsd:simpleType>
|
1193 |
+
<xsd:simpleType name="state-qualifierValueList">
|
1194 |
+
<xsd:annotation>
|
1195 |
+
<xsd:documentation>Values for the attribute 'state-qualifier'.</xsd:documentation>
|
1196 |
+
</xsd:annotation>
|
1197 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1198 |
+
<xsd:enumeration value="exact-match">
|
1199 |
+
<xsd:annotation>
|
1200 |
+
<xsd:documentation>Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously.</xsd:documentation>
|
1201 |
+
</xsd:annotation>
|
1202 |
+
</xsd:enumeration>
|
1203 |
+
<xsd:enumeration value="fuzzy-match">
|
1204 |
+
<xsd:annotation>
|
1205 |
+
<xsd:documentation>Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.).</xsd:documentation>
|
1206 |
+
</xsd:annotation>
|
1207 |
+
</xsd:enumeration>
|
1208 |
+
<xsd:enumeration value="id-match">
|
1209 |
+
<xsd:annotation>
|
1210 |
+
<xsd:documentation>Indicates a match based on matching IDs (in addition to matching text).</xsd:documentation>
|
1211 |
+
</xsd:annotation>
|
1212 |
+
</xsd:enumeration>
|
1213 |
+
<xsd:enumeration value="leveraged-glossary">
|
1214 |
+
<xsd:annotation>
|
1215 |
+
<xsd:documentation>Indicates a translation derived from a glossary.</xsd:documentation>
|
1216 |
+
</xsd:annotation>
|
1217 |
+
</xsd:enumeration>
|
1218 |
+
<xsd:enumeration value="leveraged-inherited">
|
1219 |
+
<xsd:annotation>
|
1220 |
+
<xsd:documentation>Indicates a translation derived from existing translation.</xsd:documentation>
|
1221 |
+
</xsd:annotation>
|
1222 |
+
</xsd:enumeration>
|
1223 |
+
<xsd:enumeration value="leveraged-mt">
|
1224 |
+
<xsd:annotation>
|
1225 |
+
<xsd:documentation>Indicates a translation derived from machine translation.</xsd:documentation>
|
1226 |
+
</xsd:annotation>
|
1227 |
+
</xsd:enumeration>
|
1228 |
+
<xsd:enumeration value="leveraged-repository">
|
1229 |
+
<xsd:annotation>
|
1230 |
+
<xsd:documentation>Indicates a translation derived from a translation repository.</xsd:documentation>
|
1231 |
+
</xsd:annotation>
|
1232 |
+
</xsd:enumeration>
|
1233 |
+
<xsd:enumeration value="leveraged-tm">
|
1234 |
+
<xsd:annotation>
|
1235 |
+
<xsd:documentation>Indicates a translation derived from a translation memory.</xsd:documentation>
|
1236 |
+
</xsd:annotation>
|
1237 |
+
</xsd:enumeration>
|
1238 |
+
<xsd:enumeration value="mt-suggestion">
|
1239 |
+
<xsd:annotation>
|
1240 |
+
<xsd:documentation>Indicates the translation is suggested by machine translation.</xsd:documentation>
|
1241 |
+
</xsd:annotation>
|
1242 |
+
</xsd:enumeration>
|
1243 |
+
<xsd:enumeration value="rejected-grammar">
|
1244 |
+
<xsd:annotation>
|
1245 |
+
<xsd:documentation>Indicates that the item has been rejected because of incorrect grammar.</xsd:documentation>
|
1246 |
+
</xsd:annotation>
|
1247 |
+
</xsd:enumeration>
|
1248 |
+
<xsd:enumeration value="rejected-inaccurate">
|
1249 |
+
<xsd:annotation>
|
1250 |
+
<xsd:documentation>Indicates that the item has been rejected because it is incorrect.</xsd:documentation>
|
1251 |
+
</xsd:annotation>
|
1252 |
+
</xsd:enumeration>
|
1253 |
+
<xsd:enumeration value="rejected-length">
|
1254 |
+
<xsd:annotation>
|
1255 |
+
<xsd:documentation>Indicates that the item has been rejected because it is too long or too short.</xsd:documentation>
|
1256 |
+
</xsd:annotation>
|
1257 |
+
</xsd:enumeration>
|
1258 |
+
<xsd:enumeration value="rejected-spelling">
|
1259 |
+
<xsd:annotation>
|
1260 |
+
<xsd:documentation>Indicates that the item has been rejected because of incorrect spelling.</xsd:documentation>
|
1261 |
+
</xsd:annotation>
|
1262 |
+
</xsd:enumeration>
|
1263 |
+
<xsd:enumeration value="tm-suggestion">
|
1264 |
+
<xsd:annotation>
|
1265 |
+
<xsd:documentation>Indicates the translation is suggested by translation memory.</xsd:documentation>
|
1266 |
+
</xsd:annotation>
|
1267 |
+
</xsd:enumeration>
|
1268 |
+
</xsd:restriction>
|
1269 |
+
</xsd:simpleType>
|
1270 |
+
<xsd:simpleType name="unitValueList">
|
1271 |
+
<xsd:annotation>
|
1272 |
+
<xsd:documentation>Values for the attribute 'unit'.</xsd:documentation>
|
1273 |
+
</xsd:annotation>
|
1274 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1275 |
+
<xsd:enumeration value="word">
|
1276 |
+
<xsd:annotation>
|
1277 |
+
<xsd:documentation>Refers to words.</xsd:documentation>
|
1278 |
+
</xsd:annotation>
|
1279 |
+
</xsd:enumeration>
|
1280 |
+
<xsd:enumeration value="page">
|
1281 |
+
<xsd:annotation>
|
1282 |
+
<xsd:documentation>Refers to pages.</xsd:documentation>
|
1283 |
+
</xsd:annotation>
|
1284 |
+
</xsd:enumeration>
|
1285 |
+
<xsd:enumeration value="trans-unit">
|
1286 |
+
<xsd:annotation>
|
1287 |
+
<xsd:documentation>Refers to <trans-unit> elements.</xsd:documentation>
|
1288 |
+
</xsd:annotation>
|
1289 |
+
</xsd:enumeration>
|
1290 |
+
<xsd:enumeration value="bin-unit">
|
1291 |
+
<xsd:annotation>
|
1292 |
+
<xsd:documentation>Refers to <bin-unit> elements.</xsd:documentation>
|
1293 |
+
</xsd:annotation>
|
1294 |
+
</xsd:enumeration>
|
1295 |
+
<xsd:enumeration value="glyph">
|
1296 |
+
<xsd:annotation>
|
1297 |
+
<xsd:documentation>Refers to glyphs.</xsd:documentation>
|
1298 |
+
</xsd:annotation>
|
1299 |
+
</xsd:enumeration>
|
1300 |
+
<xsd:enumeration value="item">
|
1301 |
+
<xsd:annotation>
|
1302 |
+
<xsd:documentation>Refers to <trans-unit> and/or <bin-unit> elements.</xsd:documentation>
|
1303 |
+
</xsd:annotation>
|
1304 |
+
</xsd:enumeration>
|
1305 |
+
<xsd:enumeration value="instance">
|
1306 |
+
<xsd:annotation>
|
1307 |
+
<xsd:documentation>Refers to the occurrences of instances defined by the count-type value.</xsd:documentation>
|
1308 |
+
</xsd:annotation>
|
1309 |
+
</xsd:enumeration>
|
1310 |
+
<xsd:enumeration value="character">
|
1311 |
+
<xsd:annotation>
|
1312 |
+
<xsd:documentation>Refers to characters.</xsd:documentation>
|
1313 |
+
</xsd:annotation>
|
1314 |
+
</xsd:enumeration>
|
1315 |
+
<xsd:enumeration value="line">
|
1316 |
+
<xsd:annotation>
|
1317 |
+
<xsd:documentation>Refers to lines.</xsd:documentation>
|
1318 |
+
</xsd:annotation>
|
1319 |
+
</xsd:enumeration>
|
1320 |
+
<xsd:enumeration value="sentence">
|
1321 |
+
<xsd:annotation>
|
1322 |
+
<xsd:documentation>Refers to sentences.</xsd:documentation>
|
1323 |
+
</xsd:annotation>
|
1324 |
+
</xsd:enumeration>
|
1325 |
+
<xsd:enumeration value="paragraph">
|
1326 |
+
<xsd:annotation>
|
1327 |
+
<xsd:documentation>Refers to paragraphs.</xsd:documentation>
|
1328 |
+
</xsd:annotation>
|
1329 |
+
</xsd:enumeration>
|
1330 |
+
<xsd:enumeration value="segment">
|
1331 |
+
<xsd:annotation>
|
1332 |
+
<xsd:documentation>Refers to segments.</xsd:documentation>
|
1333 |
+
</xsd:annotation>
|
1334 |
+
</xsd:enumeration>
|
1335 |
+
<xsd:enumeration value="placeable">
|
1336 |
+
<xsd:annotation>
|
1337 |
+
<xsd:documentation>Refers to placeables (inline elements).</xsd:documentation>
|
1338 |
+
</xsd:annotation>
|
1339 |
+
</xsd:enumeration>
|
1340 |
+
</xsd:restriction>
|
1341 |
+
</xsd:simpleType>
|
1342 |
+
<xsd:simpleType name="priorityValueList">
|
1343 |
+
<xsd:annotation>
|
1344 |
+
<xsd:documentation>Values for the attribute 'priority'.</xsd:documentation>
|
1345 |
+
</xsd:annotation>
|
1346 |
+
<xsd:restriction base="xsd:positiveInteger">
|
1347 |
+
<xsd:enumeration value="1">
|
1348 |
+
<xsd:annotation>
|
1349 |
+
<xsd:documentation>Highest priority.</xsd:documentation>
|
1350 |
+
</xsd:annotation>
|
1351 |
+
</xsd:enumeration>
|
1352 |
+
<xsd:enumeration value="2">
|
1353 |
+
<xsd:annotation>
|
1354 |
+
<xsd:documentation>High priority.</xsd:documentation>
|
1355 |
+
</xsd:annotation>
|
1356 |
+
</xsd:enumeration>
|
1357 |
+
<xsd:enumeration value="3">
|
1358 |
+
<xsd:annotation>
|
1359 |
+
<xsd:documentation>High priority, but not as important as 2.</xsd:documentation>
|
1360 |
+
</xsd:annotation>
|
1361 |
+
</xsd:enumeration>
|
1362 |
+
<xsd:enumeration value="4">
|
1363 |
+
<xsd:annotation>
|
1364 |
+
<xsd:documentation>High priority, but not as important as 3.</xsd:documentation>
|
1365 |
+
</xsd:annotation>
|
1366 |
+
</xsd:enumeration>
|
1367 |
+
<xsd:enumeration value="5">
|
1368 |
+
<xsd:annotation>
|
1369 |
+
<xsd:documentation>Medium priority, but more important than 6.</xsd:documentation>
|
1370 |
+
</xsd:annotation>
|
1371 |
+
</xsd:enumeration>
|
1372 |
+
<xsd:enumeration value="6">
|
1373 |
+
<xsd:annotation>
|
1374 |
+
<xsd:documentation>Medium priority, but less important than 5.</xsd:documentation>
|
1375 |
+
</xsd:annotation>
|
1376 |
+
</xsd:enumeration>
|
1377 |
+
<xsd:enumeration value="7">
|
1378 |
+
<xsd:annotation>
|
1379 |
+
<xsd:documentation>Low priority, but more important than 8.</xsd:documentation>
|
1380 |
+
</xsd:annotation>
|
1381 |
+
</xsd:enumeration>
|
1382 |
+
<xsd:enumeration value="8">
|
1383 |
+
<xsd:annotation>
|
1384 |
+
<xsd:documentation>Low priority, but more important than 9.</xsd:documentation>
|
1385 |
+
</xsd:annotation>
|
1386 |
+
</xsd:enumeration>
|
1387 |
+
<xsd:enumeration value="9">
|
1388 |
+
<xsd:annotation>
|
1389 |
+
<xsd:documentation>Low priority.</xsd:documentation>
|
1390 |
+
</xsd:annotation>
|
1391 |
+
</xsd:enumeration>
|
1392 |
+
<xsd:enumeration value="10">
|
1393 |
+
<xsd:annotation>
|
1394 |
+
<xsd:documentation>Lowest priority.</xsd:documentation>
|
1395 |
+
</xsd:annotation>
|
1396 |
+
</xsd:enumeration>
|
1397 |
+
</xsd:restriction>
|
1398 |
+
</xsd:simpleType>
|
1399 |
+
<xsd:simpleType name="reformatValueYesNo">
|
1400 |
+
<xsd:restriction base="xsd:string">
|
1401 |
+
<xsd:enumeration value="yes">
|
1402 |
+
<xsd:annotation>
|
1403 |
+
<xsd:documentation>This value indicates that all properties can be reformatted. This value must be used alone.</xsd:documentation>
|
1404 |
+
</xsd:annotation>
|
1405 |
+
</xsd:enumeration>
|
1406 |
+
<xsd:enumeration value="no">
|
1407 |
+
<xsd:annotation>
|
1408 |
+
<xsd:documentation>This value indicates that no properties should be reformatted. This value must be used alone.</xsd:documentation>
|
1409 |
+
</xsd:annotation>
|
1410 |
+
</xsd:enumeration>
|
1411 |
+
</xsd:restriction>
|
1412 |
+
</xsd:simpleType>
|
1413 |
+
<xsd:simpleType name="reformatValueList">
|
1414 |
+
<xsd:list>
|
1415 |
+
<xsd:simpleType>
|
1416 |
+
<xsd:union memberTypes="xlf:XTend">
|
1417 |
+
<xsd:simpleType>
|
1418 |
+
<xsd:restriction base="xsd:string">
|
1419 |
+
<xsd:enumeration value="coord">
|
1420 |
+
<xsd:annotation>
|
1421 |
+
<xsd:documentation>This value indicates that all information in the coord attribute can be modified.</xsd:documentation>
|
1422 |
+
</xsd:annotation>
|
1423 |
+
</xsd:enumeration>
|
1424 |
+
<xsd:enumeration value="coord-x">
|
1425 |
+
<xsd:annotation>
|
1426 |
+
<xsd:documentation>This value indicates that the x information in the coord attribute can be modified.</xsd:documentation>
|
1427 |
+
</xsd:annotation>
|
1428 |
+
</xsd:enumeration>
|
1429 |
+
<xsd:enumeration value="coord-y">
|
1430 |
+
<xsd:annotation>
|
1431 |
+
<xsd:documentation>This value indicates that the y information in the coord attribute can be modified.</xsd:documentation>
|
1432 |
+
</xsd:annotation>
|
1433 |
+
</xsd:enumeration>
|
1434 |
+
<xsd:enumeration value="coord-cx">
|
1435 |
+
<xsd:annotation>
|
1436 |
+
<xsd:documentation>This value indicates that the cx information in the coord attribute can be modified.</xsd:documentation>
|
1437 |
+
</xsd:annotation>
|
1438 |
+
</xsd:enumeration>
|
1439 |
+
<xsd:enumeration value="coord-cy">
|
1440 |
+
<xsd:annotation>
|
1441 |
+
<xsd:documentation>This value indicates that the cy information in the coord attribute can be modified.</xsd:documentation>
|
1442 |
+
</xsd:annotation>
|
1443 |
+
</xsd:enumeration>
|
1444 |
+
<xsd:enumeration value="font">
|
1445 |
+
<xsd:annotation>
|
1446 |
+
<xsd:documentation>This value indicates that all the information in the font attribute can be modified.</xsd:documentation>
|
1447 |
+
</xsd:annotation>
|
1448 |
+
</xsd:enumeration>
|
1449 |
+
<xsd:enumeration value="font-name">
|
1450 |
+
<xsd:annotation>
|
1451 |
+
<xsd:documentation>This value indicates that the name information in the font attribute can be modified.</xsd:documentation>
|
1452 |
+
</xsd:annotation>
|
1453 |
+
</xsd:enumeration>
|
1454 |
+
<xsd:enumeration value="font-size">
|
1455 |
+
<xsd:annotation>
|
1456 |
+
<xsd:documentation>This value indicates that the size information in the font attribute can be modified.</xsd:documentation>
|
1457 |
+
</xsd:annotation>
|
1458 |
+
</xsd:enumeration>
|
1459 |
+
<xsd:enumeration value="font-weight">
|
1460 |
+
<xsd:annotation>
|
1461 |
+
<xsd:documentation>This value indicates that the weight information in the font attribute can be modified.</xsd:documentation>
|
1462 |
+
</xsd:annotation>
|
1463 |
+
</xsd:enumeration>
|
1464 |
+
<xsd:enumeration value="css-style">
|
1465 |
+
<xsd:annotation>
|
1466 |
+
<xsd:documentation>This value indicates that the information in the css-style attribute can be modified.</xsd:documentation>
|
1467 |
+
</xsd:annotation>
|
1468 |
+
</xsd:enumeration>
|
1469 |
+
<xsd:enumeration value="style">
|
1470 |
+
<xsd:annotation>
|
1471 |
+
<xsd:documentation>This value indicates that the information in the style attribute can be modified.</xsd:documentation>
|
1472 |
+
</xsd:annotation>
|
1473 |
+
</xsd:enumeration>
|
1474 |
+
<xsd:enumeration value="ex-style">
|
1475 |
+
<xsd:annotation>
|
1476 |
+
<xsd:documentation>This value indicates that the information in the exstyle attribute can be modified.</xsd:documentation>
|
1477 |
+
</xsd:annotation>
|
1478 |
+
</xsd:enumeration>
|
1479 |
+
</xsd:restriction>
|
1480 |
+
</xsd:simpleType>
|
1481 |
+
</xsd:union>
|
1482 |
+
</xsd:simpleType>
|
1483 |
+
</xsd:list>
|
1484 |
+
</xsd:simpleType>
|
1485 |
+
<xsd:simpleType name="purposeValueList">
|
1486 |
+
<xsd:restriction base="xsd:string">
|
1487 |
+
<xsd:enumeration value="information">
|
1488 |
+
<xsd:annotation>
|
1489 |
+
<xsd:documentation>Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document.</xsd:documentation>
|
1490 |
+
</xsd:annotation>
|
1491 |
+
</xsd:enumeration>
|
1492 |
+
<xsd:enumeration value="location">
|
1493 |
+
<xsd:annotation>
|
1494 |
+
<xsd:documentation>Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed.</xsd:documentation>
|
1495 |
+
</xsd:annotation>
|
1496 |
+
</xsd:enumeration>
|
1497 |
+
<xsd:enumeration value="match">
|
1498 |
+
<xsd:annotation>
|
1499 |
+
<xsd:documentation>Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed.</xsd:documentation>
|
1500 |
+
</xsd:annotation>
|
1501 |
+
</xsd:enumeration>
|
1502 |
+
</xsd:restriction>
|
1503 |
+
</xsd:simpleType>
|
1504 |
+
<xsd:simpleType name="alttranstypeValueList">
|
1505 |
+
<xsd:restriction base="xsd:string">
|
1506 |
+
<xsd:enumeration value="proposal">
|
1507 |
+
<xsd:annotation>
|
1508 |
+
<xsd:documentation>Represents a translation proposal from a translation memory or other resource.</xsd:documentation>
|
1509 |
+
</xsd:annotation>
|
1510 |
+
</xsd:enumeration>
|
1511 |
+
<xsd:enumeration value="previous-version">
|
1512 |
+
<xsd:annotation>
|
1513 |
+
<xsd:documentation>Represents a previous version of the target element.</xsd:documentation>
|
1514 |
+
</xsd:annotation>
|
1515 |
+
</xsd:enumeration>
|
1516 |
+
<xsd:enumeration value="rejected">
|
1517 |
+
<xsd:annotation>
|
1518 |
+
<xsd:documentation>Represents a rejected version of the target element.</xsd:documentation>
|
1519 |
+
</xsd:annotation>
|
1520 |
+
</xsd:enumeration>
|
1521 |
+
<xsd:enumeration value="reference">
|
1522 |
+
<xsd:annotation>
|
1523 |
+
<xsd:documentation>Represents a translation to be used for reference purposes only, for example from a related product or a different language.</xsd:documentation>
|
1524 |
+
</xsd:annotation>
|
1525 |
+
</xsd:enumeration>
|
1526 |
+
<xsd:enumeration value="accepted">
|
1527 |
+
<xsd:annotation>
|
1528 |
+
<xsd:documentation>Represents a proposed translation that was used for the translation of the trans-unit, possibly modified.</xsd:documentation>
|
1529 |
+
</xsd:annotation>
|
1530 |
+
</xsd:enumeration>
|
1531 |
+
</xsd:restriction>
|
1532 |
+
</xsd:simpleType>
|
1533 |
+
<!-- Other Types -->
|
1534 |
+
<xsd:complexType name="ElemType_ExternalReference">
|
1535 |
+
<xsd:choice>
|
1536 |
+
<xsd:element ref="xlf:internal-file"/>
|
1537 |
+
<xsd:element ref="xlf:external-file"/>
|
1538 |
+
</xsd:choice>
|
1539 |
+
</xsd:complexType>
|
1540 |
+
<xsd:simpleType name="AttrType_purpose">
|
1541 |
+
<xsd:list>
|
1542 |
+
<xsd:simpleType>
|
1543 |
+
<xsd:union memberTypes="xlf:purposeValueList xlf:XTend"/>
|
1544 |
+
</xsd:simpleType>
|
1545 |
+
</xsd:list>
|
1546 |
+
</xsd:simpleType>
|
1547 |
+
<xsd:simpleType name="AttrType_datatype">
|
1548 |
+
<xsd:union memberTypes="xlf:datatypeValueList xlf:XTend"/>
|
1549 |
+
</xsd:simpleType>
|
1550 |
+
<xsd:simpleType name="AttrType_restype">
|
1551 |
+
<xsd:union memberTypes="xlf:restypeValueList xlf:XTend"/>
|
1552 |
+
</xsd:simpleType>
|
1553 |
+
<xsd:simpleType name="AttrType_alttranstype">
|
1554 |
+
<xsd:union memberTypes="xlf:alttranstypeValueList xlf:XTend"/>
|
1555 |
+
</xsd:simpleType>
|
1556 |
+
<xsd:simpleType name="AttrType_context-type">
|
1557 |
+
<xsd:union memberTypes="xlf:context-typeValueList xlf:XTend"/>
|
1558 |
+
</xsd:simpleType>
|
1559 |
+
<xsd:simpleType name="AttrType_state">
|
1560 |
+
<xsd:union memberTypes="xlf:stateValueList xlf:XTend"/>
|
1561 |
+
</xsd:simpleType>
|
1562 |
+
<xsd:simpleType name="AttrType_state-qualifier">
|
1563 |
+
<xsd:union memberTypes="xlf:state-qualifierValueList xlf:XTend"/>
|
1564 |
+
</xsd:simpleType>
|
1565 |
+
<xsd:simpleType name="AttrType_count-type">
|
1566 |
+
<xsd:union memberTypes="xlf:restypeValueList xlf:count-typeValueList xlf:datatypeValueList xlf:stateValueList xlf:state-qualifierValueList xlf:XTend"/>
|
1567 |
+
</xsd:simpleType>
|
1568 |
+
<xsd:simpleType name="AttrType_InlineDelimiters">
|
1569 |
+
<xsd:union memberTypes="xlf:InlineDelimitersValueList xlf:XTend"/>
|
1570 |
+
</xsd:simpleType>
|
1571 |
+
<xsd:simpleType name="AttrType_InlinePlaceholders">
|
1572 |
+
<xsd:union memberTypes="xlf:InlinePlaceholdersValueList xlf:XTend"/>
|
1573 |
+
</xsd:simpleType>
|
1574 |
+
<xsd:simpleType name="AttrType_size-unit">
|
1575 |
+
<xsd:union memberTypes="xlf:size-unitValueList xlf:XTend"/>
|
1576 |
+
</xsd:simpleType>
|
1577 |
+
<xsd:simpleType name="AttrType_mtype">
|
1578 |
+
<xsd:union memberTypes="xlf:mtypeValueList xlf:XTend"/>
|
1579 |
+
</xsd:simpleType>
|
1580 |
+
<xsd:simpleType name="AttrType_unit">
|
1581 |
+
<xsd:union memberTypes="xlf:unitValueList xlf:XTend"/>
|
1582 |
+
</xsd:simpleType>
|
1583 |
+
<xsd:simpleType name="AttrType_priority">
|
1584 |
+
<xsd:union memberTypes="xlf:priorityValueList"/>
|
1585 |
+
</xsd:simpleType>
|
1586 |
+
<xsd:simpleType name="AttrType_reformat">
|
1587 |
+
<xsd:union memberTypes="xlf:reformatValueYesNo xlf:reformatValueList"/>
|
1588 |
+
</xsd:simpleType>
|
1589 |
+
<xsd:simpleType name="AttrType_YesNo">
|
1590 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1591 |
+
<xsd:enumeration value="yes"/>
|
1592 |
+
<xsd:enumeration value="no"/>
|
1593 |
+
</xsd:restriction>
|
1594 |
+
</xsd:simpleType>
|
1595 |
+
<xsd:simpleType name="AttrType_Position">
|
1596 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1597 |
+
<xsd:enumeration value="open"/>
|
1598 |
+
<xsd:enumeration value="close"/>
|
1599 |
+
</xsd:restriction>
|
1600 |
+
</xsd:simpleType>
|
1601 |
+
<xsd:simpleType name="AttrType_assoc">
|
1602 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1603 |
+
<xsd:enumeration value="preceding"/>
|
1604 |
+
<xsd:enumeration value="following"/>
|
1605 |
+
<xsd:enumeration value="both"/>
|
1606 |
+
</xsd:restriction>
|
1607 |
+
</xsd:simpleType>
|
1608 |
+
<xsd:simpleType name="AttrType_annotates">
|
1609 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
1610 |
+
<xsd:enumeration value="source"/>
|
1611 |
+
<xsd:enumeration value="target"/>
|
1612 |
+
<xsd:enumeration value="general"/>
|
1613 |
+
</xsd:restriction>
|
1614 |
+
</xsd:simpleType>
|
1615 |
+
<xsd:simpleType name="AttrType_Coordinates">
|
1616 |
+
<xsd:annotation>
|
1617 |
+
<xsd:documentation>Values for the attribute 'coord'.</xsd:documentation>
|
1618 |
+
</xsd:annotation>
|
1619 |
+
<xsd:restriction base="xsd:string">
|
1620 |
+
<xsd:pattern value="(-?\d+|#);(-?\d+|#);(-?\d+|#);(-?\d+|#)"/>
|
1621 |
+
</xsd:restriction>
|
1622 |
+
</xsd:simpleType>
|
1623 |
+
<xsd:simpleType name="AttrType_Version">
|
1624 |
+
<xsd:annotation>
|
1625 |
+
<xsd:documentation>Version values: 1.0 and 1.1 are allowed for backward compatibility.</xsd:documentation>
|
1626 |
+
</xsd:annotation>
|
1627 |
+
<xsd:restriction base="xsd:string">
|
1628 |
+
<xsd:enumeration value="1.2"/>
|
1629 |
+
<xsd:enumeration value="1.1"/>
|
1630 |
+
<xsd:enumeration value="1.0"/>
|
1631 |
+
</xsd:restriction>
|
1632 |
+
</xsd:simpleType>
|
1633 |
+
<!-- Groups -->
|
1634 |
+
<xsd:group name="ElemGroup_TextContent">
|
1635 |
+
<xsd:choice>
|
1636 |
+
<xsd:element ref="xlf:g"/>
|
1637 |
+
<xsd:element ref="xlf:bpt"/>
|
1638 |
+
<xsd:element ref="xlf:ept"/>
|
1639 |
+
<xsd:element ref="xlf:ph"/>
|
1640 |
+
<xsd:element ref="xlf:it"/>
|
1641 |
+
<xsd:element ref="xlf:mrk"/>
|
1642 |
+
<xsd:element ref="xlf:x"/>
|
1643 |
+
<xsd:element ref="xlf:bx"/>
|
1644 |
+
<xsd:element ref="xlf:ex"/>
|
1645 |
+
</xsd:choice>
|
1646 |
+
</xsd:group>
|
1647 |
+
<xsd:attributeGroup name="AttrGroup_TextContent">
|
1648 |
+
<xsd:attribute name="id" type="xsd:string" use="required"/>
|
1649 |
+
<xsd:attribute name="xid" type="xsd:string" use="optional"/>
|
1650 |
+
<xsd:attribute name="equiv-text" type="xsd:string" use="optional"/>
|
1651 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1652 |
+
</xsd:attributeGroup>
|
1653 |
+
<!-- XLIFF Structure -->
|
1654 |
+
<xsd:element name="xliff">
|
1655 |
+
<xsd:complexType>
|
1656 |
+
<xsd:sequence maxOccurs="unbounded">
|
1657 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
1658 |
+
<xsd:element ref="xlf:file"/>
|
1659 |
+
</xsd:sequence>
|
1660 |
+
<xsd:attribute name="version" type="xlf:AttrType_Version" use="required"/>
|
1661 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
1662 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1663 |
+
</xsd:complexType>
|
1664 |
+
</xsd:element>
|
1665 |
+
<xsd:element name="file">
|
1666 |
+
<xsd:complexType>
|
1667 |
+
<xsd:sequence>
|
1668 |
+
<xsd:element minOccurs="0" ref="xlf:header"/>
|
1669 |
+
<xsd:element ref="xlf:body"/>
|
1670 |
+
</xsd:sequence>
|
1671 |
+
<xsd:attribute name="original" type="xsd:string" use="required"/>
|
1672 |
+
<xsd:attribute name="source-language" type="xsd:language" use="required"/>
|
1673 |
+
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="required"/>
|
1674 |
+
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
|
1675 |
+
<xsd:attribute name="date" type="xsd:dateTime" use="optional"/>
|
1676 |
+
<xsd:attribute ref="xml:space" use="optional"/>
|
1677 |
+
<xsd:attribute name="category" type="xsd:string" use="optional"/>
|
1678 |
+
<xsd:attribute name="target-language" type="xsd:language" use="optional"/>
|
1679 |
+
<xsd:attribute name="product-name" type="xsd:string" use="optional"/>
|
1680 |
+
<xsd:attribute name="product-version" type="xsd:string" use="optional"/>
|
1681 |
+
<xsd:attribute name="build-num" type="xsd:string" use="optional"/>
|
1682 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1683 |
+
</xsd:complexType>
|
1684 |
+
<xsd:unique name="U_group_id">
|
1685 |
+
<xsd:selector xpath=".//xlf:group"/>
|
1686 |
+
<xsd:field xpath="@id"/>
|
1687 |
+
</xsd:unique>
|
1688 |
+
<xsd:key name="K_unit_id">
|
1689 |
+
<xsd:selector xpath=".//xlf:trans-unit|.//xlf:bin-unit"/>
|
1690 |
+
<xsd:field xpath="@id"/>
|
1691 |
+
</xsd:key>
|
1692 |
+
<xsd:keyref name="KR_unit_id" refer="xlf:K_unit_id">
|
1693 |
+
<xsd:selector xpath=".//bpt|.//ept|.//it|.//ph|.//g|.//x|.//bx|.//ex|.//sub"/>
|
1694 |
+
<xsd:field xpath="@xid"/>
|
1695 |
+
</xsd:keyref>
|
1696 |
+
<xsd:key name="K_tool-id">
|
1697 |
+
<xsd:selector xpath="xlf:header/xlf:tool"/>
|
1698 |
+
<xsd:field xpath="@tool-id"/>
|
1699 |
+
</xsd:key>
|
1700 |
+
<xsd:keyref name="KR_file_tool-id" refer="xlf:K_tool-id">
|
1701 |
+
<xsd:selector xpath="."/>
|
1702 |
+
<xsd:field xpath="@tool-id"/>
|
1703 |
+
</xsd:keyref>
|
1704 |
+
<xsd:keyref name="KR_phase_tool-id" refer="xlf:K_tool-id">
|
1705 |
+
<xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/>
|
1706 |
+
<xsd:field xpath="@tool-id"/>
|
1707 |
+
</xsd:keyref>
|
1708 |
+
<xsd:keyref name="KR_alt-trans_tool-id" refer="xlf:K_tool-id">
|
1709 |
+
<xsd:selector xpath=".//xlf:trans-unit/xlf:alt-trans"/>
|
1710 |
+
<xsd:field xpath="@tool-id"/>
|
1711 |
+
</xsd:keyref>
|
1712 |
+
<xsd:key name="K_count-group_name">
|
1713 |
+
<xsd:selector xpath=".//xlf:count-group"/>
|
1714 |
+
<xsd:field xpath="@name"/>
|
1715 |
+
</xsd:key>
|
1716 |
+
<xsd:unique name="U_context-group_name">
|
1717 |
+
<xsd:selector xpath=".//xlf:context-group"/>
|
1718 |
+
<xsd:field xpath="@name"/>
|
1719 |
+
</xsd:unique>
|
1720 |
+
<xsd:key name="K_phase-name">
|
1721 |
+
<xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/>
|
1722 |
+
<xsd:field xpath="@phase-name"/>
|
1723 |
+
</xsd:key>
|
1724 |
+
<xsd:keyref name="KR_phase-name" refer="xlf:K_phase-name">
|
1725 |
+
<xsd:selector xpath=".//xlf:count|.//xlf:trans-unit|.//xlf:target|.//bin-unit|.//bin-target"/>
|
1726 |
+
<xsd:field xpath="@phase-name"/>
|
1727 |
+
</xsd:keyref>
|
1728 |
+
<xsd:unique name="U_uid">
|
1729 |
+
<xsd:selector xpath=".//xlf:external-file"/>
|
1730 |
+
<xsd:field xpath="@uid"/>
|
1731 |
+
</xsd:unique>
|
1732 |
+
</xsd:element>
|
1733 |
+
<xsd:element name="header">
|
1734 |
+
<xsd:complexType>
|
1735 |
+
<xsd:sequence>
|
1736 |
+
<xsd:element minOccurs="0" name="skl" type="xlf:ElemType_ExternalReference"/>
|
1737 |
+
<xsd:element minOccurs="0" ref="xlf:phase-group"/>
|
1738 |
+
<xsd:choice maxOccurs="unbounded" minOccurs="0">
|
1739 |
+
<xsd:element name="glossary" type="xlf:ElemType_ExternalReference"/>
|
1740 |
+
<xsd:element name="reference" type="xlf:ElemType_ExternalReference"/>
|
1741 |
+
<xsd:element ref="xlf:count-group"/>
|
1742 |
+
<xsd:element ref="xlf:note"/>
|
1743 |
+
<xsd:element ref="xlf:tool"/>
|
1744 |
+
</xsd:choice>
|
1745 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
1746 |
+
</xsd:sequence>
|
1747 |
+
</xsd:complexType>
|
1748 |
+
</xsd:element>
|
1749 |
+
<xsd:element name="internal-file">
|
1750 |
+
<xsd:complexType>
|
1751 |
+
<xsd:simpleContent>
|
1752 |
+
<xsd:extension base="xsd:string">
|
1753 |
+
<xsd:attribute name="form" type="xsd:string"/>
|
1754 |
+
<xsd:attribute name="crc" type="xsd:NMTOKEN"/>
|
1755 |
+
</xsd:extension>
|
1756 |
+
</xsd:simpleContent>
|
1757 |
+
</xsd:complexType>
|
1758 |
+
</xsd:element>
|
1759 |
+
<xsd:element name="external-file">
|
1760 |
+
<xsd:complexType>
|
1761 |
+
<xsd:attribute name="href" type="xsd:string" use="required"/>
|
1762 |
+
<xsd:attribute name="crc" type="xsd:NMTOKEN"/>
|
1763 |
+
<xsd:attribute name="uid" type="xsd:NMTOKEN"/>
|
1764 |
+
</xsd:complexType>
|
1765 |
+
</xsd:element>
|
1766 |
+
<xsd:element name="note">
|
1767 |
+
<xsd:complexType>
|
1768 |
+
<xsd:simpleContent>
|
1769 |
+
<xsd:extension base="xsd:string">
|
1770 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
1771 |
+
<xsd:attribute default="1" name="priority" type="xlf:AttrType_priority" use="optional"/>
|
1772 |
+
<xsd:attribute name="from" type="xsd:string" use="optional"/>
|
1773 |
+
<xsd:attribute default="general" name="annotates" type="xlf:AttrType_annotates" use="optional"/>
|
1774 |
+
</xsd:extension>
|
1775 |
+
</xsd:simpleContent>
|
1776 |
+
</xsd:complexType>
|
1777 |
+
</xsd:element>
|
1778 |
+
<xsd:element name="phase-group">
|
1779 |
+
<xsd:complexType>
|
1780 |
+
<xsd:sequence maxOccurs="unbounded">
|
1781 |
+
<xsd:element ref="xlf:phase"/>
|
1782 |
+
</xsd:sequence>
|
1783 |
+
</xsd:complexType>
|
1784 |
+
</xsd:element>
|
1785 |
+
<xsd:element name="phase">
|
1786 |
+
<xsd:complexType>
|
1787 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
1788 |
+
<xsd:element ref="xlf:note"/>
|
1789 |
+
</xsd:sequence>
|
1790 |
+
<xsd:attribute name="phase-name" type="xsd:string" use="required"/>
|
1791 |
+
<xsd:attribute name="process-name" type="xsd:string" use="required"/>
|
1792 |
+
<xsd:attribute name="company-name" type="xsd:string" use="optional"/>
|
1793 |
+
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
|
1794 |
+
<xsd:attribute name="date" type="xsd:dateTime" use="optional"/>
|
1795 |
+
<xsd:attribute name="job-id" type="xsd:string" use="optional"/>
|
1796 |
+
<xsd:attribute name="contact-name" type="xsd:string" use="optional"/>
|
1797 |
+
<xsd:attribute name="contact-email" type="xsd:string" use="optional"/>
|
1798 |
+
<xsd:attribute name="contact-phone" type="xsd:string" use="optional"/>
|
1799 |
+
</xsd:complexType>
|
1800 |
+
</xsd:element>
|
1801 |
+
<xsd:element name="count-group">
|
1802 |
+
<xsd:complexType>
|
1803 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
1804 |
+
<xsd:element ref="xlf:count"/>
|
1805 |
+
</xsd:sequence>
|
1806 |
+
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
1807 |
+
</xsd:complexType>
|
1808 |
+
</xsd:element>
|
1809 |
+
<xsd:element name="count">
|
1810 |
+
<xsd:complexType>
|
1811 |
+
<xsd:simpleContent>
|
1812 |
+
<xsd:extension base="xsd:string">
|
1813 |
+
<xsd:attribute name="count-type" type="xlf:AttrType_count-type" use="optional"/>
|
1814 |
+
<xsd:attribute name="phase-name" type="xsd:string" use="optional"/>
|
1815 |
+
<xsd:attribute default="word" name="unit" type="xlf:AttrType_unit" use="optional"/>
|
1816 |
+
</xsd:extension>
|
1817 |
+
</xsd:simpleContent>
|
1818 |
+
</xsd:complexType>
|
1819 |
+
</xsd:element>
|
1820 |
+
<xsd:element name="context-group">
|
1821 |
+
<xsd:complexType>
|
1822 |
+
<xsd:sequence maxOccurs="unbounded">
|
1823 |
+
<xsd:element ref="xlf:context"/>
|
1824 |
+
</xsd:sequence>
|
1825 |
+
<xsd:attribute name="name" type="xsd:string" use="optional"/>
|
1826 |
+
<xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/>
|
1827 |
+
<xsd:attribute name="purpose" type="xlf:AttrType_purpose" use="optional"/>
|
1828 |
+
</xsd:complexType>
|
1829 |
+
</xsd:element>
|
1830 |
+
<xsd:element name="context">
|
1831 |
+
<xsd:complexType>
|
1832 |
+
<xsd:simpleContent>
|
1833 |
+
<xsd:extension base="xsd:string">
|
1834 |
+
<xsd:attribute name="context-type" type="xlf:AttrType_context-type" use="required"/>
|
1835 |
+
<xsd:attribute default="no" name="match-mandatory" type="xlf:AttrType_YesNo" use="optional"/>
|
1836 |
+
<xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/>
|
1837 |
+
</xsd:extension>
|
1838 |
+
</xsd:simpleContent>
|
1839 |
+
</xsd:complexType>
|
1840 |
+
</xsd:element>
|
1841 |
+
<xsd:element name="tool">
|
1842 |
+
<xsd:complexType mixed="true">
|
1843 |
+
<xsd:sequence>
|
1844 |
+
<xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
|
1845 |
+
</xsd:sequence>
|
1846 |
+
<xsd:attribute name="tool-id" type="xsd:string" use="required"/>
|
1847 |
+
<xsd:attribute name="tool-name" type="xsd:string" use="required"/>
|
1848 |
+
<xsd:attribute name="tool-version" type="xsd:string" use="optional"/>
|
1849 |
+
<xsd:attribute name="tool-company" type="xsd:string" use="optional"/>
|
1850 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1851 |
+
</xsd:complexType>
|
1852 |
+
</xsd:element>
|
1853 |
+
<xsd:element name="body">
|
1854 |
+
<xsd:complexType>
|
1855 |
+
<xsd:choice maxOccurs="unbounded" minOccurs="0">
|
1856 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/>
|
1857 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/>
|
1858 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/>
|
1859 |
+
</xsd:choice>
|
1860 |
+
</xsd:complexType>
|
1861 |
+
</xsd:element>
|
1862 |
+
<xsd:element name="group">
|
1863 |
+
<xsd:complexType>
|
1864 |
+
<xsd:sequence>
|
1865 |
+
<xsd:sequence>
|
1866 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/>
|
1867 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:count-group"/>
|
1868 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/>
|
1869 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
1870 |
+
</xsd:sequence>
|
1871 |
+
<xsd:choice maxOccurs="unbounded">
|
1872 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/>
|
1873 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/>
|
1874 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/>
|
1875 |
+
</xsd:choice>
|
1876 |
+
</xsd:sequence>
|
1877 |
+
<xsd:attribute name="id" type="xsd:string" use="optional"/>
|
1878 |
+
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
|
1879 |
+
<xsd:attribute default="default" ref="xml:space" use="optional"/>
|
1880 |
+
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
|
1881 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
1882 |
+
<xsd:attribute name="extradata" type="xsd:string" use="optional"/>
|
1883 |
+
<xsd:attribute name="extype" type="xsd:string" use="optional"/>
|
1884 |
+
<xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/>
|
1885 |
+
<xsd:attribute name="menu" type="xsd:string" use="optional"/>
|
1886 |
+
<xsd:attribute name="menu-option" type="xsd:string" use="optional"/>
|
1887 |
+
<xsd:attribute name="menu-name" type="xsd:string" use="optional"/>
|
1888 |
+
<xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/>
|
1889 |
+
<xsd:attribute name="font" type="xsd:string" use="optional"/>
|
1890 |
+
<xsd:attribute name="css-style" type="xsd:string" use="optional"/>
|
1891 |
+
<xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/>
|
1892 |
+
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
|
1893 |
+
<xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/>
|
1894 |
+
<xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/>
|
1895 |
+
<xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/>
|
1896 |
+
<xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/>
|
1897 |
+
<xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/>
|
1898 |
+
<xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/>
|
1899 |
+
<xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/>
|
1900 |
+
<xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/>
|
1901 |
+
<xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/>
|
1902 |
+
<xsd:attribute name="charclass" type="xsd:string" use="optional"/>
|
1903 |
+
<xsd:attribute default="no" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/>
|
1904 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1905 |
+
</xsd:complexType>
|
1906 |
+
</xsd:element>
|
1907 |
+
<xsd:element name="trans-unit">
|
1908 |
+
<xsd:complexType>
|
1909 |
+
<xsd:sequence>
|
1910 |
+
<xsd:element ref="xlf:source"/>
|
1911 |
+
<xsd:element minOccurs="0" ref="xlf:seg-source"/>
|
1912 |
+
<xsd:element minOccurs="0" ref="xlf:target"/>
|
1913 |
+
<xsd:choice maxOccurs="unbounded" minOccurs="0">
|
1914 |
+
<xsd:element ref="xlf:context-group"/>
|
1915 |
+
<xsd:element ref="xlf:count-group"/>
|
1916 |
+
<xsd:element ref="xlf:note"/>
|
1917 |
+
<xsd:element ref="xlf:alt-trans"/>
|
1918 |
+
</xsd:choice>
|
1919 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
1920 |
+
</xsd:sequence>
|
1921 |
+
<xsd:attribute name="id" type="xsd:string" use="required"/>
|
1922 |
+
<xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/>
|
1923 |
+
<xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/>
|
1924 |
+
<xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/>
|
1925 |
+
<xsd:attribute default="default" ref="xml:space" use="optional"/>
|
1926 |
+
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
|
1927 |
+
<xsd:attribute name="phase-name" type="xsd:string" use="optional"/>
|
1928 |
+
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
|
1929 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
1930 |
+
<xsd:attribute name="extradata" type="xsd:string" use="optional"/>
|
1931 |
+
<xsd:attribute name="extype" type="xsd:string" use="optional"/>
|
1932 |
+
<xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/>
|
1933 |
+
<xsd:attribute name="menu" type="xsd:string" use="optional"/>
|
1934 |
+
<xsd:attribute name="menu-option" type="xsd:string" use="optional"/>
|
1935 |
+
<xsd:attribute name="menu-name" type="xsd:string" use="optional"/>
|
1936 |
+
<xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/>
|
1937 |
+
<xsd:attribute name="font" type="xsd:string" use="optional"/>
|
1938 |
+
<xsd:attribute name="css-style" type="xsd:string" use="optional"/>
|
1939 |
+
<xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/>
|
1940 |
+
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
|
1941 |
+
<xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/>
|
1942 |
+
<xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/>
|
1943 |
+
<xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/>
|
1944 |
+
<xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/>
|
1945 |
+
<xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/>
|
1946 |
+
<xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/>
|
1947 |
+
<xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/>
|
1948 |
+
<xsd:attribute name="charclass" type="xsd:string" use="optional"/>
|
1949 |
+
<xsd:attribute default="yes" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/>
|
1950 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1951 |
+
</xsd:complexType>
|
1952 |
+
<xsd:unique name="U_tu_segsrc_mid">
|
1953 |
+
<xsd:selector xpath="./xlf:seg-source/xlf:mrk"/>
|
1954 |
+
<xsd:field xpath="@mid"/>
|
1955 |
+
</xsd:unique>
|
1956 |
+
<xsd:keyref name="KR_tu_segsrc_mid" refer="xlf:U_tu_segsrc_mid">
|
1957 |
+
<xsd:selector xpath="./xlf:target/xlf:mrk|./xlf:alt-trans"/>
|
1958 |
+
<xsd:field xpath="@mid"/>
|
1959 |
+
</xsd:keyref>
|
1960 |
+
</xsd:element>
|
1961 |
+
<xsd:element name="source">
|
1962 |
+
<xsd:complexType mixed="true">
|
1963 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
1964 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
1965 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1966 |
+
</xsd:complexType>
|
1967 |
+
<xsd:unique name="U_source_bpt_rid">
|
1968 |
+
<xsd:selector xpath=".//xlf:bpt"/>
|
1969 |
+
<xsd:field xpath="@rid"/>
|
1970 |
+
</xsd:unique>
|
1971 |
+
<xsd:keyref name="KR_source_ept_rid" refer="xlf:U_source_bpt_rid">
|
1972 |
+
<xsd:selector xpath=".//xlf:ept"/>
|
1973 |
+
<xsd:field xpath="@rid"/>
|
1974 |
+
</xsd:keyref>
|
1975 |
+
<xsd:unique name="U_source_bx_rid">
|
1976 |
+
<xsd:selector xpath=".//xlf:bx"/>
|
1977 |
+
<xsd:field xpath="@rid"/>
|
1978 |
+
</xsd:unique>
|
1979 |
+
<xsd:keyref name="KR_source_ex_rid" refer="xlf:U_source_bx_rid">
|
1980 |
+
<xsd:selector xpath=".//xlf:ex"/>
|
1981 |
+
<xsd:field xpath="@rid"/>
|
1982 |
+
</xsd:keyref>
|
1983 |
+
</xsd:element>
|
1984 |
+
<xsd:element name="seg-source">
|
1985 |
+
<xsd:complexType mixed="true">
|
1986 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
1987 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
1988 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
1989 |
+
</xsd:complexType>
|
1990 |
+
<xsd:unique name="U_segsrc_bpt_rid">
|
1991 |
+
<xsd:selector xpath=".//xlf:bpt"/>
|
1992 |
+
<xsd:field xpath="@rid"/>
|
1993 |
+
</xsd:unique>
|
1994 |
+
<xsd:keyref name="KR_segsrc_ept_rid" refer="xlf:U_segsrc_bpt_rid">
|
1995 |
+
<xsd:selector xpath=".//xlf:ept"/>
|
1996 |
+
<xsd:field xpath="@rid"/>
|
1997 |
+
</xsd:keyref>
|
1998 |
+
<xsd:unique name="U_segsrc_bx_rid">
|
1999 |
+
<xsd:selector xpath=".//xlf:bx"/>
|
2000 |
+
<xsd:field xpath="@rid"/>
|
2001 |
+
</xsd:unique>
|
2002 |
+
<xsd:keyref name="KR_segsrc_ex_rid" refer="xlf:U_segsrc_bx_rid">
|
2003 |
+
<xsd:selector xpath=".//xlf:ex"/>
|
2004 |
+
<xsd:field xpath="@rid"/>
|
2005 |
+
</xsd:keyref>
|
2006 |
+
</xsd:element>
|
2007 |
+
<xsd:element name="target">
|
2008 |
+
<xsd:complexType mixed="true">
|
2009 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
2010 |
+
<xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/>
|
2011 |
+
<xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/>
|
2012 |
+
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
|
2013 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
2014 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
2015 |
+
<xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/>
|
2016 |
+
<xsd:attribute name="font" type="xsd:string" use="optional"/>
|
2017 |
+
<xsd:attribute name="css-style" type="xsd:string" use="optional"/>
|
2018 |
+
<xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/>
|
2019 |
+
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
|
2020 |
+
<xsd:attribute default="yes" name="equiv-trans" type="xlf:AttrType_YesNo" use="optional"/>
|
2021 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2022 |
+
</xsd:complexType>
|
2023 |
+
<xsd:unique name="U_target_bpt_rid">
|
2024 |
+
<xsd:selector xpath=".//xlf:bpt"/>
|
2025 |
+
<xsd:field xpath="@rid"/>
|
2026 |
+
</xsd:unique>
|
2027 |
+
<xsd:keyref name="KR_target_ept_rid" refer="xlf:U_target_bpt_rid">
|
2028 |
+
<xsd:selector xpath=".//xlf:ept"/>
|
2029 |
+
<xsd:field xpath="@rid"/>
|
2030 |
+
</xsd:keyref>
|
2031 |
+
<xsd:unique name="U_target_bx_rid">
|
2032 |
+
<xsd:selector xpath=".//xlf:bx"/>
|
2033 |
+
<xsd:field xpath="@rid"/>
|
2034 |
+
</xsd:unique>
|
2035 |
+
<xsd:keyref name="KR_target_ex_rid" refer="xlf:U_target_bx_rid">
|
2036 |
+
<xsd:selector xpath=".//xlf:ex"/>
|
2037 |
+
<xsd:field xpath="@rid"/>
|
2038 |
+
</xsd:keyref>
|
2039 |
+
</xsd:element>
|
2040 |
+
<xsd:element name="alt-trans">
|
2041 |
+
<xsd:complexType>
|
2042 |
+
<xsd:sequence>
|
2043 |
+
<xsd:element minOccurs="0" ref="xlf:source"/>
|
2044 |
+
<xsd:element minOccurs="0" ref="xlf:seg-source"/>
|
2045 |
+
<xsd:element maxOccurs="1" ref="xlf:target"/>
|
2046 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/>
|
2047 |
+
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/>
|
2048 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
2049 |
+
</xsd:sequence>
|
2050 |
+
<xsd:attribute name="match-quality" type="xsd:string" use="optional"/>
|
2051 |
+
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
|
2052 |
+
<xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/>
|
2053 |
+
<xsd:attribute ref="xml:lang" use="optional"/>
|
2054 |
+
<xsd:attribute name="origin" type="xsd:string" use="optional"/>
|
2055 |
+
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
|
2056 |
+
<xsd:attribute default="default" ref="xml:space" use="optional"/>
|
2057 |
+
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
|
2058 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
2059 |
+
<xsd:attribute name="extradata" type="xsd:string" use="optional"/>
|
2060 |
+
<xsd:attribute name="extype" type="xsd:string" use="optional"/>
|
2061 |
+
<xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/>
|
2062 |
+
<xsd:attribute name="menu" type="xsd:string" use="optional"/>
|
2063 |
+
<xsd:attribute name="menu-option" type="xsd:string" use="optional"/>
|
2064 |
+
<xsd:attribute name="menu-name" type="xsd:string" use="optional"/>
|
2065 |
+
<xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/>
|
2066 |
+
<xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/>
|
2067 |
+
<xsd:attribute name="font" type="xsd:string" use="optional"/>
|
2068 |
+
<xsd:attribute name="css-style" type="xsd:string" use="optional"/>
|
2069 |
+
<xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/>
|
2070 |
+
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
|
2071 |
+
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
|
2072 |
+
<xsd:attribute default="proposal" name="alttranstype" type="xlf:AttrType_alttranstype" use="optional"/>
|
2073 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2074 |
+
</xsd:complexType>
|
2075 |
+
<xsd:unique name="U_at_segsrc_mid">
|
2076 |
+
<xsd:selector xpath="./xlf:seg-source/xlf:mrk"/>
|
2077 |
+
<xsd:field xpath="@mid"/>
|
2078 |
+
</xsd:unique>
|
2079 |
+
<xsd:keyref name="KR_at_segsrc_mid" refer="xlf:U_at_segsrc_mid">
|
2080 |
+
<xsd:selector xpath="./xlf:target/xlf:mrk"/>
|
2081 |
+
<xsd:field xpath="@mid"/>
|
2082 |
+
</xsd:keyref>
|
2083 |
+
</xsd:element>
|
2084 |
+
<xsd:element name="bin-unit">
|
2085 |
+
<xsd:complexType>
|
2086 |
+
<xsd:sequence>
|
2087 |
+
<xsd:element ref="xlf:bin-source"/>
|
2088 |
+
<xsd:element minOccurs="0" ref="xlf:bin-target"/>
|
2089 |
+
<xsd:choice maxOccurs="unbounded" minOccurs="0">
|
2090 |
+
<xsd:element ref="xlf:context-group"/>
|
2091 |
+
<xsd:element ref="xlf:count-group"/>
|
2092 |
+
<xsd:element ref="xlf:note"/>
|
2093 |
+
<xsd:element ref="xlf:trans-unit"/>
|
2094 |
+
</xsd:choice>
|
2095 |
+
<xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
|
2096 |
+
</xsd:sequence>
|
2097 |
+
<xsd:attribute name="id" type="xsd:string" use="required"/>
|
2098 |
+
<xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="required"/>
|
2099 |
+
<xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/>
|
2100 |
+
<xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/>
|
2101 |
+
<xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/>
|
2102 |
+
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
|
2103 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
2104 |
+
<xsd:attribute name="phase-name" type="xsd:string" use="optional"/>
|
2105 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2106 |
+
</xsd:complexType>
|
2107 |
+
</xsd:element>
|
2108 |
+
<xsd:element name="bin-source">
|
2109 |
+
<xsd:complexType>
|
2110 |
+
<xsd:choice>
|
2111 |
+
<xsd:element ref="xlf:internal-file"/>
|
2112 |
+
<xsd:element ref="xlf:external-file"/>
|
2113 |
+
</xsd:choice>
|
2114 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2115 |
+
</xsd:complexType>
|
2116 |
+
</xsd:element>
|
2117 |
+
<xsd:element name="bin-target">
|
2118 |
+
<xsd:complexType>
|
2119 |
+
<xsd:choice>
|
2120 |
+
<xsd:element ref="xlf:internal-file"/>
|
2121 |
+
<xsd:element ref="xlf:external-file"/>
|
2122 |
+
</xsd:choice>
|
2123 |
+
<xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="optional"/>
|
2124 |
+
<xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/>
|
2125 |
+
<xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/>
|
2126 |
+
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
|
2127 |
+
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
|
2128 |
+
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
|
2129 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2130 |
+
</xsd:complexType>
|
2131 |
+
</xsd:element>
|
2132 |
+
<!-- Element for inline codes -->
|
2133 |
+
<xsd:element name="g">
|
2134 |
+
<xsd:complexType mixed="true">
|
2135 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
2136 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/>
|
2137 |
+
<xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/>
|
2138 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2139 |
+
</xsd:complexType>
|
2140 |
+
</xsd:element>
|
2141 |
+
<xsd:element name="x">
|
2142 |
+
<xsd:complexType>
|
2143 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/>
|
2144 |
+
<xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/>
|
2145 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2146 |
+
</xsd:complexType>
|
2147 |
+
</xsd:element>
|
2148 |
+
<xsd:element name="bx">
|
2149 |
+
<xsd:complexType>
|
2150 |
+
<xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/>
|
2151 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/>
|
2152 |
+
<xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/>
|
2153 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2154 |
+
</xsd:complexType>
|
2155 |
+
</xsd:element>
|
2156 |
+
<xsd:element name="ex">
|
2157 |
+
<xsd:complexType>
|
2158 |
+
<xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/>
|
2159 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2160 |
+
</xsd:complexType>
|
2161 |
+
</xsd:element>
|
2162 |
+
<xsd:element name="ph">
|
2163 |
+
<xsd:complexType mixed="true">
|
2164 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
2165 |
+
<xsd:element ref="xlf:sub"/>
|
2166 |
+
</xsd:sequence>
|
2167 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/>
|
2168 |
+
<xsd:attribute name="crc" type="xsd:string" use="optional"/>
|
2169 |
+
<xsd:attribute name="assoc" type="xlf:AttrType_assoc" use="optional"/>
|
2170 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2171 |
+
</xsd:complexType>
|
2172 |
+
</xsd:element>
|
2173 |
+
<xsd:element name="bpt">
|
2174 |
+
<xsd:complexType mixed="true">
|
2175 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
2176 |
+
<xsd:element ref="xlf:sub"/>
|
2177 |
+
</xsd:sequence>
|
2178 |
+
<xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/>
|
2179 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/>
|
2180 |
+
<xsd:attribute name="crc" type="xsd:string" use="optional"/>
|
2181 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2182 |
+
</xsd:complexType>
|
2183 |
+
</xsd:element>
|
2184 |
+
<xsd:element name="ept">
|
2185 |
+
<xsd:complexType mixed="true">
|
2186 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
2187 |
+
<xsd:element ref="xlf:sub"/>
|
2188 |
+
</xsd:sequence>
|
2189 |
+
<xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/>
|
2190 |
+
<xsd:attribute name="crc" type="xsd:string" use="optional"/>
|
2191 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2192 |
+
</xsd:complexType>
|
2193 |
+
</xsd:element>
|
2194 |
+
<xsd:element name="it">
|
2195 |
+
<xsd:complexType mixed="true">
|
2196 |
+
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
|
2197 |
+
<xsd:element ref="xlf:sub"/>
|
2198 |
+
</xsd:sequence>
|
2199 |
+
<xsd:attribute name="pos" type="xlf:AttrType_Position" use="required"/>
|
2200 |
+
<xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/>
|
2201 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/>
|
2202 |
+
<xsd:attribute name="crc" type="xsd:string" use="optional"/>
|
2203 |
+
<xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/>
|
2204 |
+
</xsd:complexType>
|
2205 |
+
</xsd:element>
|
2206 |
+
<xsd:element name="sub">
|
2207 |
+
<xsd:complexType mixed="true">
|
2208 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
2209 |
+
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
|
2210 |
+
<xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/>
|
2211 |
+
<xsd:attribute name="xid" type="xsd:string" use="optional"/>
|
2212 |
+
</xsd:complexType>
|
2213 |
+
</xsd:element>
|
2214 |
+
<xsd:element name="mrk">
|
2215 |
+
<xsd:complexType mixed="true">
|
2216 |
+
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
|
2217 |
+
<xsd:attribute name="mtype" type="xlf:AttrType_mtype" use="required"/>
|
2218 |
+
<xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/>
|
2219 |
+
<xsd:attribute name="comment" type="xsd:string" use="optional"/>
|
2220 |
+
<xsd:anyAttribute namespace="##other" processContents="strict"/>
|
2221 |
+
</xsd:complexType>
|
2222 |
+
</xsd:element>
|
2223 |
+
</xsd:schema>
|
src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd
ADDED
@@ -0,0 +1,411 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
|
4 |
+
XLIFF Version 2.0
|
5 |
+
OASIS Standard
|
6 |
+
05 August 2014
|
7 |
+
Copyright (c) OASIS Open 2014. All rights reserved.
|
8 |
+
Source: http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/schemas/
|
9 |
+
-->
|
10 |
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
11 |
+
elementFormDefault="qualified"
|
12 |
+
xmlns:xlf="urn:oasis:names:tc:xliff:document:2.0"
|
13 |
+
targetNamespace="urn:oasis:names:tc:xliff:document:2.0">
|
14 |
+
|
15 |
+
<!-- Import -->
|
16 |
+
|
17 |
+
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
|
18 |
+
schemaLocation="informativeCopiesOf3rdPartySchemas/w3c/xml.xsd"/>
|
19 |
+
|
20 |
+
<!-- Element Group -->
|
21 |
+
|
22 |
+
<xs:group name="inline">
|
23 |
+
<xs:choice>
|
24 |
+
<xs:element ref="xlf:cp"/>
|
25 |
+
<xs:element ref="xlf:ph"/>
|
26 |
+
<xs:element ref="xlf:pc"/>
|
27 |
+
<xs:element ref="xlf:sc"/>
|
28 |
+
<xs:element ref="xlf:ec"/>
|
29 |
+
<xs:element ref="xlf:mrk"/>
|
30 |
+
<xs:element ref="xlf:sm"/>
|
31 |
+
<xs:element ref="xlf:em"/>
|
32 |
+
</xs:choice>
|
33 |
+
</xs:group>
|
34 |
+
|
35 |
+
<!-- Attribute Types -->
|
36 |
+
|
37 |
+
<xs:simpleType name="yesNo">
|
38 |
+
<xs:restriction base="xs:string">
|
39 |
+
<xs:enumeration value="yes"/>
|
40 |
+
<xs:enumeration value="no"/>
|
41 |
+
</xs:restriction>
|
42 |
+
</xs:simpleType>
|
43 |
+
|
44 |
+
<xs:simpleType name="yesNoFirstNo">
|
45 |
+
<xs:restriction base="xs:string">
|
46 |
+
<xs:enumeration value="yes"/>
|
47 |
+
<xs:enumeration value="firstNo"/>
|
48 |
+
<xs:enumeration value="no"/>
|
49 |
+
</xs:restriction>
|
50 |
+
</xs:simpleType>
|
51 |
+
|
52 |
+
<xs:simpleType name="dirValue">
|
53 |
+
<xs:restriction base="xs:string">
|
54 |
+
<xs:enumeration value="ltr"/>
|
55 |
+
<xs:enumeration value="rtl"/>
|
56 |
+
<xs:enumeration value="auto"/>
|
57 |
+
</xs:restriction>
|
58 |
+
</xs:simpleType>
|
59 |
+
|
60 |
+
<xs:simpleType name="appliesTo">
|
61 |
+
<xs:restriction base="xs:string">
|
62 |
+
<xs:enumeration value="source"/>
|
63 |
+
<xs:enumeration value="target"/>
|
64 |
+
</xs:restriction>
|
65 |
+
</xs:simpleType>
|
66 |
+
|
67 |
+
<xs:simpleType name="userDefinedValue">
|
68 |
+
<xs:restriction base="xs:string">
|
69 |
+
<xs:pattern value="[^\s:]+:[^\s:]+"/>
|
70 |
+
</xs:restriction>
|
71 |
+
</xs:simpleType>
|
72 |
+
|
73 |
+
<xs:simpleType name="attrType_type">
|
74 |
+
<xs:restriction base="xs:string">
|
75 |
+
<xs:enumeration value="fmt"/>
|
76 |
+
<xs:enumeration value="ui"/>
|
77 |
+
<xs:enumeration value="quote"/>
|
78 |
+
<xs:enumeration value="link"/>
|
79 |
+
<xs:enumeration value="image"/>
|
80 |
+
<xs:enumeration value="other"/>
|
81 |
+
</xs:restriction>
|
82 |
+
</xs:simpleType>
|
83 |
+
|
84 |
+
<xs:simpleType name="typeForMrkValues">
|
85 |
+
<xs:restriction base="xs:NMTOKEN">
|
86 |
+
<xs:enumeration value="generic"/>
|
87 |
+
<xs:enumeration value="comment"/>
|
88 |
+
<xs:enumeration value="term"/>
|
89 |
+
</xs:restriction>
|
90 |
+
</xs:simpleType>
|
91 |
+
|
92 |
+
<xs:simpleType name="attrType_typeForMrk">
|
93 |
+
<xs:union memberTypes="xlf:typeForMrkValues xlf:userDefinedValue"/>
|
94 |
+
</xs:simpleType>
|
95 |
+
|
96 |
+
<xs:simpleType name="priorityValue">
|
97 |
+
<xs:restriction base="xs:positiveInteger">
|
98 |
+
<xs:minInclusive value="1"/>
|
99 |
+
<xs:maxInclusive value="10"/>
|
100 |
+
</xs:restriction>
|
101 |
+
</xs:simpleType>
|
102 |
+
|
103 |
+
<xs:simpleType name="stateType">
|
104 |
+
<xs:restriction base="xs:string">
|
105 |
+
<xs:enumeration value="initial"/>
|
106 |
+
<xs:enumeration value="translated"/>
|
107 |
+
<xs:enumeration value="reviewed"/>
|
108 |
+
<xs:enumeration value="final"/>
|
109 |
+
</xs:restriction>
|
110 |
+
</xs:simpleType>
|
111 |
+
|
112 |
+
<!-- Structural Elements -->
|
113 |
+
|
114 |
+
<xs:element name="xliff">
|
115 |
+
<xs:complexType mixed="false">
|
116 |
+
<xs:sequence>
|
117 |
+
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:file"/>
|
118 |
+
</xs:sequence>
|
119 |
+
<xs:attribute name="version" use="required"/>
|
120 |
+
<xs:attribute name="srcLang" use="required"/>
|
121 |
+
<xs:attribute name="trgLang" use="optional"/>
|
122 |
+
<xs:attribute ref="xml:space" use="optional" default="default"/>
|
123 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
124 |
+
</xs:complexType>
|
125 |
+
</xs:element>
|
126 |
+
|
127 |
+
<xs:element name="file">
|
128 |
+
<xs:complexType mixed="false">
|
129 |
+
<xs:sequence>
|
130 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:skeleton"/>
|
131 |
+
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
132 |
+
processContents="lax"/>
|
133 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
134 |
+
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
135 |
+
<xs:element ref="xlf:unit"/>
|
136 |
+
<xs:element ref="xlf:group"/>
|
137 |
+
</xs:choice>
|
138 |
+
</xs:sequence>
|
139 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
140 |
+
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo" default="yes"/>
|
141 |
+
<xs:attribute name="original" use="optional"/>
|
142 |
+
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
|
143 |
+
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue" default="auto"/>
|
144 |
+
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue" default="auto"/>
|
145 |
+
<xs:attribute ref="xml:space" use="optional"/>
|
146 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
147 |
+
</xs:complexType>
|
148 |
+
</xs:element>
|
149 |
+
|
150 |
+
<xs:element name="skeleton">
|
151 |
+
<xs:complexType mixed="true">
|
152 |
+
<xs:sequence>
|
153 |
+
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
154 |
+
processContents="lax"/>
|
155 |
+
</xs:sequence>
|
156 |
+
<xs:attribute name="href" use="optional"/>
|
157 |
+
</xs:complexType>
|
158 |
+
</xs:element>
|
159 |
+
|
160 |
+
<xs:element name="group">
|
161 |
+
<xs:complexType mixed="false">
|
162 |
+
<xs:sequence>
|
163 |
+
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
164 |
+
processContents="lax"/>
|
165 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
166 |
+
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
167 |
+
<xs:element ref="xlf:unit"/>
|
168 |
+
<xs:element ref="xlf:group"/>
|
169 |
+
</xs:choice>
|
170 |
+
</xs:sequence>
|
171 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
172 |
+
<xs:attribute name="name" use="optional"/>
|
173 |
+
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
174 |
+
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
175 |
+
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
|
176 |
+
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
|
177 |
+
<xs:attribute name="type" use="optional" type="xlf:userDefinedValue"/>
|
178 |
+
<xs:attribute ref="xml:space" use="optional"/>
|
179 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
180 |
+
</xs:complexType>
|
181 |
+
</xs:element>
|
182 |
+
|
183 |
+
<xs:element name="unit">
|
184 |
+
<xs:complexType mixed="false">
|
185 |
+
<xs:sequence>
|
186 |
+
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
187 |
+
processContents="lax"/>
|
188 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
189 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:originalData"/>
|
190 |
+
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
191 |
+
<xs:element ref="xlf:segment"/>
|
192 |
+
<xs:element ref="xlf:ignorable"/>
|
193 |
+
</xs:choice>
|
194 |
+
</xs:sequence>
|
195 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
196 |
+
<xs:attribute name="name" use="optional"/>
|
197 |
+
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
198 |
+
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
199 |
+
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
|
200 |
+
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
|
201 |
+
<xs:attribute ref="xml:space" use="optional"/>
|
202 |
+
<xs:attribute name="type" use="optional" type="xlf:userDefinedValue"/>
|
203 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
204 |
+
</xs:complexType>
|
205 |
+
</xs:element>
|
206 |
+
|
207 |
+
<xs:element name="segment">
|
208 |
+
<xs:complexType mixed="false">
|
209 |
+
<xs:sequence>
|
210 |
+
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
|
211 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
|
212 |
+
</xs:sequence>
|
213 |
+
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
214 |
+
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
215 |
+
<xs:attribute name="state" use="optional" type="xlf:stateType" default="initial"/>
|
216 |
+
<xs:attribute name="subState" use="optional"/>
|
217 |
+
</xs:complexType>
|
218 |
+
</xs:element>
|
219 |
+
|
220 |
+
<xs:element name="ignorable">
|
221 |
+
<xs:complexType mixed="false">
|
222 |
+
<xs:sequence>
|
223 |
+
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
|
224 |
+
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
|
225 |
+
</xs:sequence>
|
226 |
+
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
227 |
+
</xs:complexType>
|
228 |
+
</xs:element>
|
229 |
+
|
230 |
+
<xs:element name="notes">
|
231 |
+
<xs:complexType mixed="false">
|
232 |
+
<xs:sequence>
|
233 |
+
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:note"/>
|
234 |
+
</xs:sequence>
|
235 |
+
</xs:complexType>
|
236 |
+
</xs:element>
|
237 |
+
|
238 |
+
<xs:element name="note">
|
239 |
+
<xs:complexType mixed="true">
|
240 |
+
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
241 |
+
<xs:attribute name="appliesTo" use="optional" type="xlf:appliesTo"/>
|
242 |
+
<xs:attribute name="category" use="optional"/>
|
243 |
+
<xs:attribute name="priority" use="optional" type="xlf:priorityValue" default="1"/>
|
244 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
245 |
+
</xs:complexType>
|
246 |
+
</xs:element>
|
247 |
+
|
248 |
+
<xs:element name="originalData">
|
249 |
+
<xs:complexType mixed="false">
|
250 |
+
<xs:sequence>
|
251 |
+
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:data"/>
|
252 |
+
</xs:sequence>
|
253 |
+
</xs:complexType>
|
254 |
+
</xs:element>
|
255 |
+
|
256 |
+
<xs:element name="data">
|
257 |
+
<xs:complexType mixed="true">
|
258 |
+
<xs:sequence>
|
259 |
+
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:cp"/>
|
260 |
+
</xs:sequence>
|
261 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
262 |
+
<xs:attribute name="dir" use="optional" type="xlf:dirValue" default="auto"/>
|
263 |
+
<xs:attribute ref="xml:space" use="optional" fixed="preserve"/>
|
264 |
+
</xs:complexType>
|
265 |
+
</xs:element>
|
266 |
+
|
267 |
+
<xs:element name="source">
|
268 |
+
<xs:complexType mixed="true">
|
269 |
+
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
270 |
+
<xs:attribute ref="xml:lang" use="optional"/>
|
271 |
+
<xs:attribute ref="xml:space" use="optional"/>
|
272 |
+
</xs:complexType>
|
273 |
+
</xs:element>
|
274 |
+
|
275 |
+
<xs:element name="target">
|
276 |
+
<xs:complexType mixed="true">
|
277 |
+
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
278 |
+
<xs:attribute ref="xml:lang" use="optional"/>
|
279 |
+
<xs:attribute ref="xml:space" use="optional"/>
|
280 |
+
<xs:attribute name="order" use="optional" type="xs:positiveInteger"/>
|
281 |
+
</xs:complexType>
|
282 |
+
</xs:element>
|
283 |
+
|
284 |
+
<!-- Inline Elements -->
|
285 |
+
|
286 |
+
<xs:element name="cp">
|
287 |
+
<!-- Code Point -->
|
288 |
+
<xs:complexType mixed="false">
|
289 |
+
<xs:attribute name="hex" use="required" type="xs:hexBinary"/>
|
290 |
+
</xs:complexType>
|
291 |
+
</xs:element>
|
292 |
+
|
293 |
+
<xs:element name="ph">
|
294 |
+
<!-- Placeholder -->
|
295 |
+
<xs:complexType mixed="false">
|
296 |
+
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
297 |
+
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
298 |
+
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
299 |
+
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
300 |
+
<xs:attribute name="disp" use="optional"/>
|
301 |
+
<xs:attribute name="equiv" use="optional"/>
|
302 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
303 |
+
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
304 |
+
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
305 |
+
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
306 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
307 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
308 |
+
</xs:complexType>
|
309 |
+
</xs:element>
|
310 |
+
|
311 |
+
<xs:element name="pc">
|
312 |
+
<!-- Paired Code -->
|
313 |
+
<xs:complexType mixed="true">
|
314 |
+
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
315 |
+
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
316 |
+
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
317 |
+
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo"/>
|
318 |
+
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
319 |
+
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
320 |
+
<xs:attribute name="dispEnd" use="optional"/>
|
321 |
+
<xs:attribute name="dispStart" use="optional"/>
|
322 |
+
<xs:attribute name="equivEnd" use="optional"/>
|
323 |
+
<xs:attribute name="equivStart" use="optional"/>
|
324 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
325 |
+
<xs:attribute name="dataRefEnd" use="optional" type="xs:NMTOKEN"/>
|
326 |
+
<xs:attribute name="dataRefStart" use="optional" type="xs:NMTOKEN"/>
|
327 |
+
<xs:attribute name="subFlowsEnd" use="optional" type="xs:NMTOKENS"/>
|
328 |
+
<xs:attribute name="subFlowsStart" use="optional" type="xs:NMTOKENS"/>
|
329 |
+
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
330 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
331 |
+
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
332 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
333 |
+
</xs:complexType>
|
334 |
+
</xs:element>
|
335 |
+
|
336 |
+
<xs:element name="sc">
|
337 |
+
<!-- Start Code -->
|
338 |
+
<xs:complexType mixed="false">
|
339 |
+
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
340 |
+
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
341 |
+
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo" default="yes"/>
|
342 |
+
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
343 |
+
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
344 |
+
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
345 |
+
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
346 |
+
<xs:attribute name="disp" use="optional"/>
|
347 |
+
<xs:attribute name="equiv" use="optional"/>
|
348 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
349 |
+
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
|
350 |
+
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
351 |
+
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
352 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
353 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
354 |
+
</xs:complexType>
|
355 |
+
</xs:element>
|
356 |
+
|
357 |
+
<xs:element name="ec">
|
358 |
+
<!-- End Code -->
|
359 |
+
<xs:complexType mixed="false">
|
360 |
+
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
361 |
+
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
362 |
+
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo" default="yes"/>
|
363 |
+
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
364 |
+
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
365 |
+
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
366 |
+
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
367 |
+
<xs:attribute name="disp" use="optional"/>
|
368 |
+
<xs:attribute name="equiv" use="optional"/>
|
369 |
+
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
370 |
+
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
|
371 |
+
<xs:attribute name="startRef" use="optional" type="xs:NMTOKEN"/>
|
372 |
+
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
373 |
+
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
374 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
375 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
376 |
+
</xs:complexType>
|
377 |
+
</xs:element>
|
378 |
+
|
379 |
+
<xs:element name="mrk">
|
380 |
+
<!-- Annotation Marker -->
|
381 |
+
<xs:complexType mixed="true">
|
382 |
+
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
383 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
384 |
+
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
385 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_typeForMrk"/>
|
386 |
+
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
|
387 |
+
<xs:attribute name="value" use="optional"/>
|
388 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
389 |
+
</xs:complexType>
|
390 |
+
</xs:element>
|
391 |
+
|
392 |
+
<xs:element name="sm">
|
393 |
+
<!-- Start Annotation Marker -->
|
394 |
+
<xs:complexType mixed="false">
|
395 |
+
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
396 |
+
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
397 |
+
<xs:attribute name="type" use="optional" type="xlf:attrType_typeForMrk"/>
|
398 |
+
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
|
399 |
+
<xs:attribute name="value" use="optional"/>
|
400 |
+
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
401 |
+
</xs:complexType>
|
402 |
+
</xs:element>
|
403 |
+
|
404 |
+
<xs:element name="em">
|
405 |
+
<!-- End Annotation Marker -->
|
406 |
+
<xs:complexType mixed="false">
|
407 |
+
<xs:attribute name="startRef" use="required" type="xs:NMTOKEN"/>
|
408 |
+
</xs:complexType>
|
409 |
+
</xs:element>
|
410 |
+
|
411 |
+
</xs:schema>
|
src/common/lib/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd
ADDED
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version='1.0'?>
|
2 |
+
<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
|
3 |
+
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
|
4 |
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
5 |
+
xmlns ="http://www.w3.org/1999/xhtml"
|
6 |
+
xml:lang="en">
|
7 |
+
|
8 |
+
<xs:annotation>
|
9 |
+
<xs:documentation>
|
10 |
+
<div>
|
11 |
+
<h1>About the XML namespace</h1>
|
12 |
+
|
13 |
+
<div class="bodytext">
|
14 |
+
<p>
|
15 |
+
|
16 |
+
This schema document describes the XML namespace, in a form
|
17 |
+
suitable for import by other schema documents.
|
18 |
+
</p>
|
19 |
+
<p>
|
20 |
+
See <a href="http://www.w3.org/XML/1998/namespace.html">
|
21 |
+
http://www.w3.org/XML/1998/namespace.html</a> and
|
22 |
+
<a href="http://www.w3.org/TR/REC-xml">
|
23 |
+
http://www.w3.org/TR/REC-xml</a> for information
|
24 |
+
about this namespace.
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
Note that local names in this namespace are intended to be
|
29 |
+
defined only by the World Wide Web Consortium or its subgroups.
|
30 |
+
The names currently defined in this namespace are listed below.
|
31 |
+
They should not be used with conflicting semantics by any Working
|
32 |
+
Group, specification, or document instance.
|
33 |
+
</p>
|
34 |
+
<p>
|
35 |
+
See further below in this document for more information about <a
|
36 |
+
href="#usage">how to refer to this schema document from your own
|
37 |
+
XSD schema documents</a> and about <a href="#nsversioning">the
|
38 |
+
namespace-versioning policy governing this schema document</a>.
|
39 |
+
</p>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
</xs:documentation>
|
44 |
+
</xs:annotation>
|
45 |
+
|
46 |
+
<xs:attribute name="lang">
|
47 |
+
<xs:annotation>
|
48 |
+
<xs:documentation>
|
49 |
+
<div>
|
50 |
+
|
51 |
+
<h3>lang (as an attribute name)</h3>
|
52 |
+
<p>
|
53 |
+
|
54 |
+
denotes an attribute whose value
|
55 |
+
is a language code for the natural language of the content of
|
56 |
+
any element; its value is inherited. This name is reserved
|
57 |
+
by virtue of its definition in the XML specification.</p>
|
58 |
+
|
59 |
+
</div>
|
60 |
+
<div>
|
61 |
+
<h4>Notes</h4>
|
62 |
+
<p>
|
63 |
+
Attempting to install the relevant ISO 2- and 3-letter
|
64 |
+
codes as the enumerated possible values is probably never
|
65 |
+
going to be a realistic possibility.
|
66 |
+
</p>
|
67 |
+
<p>
|
68 |
+
|
69 |
+
See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
|
70 |
+
http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
|
71 |
+
and the IANA language subtag registry at
|
72 |
+
<a href="http://www.iana.org/assignments/language-subtag-registry">
|
73 |
+
http://www.iana.org/assignments/language-subtag-registry</a>
|
74 |
+
for further information.
|
75 |
+
</p>
|
76 |
+
<p>
|
77 |
+
|
78 |
+
The union allows for the 'un-declaration' of xml:lang with
|
79 |
+
the empty string.
|
80 |
+
</p>
|
81 |
+
</div>
|
82 |
+
</xs:documentation>
|
83 |
+
</xs:annotation>
|
84 |
+
<xs:simpleType>
|
85 |
+
<xs:union memberTypes="xs:language">
|
86 |
+
<xs:simpleType>
|
87 |
+
<xs:restriction base="xs:string">
|
88 |
+
<xs:enumeration value=""/>
|
89 |
+
|
90 |
+
</xs:restriction>
|
91 |
+
</xs:simpleType>
|
92 |
+
</xs:union>
|
93 |
+
</xs:simpleType>
|
94 |
+
</xs:attribute>
|
95 |
+
|
96 |
+
<xs:attribute name="space">
|
97 |
+
<xs:annotation>
|
98 |
+
<xs:documentation>
|
99 |
+
|
100 |
+
<div>
|
101 |
+
|
102 |
+
<h3>space (as an attribute name)</h3>
|
103 |
+
<p>
|
104 |
+
denotes an attribute whose
|
105 |
+
value is a keyword indicating what whitespace processing
|
106 |
+
discipline is intended for the content of the element; its
|
107 |
+
value is inherited. This name is reserved by virtue of its
|
108 |
+
definition in the XML specification.</p>
|
109 |
+
|
110 |
+
</div>
|
111 |
+
</xs:documentation>
|
112 |
+
</xs:annotation>
|
113 |
+
<xs:simpleType>
|
114 |
+
|
115 |
+
<xs:restriction base="xs:NCName">
|
116 |
+
<xs:enumeration value="default"/>
|
117 |
+
<xs:enumeration value="preserve"/>
|
118 |
+
</xs:restriction>
|
119 |
+
</xs:simpleType>
|
120 |
+
</xs:attribute>
|
121 |
+
|
122 |
+
<xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
|
123 |
+
<xs:documentation>
|
124 |
+
|
125 |
+
<div>
|
126 |
+
|
127 |
+
<h3>base (as an attribute name)</h3>
|
128 |
+
<p>
|
129 |
+
denotes an attribute whose value
|
130 |
+
provides a URI to be used as the base for interpreting any
|
131 |
+
relative URIs in the scope of the element on which it
|
132 |
+
appears; its value is inherited. This name is reserved
|
133 |
+
by virtue of its definition in the XML Base specification.</p>
|
134 |
+
|
135 |
+
<p>
|
136 |
+
See <a
|
137 |
+
href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
|
138 |
+
for information about this attribute.
|
139 |
+
</p>
|
140 |
+
|
141 |
+
</div>
|
142 |
+
</xs:documentation>
|
143 |
+
</xs:annotation>
|
144 |
+
</xs:attribute>
|
145 |
+
|
146 |
+
<xs:attribute name="id" type="xs:ID">
|
147 |
+
<xs:annotation>
|
148 |
+
<xs:documentation>
|
149 |
+
<div>
|
150 |
+
|
151 |
+
<h3>id (as an attribute name)</h3>
|
152 |
+
<p>
|
153 |
+
|
154 |
+
denotes an attribute whose value
|
155 |
+
should be interpreted as if declared to be of type ID.
|
156 |
+
This name is reserved by virtue of its definition in the
|
157 |
+
xml:id specification.</p>
|
158 |
+
|
159 |
+
<p>
|
160 |
+
See <a
|
161 |
+
href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
|
162 |
+
for information about this attribute.
|
163 |
+
</p>
|
164 |
+
</div>
|
165 |
+
</xs:documentation>
|
166 |
+
</xs:annotation>
|
167 |
+
|
168 |
+
</xs:attribute>
|
169 |
+
|
170 |
+
<xs:attributeGroup name="specialAttrs">
|
171 |
+
<xs:attribute ref="xml:base"/>
|
172 |
+
<xs:attribute ref="xml:lang"/>
|
173 |
+
<xs:attribute ref="xml:space"/>
|
174 |
+
<xs:attribute ref="xml:id"/>
|
175 |
+
</xs:attributeGroup>
|
176 |
+
|
177 |
+
<xs:annotation>
|
178 |
+
|
179 |
+
<xs:documentation>
|
180 |
+
<div>
|
181 |
+
|
182 |
+
<h3>Father (in any context at all)</h3>
|
183 |
+
|
184 |
+
<div class="bodytext">
|
185 |
+
<p>
|
186 |
+
denotes Jon Bosak, the chair of
|
187 |
+
the original XML Working Group. This name is reserved by
|
188 |
+
the following decision of the W3C XML Plenary and
|
189 |
+
XML Coordination groups:
|
190 |
+
</p>
|
191 |
+
<blockquote>
|
192 |
+
<p>
|
193 |
+
|
194 |
+
In appreciation for his vision, leadership and
|
195 |
+
dedication the W3C XML Plenary on this 10th day of
|
196 |
+
February, 2000, reserves for Jon Bosak in perpetuity
|
197 |
+
the XML name "xml:Father".
|
198 |
+
</p>
|
199 |
+
</blockquote>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</xs:documentation>
|
203 |
+
</xs:annotation>
|
204 |
+
|
205 |
+
<xs:annotation>
|
206 |
+
<xs:documentation>
|
207 |
+
|
208 |
+
<div xml:id="usage" id="usage">
|
209 |
+
<h2><a name="usage">About this schema document</a></h2>
|
210 |
+
|
211 |
+
<div class="bodytext">
|
212 |
+
<p>
|
213 |
+
This schema defines attributes and an attribute group suitable
|
214 |
+
for use by schemas wishing to allow <code>xml:base</code>,
|
215 |
+
<code>xml:lang</code>, <code>xml:space</code> or
|
216 |
+
<code>xml:id</code> attributes on elements they define.
|
217 |
+
</p>
|
218 |
+
|
219 |
+
<p>
|
220 |
+
To enable this, such a schema must import this schema for
|
221 |
+
the XML namespace, e.g. as follows:
|
222 |
+
</p>
|
223 |
+
<pre>
|
224 |
+
<schema.. .>
|
225 |
+
.. .
|
226 |
+
<import namespace="http://www.w3.org/XML/1998/namespace"
|
227 |
+
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
|
228 |
+
</pre>
|
229 |
+
<p>
|
230 |
+
or
|
231 |
+
</p>
|
232 |
+
<pre>
|
233 |
+
|
234 |
+
<import namespace="http://www.w3.org/XML/1998/namespace"
|
235 |
+
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
|
236 |
+
</pre>
|
237 |
+
<p>
|
238 |
+
Subsequently, qualified reference to any of the attributes or the
|
239 |
+
group defined below will have the desired effect, e.g.
|
240 |
+
</p>
|
241 |
+
<pre>
|
242 |
+
<type.. .>
|
243 |
+
.. .
|
244 |
+
<attributeGroup ref="xml:specialAttrs"/>
|
245 |
+
</pre>
|
246 |
+
<p>
|
247 |
+
will define a type which will schema-validate an instance element
|
248 |
+
with any of those attributes.
|
249 |
+
</p>
|
250 |
+
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
</xs:documentation>
|
254 |
+
</xs:annotation>
|
255 |
+
|
256 |
+
<xs:annotation>
|
257 |
+
<xs:documentation>
|
258 |
+
<div id="nsversioning" xml:id="nsversioning">
|
259 |
+
<h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
|
260 |
+
|
261 |
+
<div class="bodytext">
|
262 |
+
<p>
|
263 |
+
In keeping with the XML Schema WG's standard versioning
|
264 |
+
policy, this schema document will persist at
|
265 |
+
<a href="http://www.w3.org/2009/01/xml.xsd">
|
266 |
+
http://www.w3.org/2009/01/xml.xsd</a>.
|
267 |
+
</p>
|
268 |
+
<p>
|
269 |
+
At the date of issue it can also be found at
|
270 |
+
<a href="http://www.w3.org/2001/xml.xsd">
|
271 |
+
http://www.w3.org/2001/xml.xsd</a>.
|
272 |
+
</p>
|
273 |
+
|
274 |
+
<p>
|
275 |
+
The schema document at that URI may however change in the future,
|
276 |
+
in order to remain compatible with the latest version of XML
|
277 |
+
Schema itself, or with the XML namespace itself. In other words,
|
278 |
+
if the XML Schema or XML namespaces change, the version of this
|
279 |
+
document at <a href="http://www.w3.org/2001/xml.xsd">
|
280 |
+
http://www.w3.org/2001/xml.xsd
|
281 |
+
</a>
|
282 |
+
will change accordingly; the version at
|
283 |
+
<a href="http://www.w3.org/2009/01/xml.xsd">
|
284 |
+
http://www.w3.org/2009/01/xml.xsd
|
285 |
+
</a>
|
286 |
+
will not change.
|
287 |
+
</p>
|
288 |
+
<p>
|
289 |
+
|
290 |
+
Previous dated (and unchanging) versions of this schema
|
291 |
+
document are at:
|
292 |
+
</p>
|
293 |
+
<ul>
|
294 |
+
<li><a href="http://www.w3.org/2009/01/xml.xsd">
|
295 |
+
http://www.w3.org/2009/01/xml.xsd</a></li>
|
296 |
+
<li><a href="http://www.w3.org/2007/08/xml.xsd">
|
297 |
+
http://www.w3.org/2007/08/xml.xsd</a></li>
|
298 |
+
<li><a href="http://www.w3.org/2004/10/xml.xsd">
|
299 |
+
|
300 |
+
http://www.w3.org/2004/10/xml.xsd</a></li>
|
301 |
+
<li><a href="http://www.w3.org/2001/03/xml.xsd">
|
302 |
+
http://www.w3.org/2001/03/xml.xsd</a></li>
|
303 |
+
</ul>
|
304 |
+
</div>
|
305 |
+
</div>
|
306 |
+
</xs:documentation>
|
307 |
+
</xs:annotation>
|
308 |
+
|
309 |
+
</xs:schema>
|
src/common/lib/vendor/symfony/translation/LoggingTranslator.php
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Psr\Log\LoggerInterface;
|
15 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
19 |
+
*/
|
20 |
+
class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* @var TranslatorInterface|TranslatorBagInterface
|
24 |
+
*/
|
25 |
+
private $translator;
|
26 |
+
|
27 |
+
private $logger;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
|
31 |
+
* @param LoggerInterface $logger
|
32 |
+
*/
|
33 |
+
public function __construct(TranslatorInterface $translator, LoggerInterface $logger)
|
34 |
+
{
|
35 |
+
if (!$translator instanceof TranslatorBagInterface) {
|
36 |
+
throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->translator = $translator;
|
40 |
+
$this->logger = $logger;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritdoc}
|
45 |
+
*/
|
46 |
+
public function trans($id, array $parameters = array(), $domain = null, $locale = null)
|
47 |
+
{
|
48 |
+
$trans = $this->translator->trans($id, $parameters, $domain, $locale);
|
49 |
+
$this->log($id, $domain, $locale);
|
50 |
+
|
51 |
+
return $trans;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* {@inheritdoc}
|
56 |
+
*/
|
57 |
+
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
|
58 |
+
{
|
59 |
+
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
|
60 |
+
$this->log($id, $domain, $locale);
|
61 |
+
|
62 |
+
return $trans;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* {@inheritdoc}
|
67 |
+
*/
|
68 |
+
public function setLocale($locale)
|
69 |
+
{
|
70 |
+
$this->translator->setLocale($locale);
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* {@inheritdoc}
|
75 |
+
*/
|
76 |
+
public function getLocale()
|
77 |
+
{
|
78 |
+
return $this->translator->getLocale();
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* {@inheritdoc}
|
83 |
+
*/
|
84 |
+
public function getCatalogue($locale = null)
|
85 |
+
{
|
86 |
+
return $this->translator->getCatalogue($locale);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Gets the fallback locales.
|
91 |
+
*
|
92 |
+
* @return array $locales The fallback locales
|
93 |
+
*/
|
94 |
+
public function getFallbackLocales()
|
95 |
+
{
|
96 |
+
if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
|
97 |
+
return $this->translator->getFallbackLocales();
|
98 |
+
}
|
99 |
+
|
100 |
+
return array();
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Passes through all unknown calls onto the translator object.
|
105 |
+
*/
|
106 |
+
public function __call($method, $args)
|
107 |
+
{
|
108 |
+
return call_user_func_array(array($this->translator, $method), $args);
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Logs for missing translations.
|
113 |
+
*
|
114 |
+
* @param string $id
|
115 |
+
* @param string|null $domain
|
116 |
+
* @param string|null $locale
|
117 |
+
*/
|
118 |
+
private function log($id, $domain, $locale)
|
119 |
+
{
|
120 |
+
if (null === $domain) {
|
121 |
+
$domain = 'messages';
|
122 |
+
}
|
123 |
+
|
124 |
+
$id = (string) $id;
|
125 |
+
$catalogue = $this->translator->getCatalogue($locale);
|
126 |
+
if ($catalogue->defines($id, $domain)) {
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
|
130 |
+
if ($catalogue->has($id, $domain)) {
|
131 |
+
$this->logger->debug('Translation use fallback catalogue.', array('id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()));
|
132 |
+
} else {
|
133 |
+
$this->logger->warning('Translation not found.', array('id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()));
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
src/common/lib/vendor/symfony/translation/MessageCatalogue.php
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Symfony\Component\Config\Resource\ResourceInterface;
|
15 |
+
use Symfony\Component\Translation\Exception\LogicException;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
19 |
+
*/
|
20 |
+
class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface
|
21 |
+
{
|
22 |
+
private $messages = array();
|
23 |
+
private $metadata = array();
|
24 |
+
private $resources = array();
|
25 |
+
private $locale;
|
26 |
+
private $fallbackCatalogue;
|
27 |
+
private $parent;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @param string $locale The locale
|
31 |
+
* @param array $messages An array of messages classified by domain
|
32 |
+
*/
|
33 |
+
public function __construct($locale, array $messages = array())
|
34 |
+
{
|
35 |
+
$this->locale = $locale;
|
36 |
+
$this->messages = $messages;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* {@inheritdoc}
|
41 |
+
*/
|
42 |
+
public function getLocale()
|
43 |
+
{
|
44 |
+
return $this->locale;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* {@inheritdoc}
|
49 |
+
*/
|
50 |
+
public function getDomains()
|
51 |
+
{
|
52 |
+
return array_keys($this->messages);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* {@inheritdoc}
|
57 |
+
*/
|
58 |
+
public function all($domain = null)
|
59 |
+
{
|
60 |
+
if (null === $domain) {
|
61 |
+
return $this->messages;
|
62 |
+
}
|
63 |
+
|
64 |
+
return isset($this->messages[$domain]) ? $this->messages[$domain] : array();
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* {@inheritdoc}
|
69 |
+
*/
|
70 |
+
public function set($id, $translation, $domain = 'messages')
|
71 |
+
{
|
72 |
+
$this->add(array($id => $translation), $domain);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* {@inheritdoc}
|
77 |
+
*/
|
78 |
+
public function has($id, $domain = 'messages')
|
79 |
+
{
|
80 |
+
if (isset($this->messages[$domain][$id])) {
|
81 |
+
return true;
|
82 |
+
}
|
83 |
+
|
84 |
+
if (null !== $this->fallbackCatalogue) {
|
85 |
+
return $this->fallbackCatalogue->has($id, $domain);
|
86 |
+
}
|
87 |
+
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* {@inheritdoc}
|
93 |
+
*/
|
94 |
+
public function defines($id, $domain = 'messages')
|
95 |
+
{
|
96 |
+
return isset($this->messages[$domain][$id]);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* {@inheritdoc}
|
101 |
+
*/
|
102 |
+
public function get($id, $domain = 'messages')
|
103 |
+
{
|
104 |
+
if (isset($this->messages[$domain][$id])) {
|
105 |
+
return $this->messages[$domain][$id];
|
106 |
+
}
|
107 |
+
|
108 |
+
if (null !== $this->fallbackCatalogue) {
|
109 |
+
return $this->fallbackCatalogue->get($id, $domain);
|
110 |
+
}
|
111 |
+
|
112 |
+
return $id;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* {@inheritdoc}
|
117 |
+
*/
|
118 |
+
public function replace($messages, $domain = 'messages')
|
119 |
+
{
|
120 |
+
$this->messages[$domain] = array();
|
121 |
+
|
122 |
+
$this->add($messages, $domain);
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* {@inheritdoc}
|
127 |
+
*/
|
128 |
+
public function add($messages, $domain = 'messages')
|
129 |
+
{
|
130 |
+
if (!isset($this->messages[$domain])) {
|
131 |
+
$this->messages[$domain] = $messages;
|
132 |
+
} else {
|
133 |
+
$this->messages[$domain] = array_replace($this->messages[$domain], $messages);
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* {@inheritdoc}
|
139 |
+
*/
|
140 |
+
public function addCatalogue(MessageCatalogueInterface $catalogue)
|
141 |
+
{
|
142 |
+
if ($catalogue->getLocale() !== $this->locale) {
|
143 |
+
throw new LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s"', $catalogue->getLocale(), $this->locale));
|
144 |
+
}
|
145 |
+
|
146 |
+
foreach ($catalogue->all() as $domain => $messages) {
|
147 |
+
$this->add($messages, $domain);
|
148 |
+
}
|
149 |
+
|
150 |
+
foreach ($catalogue->getResources() as $resource) {
|
151 |
+
$this->addResource($resource);
|
152 |
+
}
|
153 |
+
|
154 |
+
if ($catalogue instanceof MetadataAwareInterface) {
|
155 |
+
$metadata = $catalogue->getMetadata('', '');
|
156 |
+
$this->addMetadata($metadata);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* {@inheritdoc}
|
162 |
+
*/
|
163 |
+
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue)
|
164 |
+
{
|
165 |
+
// detect circular references
|
166 |
+
$c = $catalogue;
|
167 |
+
while ($c = $c->getFallbackCatalogue()) {
|
168 |
+
if ($c->getLocale() === $this->getLocale()) {
|
169 |
+
throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
$c = $this;
|
174 |
+
do {
|
175 |
+
if ($c->getLocale() === $catalogue->getLocale()) {
|
176 |
+
throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));
|
177 |
+
}
|
178 |
+
|
179 |
+
foreach ($catalogue->getResources() as $resource) {
|
180 |
+
$c->addResource($resource);
|
181 |
+
}
|
182 |
+
} while ($c = $c->parent);
|
183 |
+
|
184 |
+
$catalogue->parent = $this;
|
185 |
+
$this->fallbackCatalogue = $catalogue;
|
186 |
+
|
187 |
+
foreach ($catalogue->getResources() as $resource) {
|
188 |
+
$this->addResource($resource);
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* {@inheritdoc}
|
194 |
+
*/
|
195 |
+
public function getFallbackCatalogue()
|
196 |
+
{
|
197 |
+
return $this->fallbackCatalogue;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* {@inheritdoc}
|
202 |
+
*/
|
203 |
+
public function getResources()
|
204 |
+
{
|
205 |
+
return array_values($this->resources);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* {@inheritdoc}
|
210 |
+
*/
|
211 |
+
public function addResource(ResourceInterface $resource)
|
212 |
+
{
|
213 |
+
$this->resources[$resource->__toString()] = $resource;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* {@inheritdoc}
|
218 |
+
*/
|
219 |
+
public function getMetadata($key = '', $domain = 'messages')
|
220 |
+
{
|
221 |
+
if ('' == $domain) {
|
222 |
+
return $this->metadata;
|
223 |
+
}
|
224 |
+
|
225 |
+
if (isset($this->metadata[$domain])) {
|
226 |
+
if ('' == $key) {
|
227 |
+
return $this->metadata[$domain];
|
228 |
+
}
|
229 |
+
|
230 |
+
if (isset($this->metadata[$domain][$key])) {
|
231 |
+
return $this->metadata[$domain][$key];
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* {@inheritdoc}
|
238 |
+
*/
|
239 |
+
public function setMetadata($key, $value, $domain = 'messages')
|
240 |
+
{
|
241 |
+
$this->metadata[$domain][$key] = $value;
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* {@inheritdoc}
|
246 |
+
*/
|
247 |
+
public function deleteMetadata($key = '', $domain = 'messages')
|
248 |
+
{
|
249 |
+
if ('' == $domain) {
|
250 |
+
$this->metadata = array();
|
251 |
+
} elseif ('' == $key) {
|
252 |
+
unset($this->metadata[$domain]);
|
253 |
+
} else {
|
254 |
+
unset($this->metadata[$domain][$key]);
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Adds current values with the new values.
|
260 |
+
*
|
261 |
+
* @param array $values Values to add
|
262 |
+
*/
|
263 |
+
private function addMetadata(array $values)
|
264 |
+
{
|
265 |
+
foreach ($values as $domain => $keys) {
|
266 |
+
foreach ($keys as $key => $value) {
|
267 |
+
$this->setMetadata($key, $value, $domain);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
src/common/lib/vendor/symfony/translation/MessageCatalogueInterface.php
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Symfony\Component\Config\Resource\ResourceInterface;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* MessageCatalogueInterface.
|
18 |
+
*
|
19 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
20 |
+
*/
|
21 |
+
interface MessageCatalogueInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Gets the catalogue locale.
|
25 |
+
*
|
26 |
+
* @return string The locale
|
27 |
+
*/
|
28 |
+
public function getLocale();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Gets the domains.
|
32 |
+
*
|
33 |
+
* @return array An array of domains
|
34 |
+
*/
|
35 |
+
public function getDomains();
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Gets the messages within a given domain.
|
39 |
+
*
|
40 |
+
* If $domain is null, it returns all messages.
|
41 |
+
*
|
42 |
+
* @param string $domain The domain name
|
43 |
+
*
|
44 |
+
* @return array An array of messages
|
45 |
+
*/
|
46 |
+
public function all($domain = null);
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Sets a message translation.
|
50 |
+
*
|
51 |
+
* @param string $id The message id
|
52 |
+
* @param string $translation The messages translation
|
53 |
+
* @param string $domain The domain name
|
54 |
+
*/
|
55 |
+
public function set($id, $translation, $domain = 'messages');
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Checks if a message has a translation.
|
59 |
+
*
|
60 |
+
* @param string $id The message id
|
61 |
+
* @param string $domain The domain name
|
62 |
+
*
|
63 |
+
* @return bool true if the message has a translation, false otherwise
|
64 |
+
*/
|
65 |
+
public function has($id, $domain = 'messages');
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Checks if a message has a translation (it does not take into account the fallback mechanism).
|
69 |
+
*
|
70 |
+
* @param string $id The message id
|
71 |
+
* @param string $domain The domain name
|
72 |
+
*
|
73 |
+
* @return bool true if the message has a translation, false otherwise
|
74 |
+
*/
|
75 |
+
public function defines($id, $domain = 'messages');
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Gets a message translation.
|
79 |
+
*
|
80 |
+
* @param string $id The message id
|
81 |
+
* @param string $domain The domain name
|
82 |
+
*
|
83 |
+
* @return string The message translation
|
84 |
+
*/
|
85 |
+
public function get($id, $domain = 'messages');
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Sets translations for a given domain.
|
89 |
+
*
|
90 |
+
* @param array $messages An array of translations
|
91 |
+
* @param string $domain The domain name
|
92 |
+
*/
|
93 |
+
public function replace($messages, $domain = 'messages');
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Adds translations for a given domain.
|
97 |
+
*
|
98 |
+
* @param array $messages An array of translations
|
99 |
+
* @param string $domain The domain name
|
100 |
+
*/
|
101 |
+
public function add($messages, $domain = 'messages');
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Merges translations from the given Catalogue into the current one.
|
105 |
+
*
|
106 |
+
* The two catalogues must have the same locale.
|
107 |
+
*/
|
108 |
+
public function addCatalogue(MessageCatalogueInterface $catalogue);
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Merges translations from the given Catalogue into the current one
|
112 |
+
* only when the translation does not exist.
|
113 |
+
*
|
114 |
+
* This is used to provide default translations when they do not exist for the current locale.
|
115 |
+
*/
|
116 |
+
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Gets the fallback catalogue.
|
120 |
+
*
|
121 |
+
* @return self|null A MessageCatalogueInterface instance or null when no fallback has been set
|
122 |
+
*/
|
123 |
+
public function getFallbackCatalogue();
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Returns an array of resources loaded to build this collection.
|
127 |
+
*
|
128 |
+
* @return ResourceInterface[] An array of resources
|
129 |
+
*/
|
130 |
+
public function getResources();
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Adds a resource for this collection.
|
134 |
+
*/
|
135 |
+
public function addResource(ResourceInterface $resource);
|
136 |
+
}
|
src/common/lib/vendor/symfony/translation/MessageSelector.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* MessageSelector.
|
18 |
+
*
|
19 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
20 |
+
* @author Bernhard Schussek <bschussek@gmail.com>
|
21 |
+
*/
|
22 |
+
class MessageSelector
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Given a message with different plural translations separated by a
|
26 |
+
* pipe (|), this method returns the correct portion of the message based
|
27 |
+
* on the given number, locale and the pluralization rules in the message
|
28 |
+
* itself.
|
29 |
+
*
|
30 |
+
* The message supports two different types of pluralization rules:
|
31 |
+
*
|
32 |
+
* interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples
|
33 |
+
* indexed: There is one apple|There are %count% apples
|
34 |
+
*
|
35 |
+
* The indexed solution can also contain labels (e.g. one: There is one apple).
|
36 |
+
* This is purely for making the translations more clear - it does not
|
37 |
+
* affect the functionality.
|
38 |
+
*
|
39 |
+
* The two methods can also be mixed:
|
40 |
+
* {0} There are no apples|one: There is one apple|more: There are %count% apples
|
41 |
+
*
|
42 |
+
* @param string $message The message being translated
|
43 |
+
* @param int $number The number of items represented for the message
|
44 |
+
* @param string $locale The locale to use for choosing
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*
|
48 |
+
* @throws InvalidArgumentException
|
49 |
+
*/
|
50 |
+
public function choose($message, $number, $locale)
|
51 |
+
{
|
52 |
+
$parts = array();
|
53 |
+
if (preg_match('/^\|++$/', $message)) {
|
54 |
+
$parts = explode('|', $message);
|
55 |
+
} elseif (preg_match_all('/(?:\|\||[^\|])++/', $message, $matches)) {
|
56 |
+
$parts = $matches[0];
|
57 |
+
}
|
58 |
+
|
59 |
+
$explicitRules = array();
|
60 |
+
$standardRules = array();
|
61 |
+
foreach ($parts as $part) {
|
62 |
+
$part = trim(str_replace('||', '|', $part));
|
63 |
+
|
64 |
+
if (preg_match('/^(?P<interval>'.Interval::getIntervalRegexp().')\s*(?P<message>.*?)$/xs', $part, $matches)) {
|
65 |
+
$explicitRules[$matches['interval']] = $matches['message'];
|
66 |
+
} elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) {
|
67 |
+
$standardRules[] = $matches[1];
|
68 |
+
} else {
|
69 |
+
$standardRules[] = $part;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
// try to match an explicit rule, then fallback to the standard ones
|
74 |
+
foreach ($explicitRules as $interval => $m) {
|
75 |
+
if (Interval::test($number, $interval)) {
|
76 |
+
return $m;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
$position = PluralizationRules::get($number, $locale);
|
81 |
+
|
82 |
+
if (!isset($standardRules[$position])) {
|
83 |
+
// when there's exactly one rule given, and that rule is a standard
|
84 |
+
// rule, use this rule
|
85 |
+
if (1 === count($parts) && isset($standardRules[0])) {
|
86 |
+
return $standardRules[0];
|
87 |
+
}
|
88 |
+
|
89 |
+
throw new InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale, $number));
|
90 |
+
}
|
91 |
+
|
92 |
+
return $standardRules[$position];
|
93 |
+
}
|
94 |
+
}
|
src/common/lib/vendor/symfony/translation/MetadataAwareInterface.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* MetadataAwareInterface.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
interface MetadataAwareInterface
|
20 |
+
{
|
21 |
+
/**
|
22 |
+
* Gets metadata for the given domain and key.
|
23 |
+
*
|
24 |
+
* Passing an empty domain will return an array with all metadata indexed by
|
25 |
+
* domain and then by key. Passing an empty key will return an array with all
|
26 |
+
* metadata for the given domain.
|
27 |
+
*
|
28 |
+
* @param string $key The key
|
29 |
+
* @param string $domain The domain name
|
30 |
+
*
|
31 |
+
* @return mixed The value that was set or an array with the domains/keys or null
|
32 |
+
*/
|
33 |
+
public function getMetadata($key = '', $domain = 'messages');
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Adds metadata to a message domain.
|
37 |
+
*
|
38 |
+
* @param string $key The key
|
39 |
+
* @param mixed $value The value
|
40 |
+
* @param string $domain The domain name
|
41 |
+
*/
|
42 |
+
public function setMetadata($key, $value, $domain = 'messages');
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Deletes metadata for the given key and domain.
|
46 |
+
*
|
47 |
+
* Passing an empty domain will delete all metadata. Passing an empty key will
|
48 |
+
* delete all metadata for the given domain.
|
49 |
+
*
|
50 |
+
* @param string $key The key
|
51 |
+
* @param string $domain The domain name
|
52 |
+
*/
|
53 |
+
public function deleteMetadata($key = '', $domain = 'messages');
|
54 |
+
}
|
src/common/lib/vendor/symfony/translation/PluralizationRules.php
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Returns the plural rules for a given locale.
|
16 |
+
*
|
17 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
+
*/
|
19 |
+
class PluralizationRules
|
20 |
+
{
|
21 |
+
private static $rules = array();
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Returns the plural position to use for the given locale and number.
|
25 |
+
*
|
26 |
+
* @param int $number The number
|
27 |
+
* @param string $locale The locale
|
28 |
+
*
|
29 |
+
* @return int The plural position
|
30 |
+
*/
|
31 |
+
public static function get($number, $locale)
|
32 |
+
{
|
33 |
+
if ('pt_BR' === $locale) {
|
34 |
+
// temporary set a locale for brazilian
|
35 |
+
$locale = 'xbr';
|
36 |
+
}
|
37 |
+
|
38 |
+
if (strlen($locale) > 3) {
|
39 |
+
$locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
|
40 |
+
}
|
41 |
+
|
42 |
+
if (isset(self::$rules[$locale])) {
|
43 |
+
$return = call_user_func(self::$rules[$locale], $number);
|
44 |
+
|
45 |
+
if (!is_int($return) || $return < 0) {
|
46 |
+
return 0;
|
47 |
+
}
|
48 |
+
|
49 |
+
return $return;
|
50 |
+
}
|
51 |
+
|
52 |
+
/*
|
53 |
+
* The plural rules are derived from code of the Zend Framework (2010-09-25),
|
54 |
+
* which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
|
55 |
+
* Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
56 |
+
*/
|
57 |
+
switch ($locale) {
|
58 |
+
case 'az':
|
59 |
+
case 'bo':
|
60 |
+
case 'dz':
|
61 |
+
case 'id':
|
62 |
+
case 'ja':
|
63 |
+
case 'jv':
|
64 |
+
case 'ka':
|
65 |
+
case 'km':
|
66 |
+
case 'kn':
|
67 |
+
case 'ko':
|
68 |
+
case 'ms':
|
69 |
+
case 'th':
|
70 |
+
case 'tr':
|
71 |
+
case 'vi':
|
72 |
+
case 'zh':
|
73 |
+
return 0;
|
74 |
+
|
75 |
+
case 'af':
|
76 |
+
case 'bn':
|
77 |
+
case 'bg':
|
78 |
+
case 'ca':
|
79 |
+
case 'da':
|
80 |
+
case 'de':
|
81 |
+
case 'el':
|
82 |
+
case 'en':
|
83 |
+
case 'eo':
|
84 |
+
case 'es':
|
85 |
+
case 'et':
|
86 |
+
case 'eu':
|
87 |
+
case 'fa':
|
88 |
+
case 'fi':
|
89 |
+
case 'fo':
|
90 |
+
case 'fur':
|
91 |
+
case 'fy':
|
92 |
+
case 'gl':
|
93 |
+
case 'gu':
|
94 |
+
case 'ha':
|
95 |
+
case 'he':
|
96 |
+
case 'hu':
|
97 |
+
case 'is':
|
98 |
+
case 'it':
|
99 |
+
case 'ku':
|
100 |
+
case 'lb':
|
101 |
+
case 'ml':
|
102 |
+
case 'mn':
|
103 |
+
case 'mr':
|
104 |
+
case 'nah':
|
105 |
+
case 'nb':
|
106 |
+
case 'ne':
|
107 |
+
case 'nl':
|
108 |
+
case 'nn':
|
109 |
+
case 'no':
|
110 |
+
case 'om':
|
111 |
+
case 'or':
|
112 |
+
case 'pa':
|
113 |
+
case 'pap':
|
114 |
+
case 'ps':
|
115 |
+
case 'pt':
|
116 |
+
case 'so':
|
117 |
+
case 'sq':
|
118 |
+
case 'sv':
|
119 |
+
case 'sw':
|
120 |
+
case 'ta':
|
121 |
+
case 'te':
|
122 |
+
case 'tk':
|
123 |
+
case 'ur':
|
124 |
+
case 'zu':
|
125 |
+
return (1 == $number) ? 0 : 1;
|
126 |
+
|
127 |
+
case 'am':
|
128 |
+
case 'bh':
|
129 |
+
case 'fil':
|
130 |
+
case 'fr':
|
131 |
+
case 'gun':
|
132 |
+
case 'hi':
|
133 |
+
case 'hy':
|
134 |
+
case 'ln':
|
135 |
+
case 'mg':
|
136 |
+
case 'nso':
|
137 |
+
case 'xbr':
|
138 |
+
case 'ti':
|
139 |
+
case 'wa':
|
140 |
+
return ((0 == $number) || (1 == $number)) ? 0 : 1;
|
141 |
+
|
142 |
+
case 'be':
|
143 |
+
case 'bs':
|
144 |
+
case 'hr':
|
145 |
+
case 'ru':
|
146 |
+
case 'sr':
|
147 |
+
case 'uk':
|
148 |
+
return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
149 |
+
|
150 |
+
case 'cs':
|
151 |
+
case 'sk':
|
152 |
+
return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2);
|
153 |
+
|
154 |
+
case 'ga':
|
155 |
+
return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2);
|
156 |
+
|
157 |
+
case 'lt':
|
158 |
+
return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
|
159 |
+
|
160 |
+
case 'sl':
|
161 |
+
return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3));
|
162 |
+
|
163 |
+
case 'mk':
|
164 |
+
return (1 == $number % 10) ? 0 : 1;
|
165 |
+
|
166 |
+
case 'mt':
|
167 |
+
return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3));
|
168 |
+
|
169 |
+
case 'lv':
|
170 |
+
return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2);
|
171 |
+
|
172 |
+
case 'pl':
|
173 |
+
return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2);
|
174 |
+
|
175 |
+
case 'cy':
|
176 |
+
return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3));
|
177 |
+
|
178 |
+
case 'ro':
|
179 |
+
return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2);
|
180 |
+
|
181 |
+
case 'ar':
|
182 |
+
return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5))));
|
183 |
+
|
184 |
+
default:
|
185 |
+
return 0;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Overrides the default plural rule for a given locale.
|
191 |
+
*
|
192 |
+
* @param callable $rule A PHP callable
|
193 |
+
* @param string $locale The locale
|
194 |
+
*/
|
195 |
+
public static function set(callable $rule, $locale)
|
196 |
+
{
|
197 |
+
if ('pt_BR' === $locale) {
|
198 |
+
// temporary set a locale for brazilian
|
199 |
+
$locale = 'xbr';
|
200 |
+
}
|
201 |
+
|
202 |
+
if (strlen($locale) > 3) {
|
203 |
+
$locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
|
204 |
+
}
|
205 |
+
|
206 |
+
self::$rules[$locale] = $rule;
|
207 |
+
}
|
208 |
+
}
|
src/common/lib/vendor/symfony/translation/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Translation Component
|
2 |
+
=====================
|
3 |
+
|
4 |
+
The Translation component provides tools to internationalize your application.
|
5 |
+
|
6 |
+
Resources
|
7 |
+
---------
|
8 |
+
|
9 |
+
* [Documentation](https://symfony.com/doc/current/components/translation/index.html)
|
10 |
+
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
11 |
+
* [Report issues](https://github.com/symfony/symfony/issues) and
|
12 |
+
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
13 |
+
in the [main Symfony repository](https://github.com/symfony/symfony)
|
src/common/lib/vendor/symfony/translation/Reader/TranslationReader.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Reader;
|
13 |
+
|
14 |
+
use Symfony\Component\Finder\Finder;
|
15 |
+
use Symfony\Component\Translation\Loader\LoaderInterface;
|
16 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* TranslationReader reads translation messages from translation files.
|
20 |
+
*
|
21 |
+
* @author Michel Salib <michelsalib@hotmail.com>
|
22 |
+
*/
|
23 |
+
class TranslationReader implements TranslationReaderInterface
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Loaders used for import.
|
27 |
+
*
|
28 |
+
* @var array
|
29 |
+
*/
|
30 |
+
private $loaders = array();
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Adds a loader to the translation extractor.
|
34 |
+
*
|
35 |
+
* @param string $format The format of the loader
|
36 |
+
* @param LoaderInterface $loader
|
37 |
+
*/
|
38 |
+
public function addLoader($format, LoaderInterface $loader)
|
39 |
+
{
|
40 |
+
$this->loaders[$format] = $loader;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* {@inheritdoc}
|
45 |
+
*/
|
46 |
+
public function read($directory, MessageCatalogue $catalogue)
|
47 |
+
{
|
48 |
+
if (!is_dir($directory)) {
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
foreach ($this->loaders as $format => $loader) {
|
53 |
+
// load any existing translation files
|
54 |
+
$finder = new Finder();
|
55 |
+
$extension = $catalogue->getLocale().'.'.$format;
|
56 |
+
$files = $finder->files()->name('*.'.$extension)->in($directory);
|
57 |
+
foreach ($files as $file) {
|
58 |
+
$domain = substr($file->getFilename(), 0, -1 * strlen($extension) - 1);
|
59 |
+
$catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain));
|
60 |
+
}
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
src/common/lib/vendor/symfony/translation/Reader/TranslationReaderInterface.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Symfony package.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier <fabien@symfony.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Symfony\Component\Translation\Reader;
|
13 |
+
|
14 |
+
use Symfony\Component\Translation\MessageCatalogue;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* TranslationReader reads translation messages from translation files.
|
18 |
+
*
|
19 |
+
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
20 |
+
*/
|
21 |
+
interface TranslationReaderInterface
|
22 |
+
{
|
23 |
+
/**
|
24 |
+
* Reads translation messages from a directory to the catalogue.
|
25 |
+
*
|
26 |
+
* @param string $directory
|
27 |
+
* @param MessageCatalogue $catalogue
|
28 |
+
*/
|
29 |
+
public function read($directory, MessageCatalogue $catalogue);
|
30 |
+
}
|
src/common/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
ADDED
@@ -0,0 +1,2223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<!--
|
4 |
+
|
5 |
+
May-19-2004:
|
6 |
+
- Changed the <choice> for ElemType_header, moving minOccurs="0" maxOccurs="unbounded" from its elements
|
7 |
+
to <choice> itself.
|
8 |
+
- Added <choice> for ElemType_trans-unit to allow "any order" for <context-group>, <count-group>, <prop-group>, <note>, and
|
9 |
+
<alt-trans>.
|
10 |
+
|
11 |
+
Oct-2005
|
12 |
+
- updated version info to 1.2
|
13 |
+
- equiv-trans attribute to <trans-unit> element
|
14 |
+
- merged-trans attribute for <group> element
|
15 |
+
- Add the <seg-source> element as optional in the <trans-unit> and <alt-trans> content models, at the same level as <source>
|
16 |
+
- Create a new value "seg" for the mtype attribute of the <mrk> element
|
17 |
+
- Add mid as an optional attribute for the <alt-trans> element
|
18 |
+
|
19 |
+
Nov-14-2005
|
20 |
+
- Changed name attribute for <context-group> from required to optional
|
21 |
+
- Added extension point at <xliff>
|
22 |
+
|
23 |
+
Jan-9-2006
|
24 |
+
- Added alttranstype type attribute to <alt-trans>, and values
|
25 |
+
|
26 |
+
Jan-10-2006
|
27 |
+
- Corrected error with overwritten purposeValueList
|
28 |
+
- Corrected name="AttrType_Version", attribute should have been "name"
|
29 |
+
|
30 |
+
-->
|
31 |
+
<xsd:schema xmlns:xlf="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:xliff:document:1.2" xml:lang="en">
|
32 |
+
<!-- Import for xml:lang and xml:space -->
|
33 |
+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
|
34 |
+
<!-- Attributes Lists -->
|
35 |
+
<xsd:simpleType name="XTend">
|
36 |
+
<xsd:restriction base="xsd:string">
|
37 |
+
<xsd:pattern value="x-[^\s]+"/>
|
38 |
+
</xsd:restriction>
|
39 |
+
</xsd:simpleType>
|
40 |
+
<xsd:simpleType name="context-typeValueList">
|
41 |
+
<xsd:annotation>
|
42 |
+
<xsd:documentation>Values for the attribute 'context-type'.</xsd:documentation>
|
43 |
+
</xsd:annotation>
|
44 |
+
<xsd:restriction base="xsd:string">
|
45 |
+
<xsd:enumeration value="database">
|
46 |
+
<xsd:annotation>
|
47 |
+
<xsd:documentation>Indicates a database content.</xsd:documentation>
|
48 |
+
</xsd:annotation>
|
49 |
+
</xsd:enumeration>
|
50 |
+
<xsd:enumeration value="element">
|
51 |
+
<xsd:annotation>
|
52 |
+
<xsd:documentation>Indicates the content of an element within an XML document.</xsd:documentation>
|
53 |
+
</xsd:annotation>
|
54 |
+
</xsd:enumeration>
|
55 |
+
<xsd:enumeration value="elementtitle">
|
56 |
+
<xsd:annotation>
|
57 |
+
<xsd:documentation>Indicates the name of an element within an XML document.</xsd:documentation>
|
58 |
+
</xsd:annotation>
|
59 |
+
</xsd:enumeration>
|
60 |
+
<xsd:enumeration value="linenumber">
|
61 |
+
<xsd:annotation>
|
62 |
+
<xsd:documentation>Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found.</xsd:documentation>
|
63 |
+
</xsd:annotation>
|
64 |
+
</xsd:enumeration>
|
65 |
+
<xsd:enumeration value="numparams">
|
66 |
+
<xsd:annotation>
|
67 |
+
<xsd:documentation>Indicates a the number of parameters contained within the <source>.</xsd:documentation>
|
68 |
+
</xsd:annotation>
|
69 |
+
</xsd:enumeration>
|
70 |
+
<xsd:enumeration value="paramnotes">
|
71 |
+
<xsd:annotation>
|
72 |
+
<xsd:documentation>Indicates notes pertaining to the parameters in the <source>.</xsd:documentation>
|
73 |
+
</xsd:annotation>
|
74 |
+
</xsd:enumeration>
|
75 |
+
<xsd:enumeration value="record">
|
76 |
+
<xsd:annotation>
|
77 |
+
<xsd:documentation>Indicates the content of a record within a database.</xsd:documentation>
|
78 |
+
</xsd:annotation>
|
79 |
+
</xsd:enumeration>
|
80 |
+
<xsd:enumeration value="recordtitle">
|
81 |
+
<xsd:annotation>
|
82 |
+
<xsd:documentation>Indicates the name of a record within a database.</xsd:documentation>
|
83 |
+
</xsd:annotation>
|
84 |
+
</xsd:enumeration>
|
85 |
+
<xsd:enumeration value="sourcefile">
|
86 |
+
<xsd:annotation>
|
87 |
+
<xsd:documentation>Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file.</xsd:documentation>
|
88 |
+
</xsd:annotation>
|
89 |
+
</xsd:enumeration>
|
90 |
+
</xsd:restriction>
|
91 |
+
</xsd:simpleType>
|
92 |
+
<xsd:simpleType name="count-typeValueList">
|
93 |
+
<xsd:annotation>
|
94 |
+
<xsd:documentation>Values for the attribute 'count-type'.</xsd:documentation>
|
95 |
+
</xsd:annotation>
|
96 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
97 |
+
<xsd:enumeration value="num-usages">
|
98 |
+
<xsd:annotation>
|
99 |
+
<xsd:documentation>Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts.</xsd:documentation>
|
100 |
+
</xsd:annotation>
|
101 |
+
</xsd:enumeration>
|
102 |
+
<xsd:enumeration value="repetition">
|
103 |
+
<xsd:annotation>
|
104 |
+
<xsd:documentation>Indicates the count units are translation units existing already in the same document.</xsd:documentation>
|
105 |
+
</xsd:annotation>
|
106 |
+
</xsd:enumeration>
|
107 |
+
<xsd:enumeration value="total">
|
108 |
+
<xsd:annotation>
|
109 |
+
<xsd:documentation>Indicates a total count.</xsd:documentation>
|
110 |
+
</xsd:annotation>
|
111 |
+
</xsd:enumeration>
|
112 |
+
</xsd:restriction>
|
113 |
+
</xsd:simpleType>
|
114 |
+
<xsd:simpleType name="InlineDelimitersValueList">
|
115 |
+
<xsd:annotation>
|
116 |
+
<xsd:documentation>Values for the attribute 'ctype' when used other elements than <ph> or <x>.</xsd:documentation>
|
117 |
+
</xsd:annotation>
|
118 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
119 |
+
<xsd:enumeration value="bold">
|
120 |
+
<xsd:annotation>
|
121 |
+
<xsd:documentation>Indicates a run of bolded text.</xsd:documentation>
|
122 |
+
</xsd:annotation>
|
123 |
+
</xsd:enumeration>
|
124 |
+
<xsd:enumeration value="italic">
|
125 |
+
<xsd:annotation>
|
126 |
+
<xsd:documentation>Indicates a run of text in italics.</xsd:documentation>
|
127 |
+
</xsd:annotation>
|
128 |
+
</xsd:enumeration>
|
129 |
+
<xsd:enumeration value="underlined">
|
130 |
+
<xsd:annotation>
|
131 |
+
<xsd:documentation>Indicates a run of underlined text.</xsd:documentation>
|
132 |
+
</xsd:annotation>
|
133 |
+
</xsd:enumeration>
|
134 |
+
<xsd:enumeration value="link">
|
135 |
+
<xsd:annotation>
|
136 |
+
<xsd:documentation>Indicates a run of hyper-text.</xsd:documentation>
|
137 |
+
</xsd:annotation>
|
138 |
+
</xsd:enumeration>
|
139 |
+
</xsd:restriction>
|
140 |
+
</xsd:simpleType>
|
141 |
+
<xsd:simpleType name="InlinePlaceholdersValueList">
|
142 |
+
<xsd:annotation>
|
143 |
+
<xsd:documentation>Values for the attribute 'ctype' when used with <ph> or <x>.</xsd:documentation>
|
144 |
+
</xsd:annotation>
|
145 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
146 |
+
<xsd:enumeration value="image">
|
147 |
+
<xsd:annotation>
|
148 |
+
<xsd:documentation>Indicates a inline image.</xsd:documentation>
|
149 |
+
</xsd:annotation>
|
150 |
+
</xsd:enumeration>
|
151 |
+
<xsd:enumeration value="pb">
|
152 |
+
<xsd:annotation>
|
153 |
+
<xsd:documentation>Indicates a page break.</xsd:documentation>
|
154 |
+
</xsd:annotation>
|
155 |
+
</xsd:enumeration>
|
156 |
+
<xsd:enumeration value="lb">
|
157 |
+
<xsd:annotation>
|
158 |
+
<xsd:documentation>Indicates a line break.</xsd:documentation>
|
159 |
+
</xsd:annotation>
|
160 |
+
</xsd:enumeration>
|
161 |
+
</xsd:restriction>
|
162 |
+
</xsd:simpleType>
|
163 |
+
<xsd:simpleType name="mime-typeValueList">
|
164 |
+
<xsd:restriction base="xsd:string">
|
165 |
+
<xsd:pattern value="(text|multipart|message|application|image|audio|video|model)(/.+)*"/>
|
166 |
+
</xsd:restriction>
|
167 |
+
</xsd:simpleType>
|
168 |
+
<xsd:simpleType name="datatypeValueList">
|
169 |
+
<xsd:annotation>
|
170 |
+
<xsd:documentation>Values for the attribute 'datatype'.</xsd:documentation>
|
171 |
+
</xsd:annotation>
|
172 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
173 |
+
<xsd:enumeration value="asp">
|
174 |
+
<xsd:annotation>
|
175 |
+
<xsd:documentation>Indicates Active Server Page data.</xsd:documentation>
|
176 |
+
</xsd:annotation>
|
177 |
+
</xsd:enumeration>
|
178 |
+
<xsd:enumeration value="c">
|
179 |
+
<xsd:annotation>
|
180 |
+
<xsd:documentation>Indicates C source file data.</xsd:documentation>
|
181 |
+
</xsd:annotation>
|
182 |
+
</xsd:enumeration>
|
183 |
+
<xsd:enumeration value="cdf">
|
184 |
+
<xsd:annotation>
|
185 |
+
<xsd:documentation>Indicates Channel Definition Format (CDF) data.</xsd:documentation>
|
186 |
+
</xsd:annotation>
|
187 |
+
</xsd:enumeration>
|
188 |
+
<xsd:enumeration value="cfm">
|
189 |
+
<xsd:annotation>
|
190 |
+
<xsd:documentation>Indicates ColdFusion data.</xsd:documentation>
|
191 |
+
</xsd:annotation>
|
192 |
+
</xsd:enumeration>
|
193 |
+
<xsd:enumeration value="cpp">
|
194 |
+
<xsd:annotation>
|
195 |
+
<xsd:documentation>Indicates C++ source file data.</xsd:documentation>
|
196 |
+
</xsd:annotation>
|
197 |
+
</xsd:enumeration>
|
198 |
+
<xsd:enumeration value="csharp">
|
199 |
+
<xsd:annotation>
|
200 |
+
<xsd:documentation>Indicates C-Sharp data.</xsd:documentation>
|
201 |
+
</xsd:annotation>
|
202 |
+
</xsd:enumeration>
|
203 |
+
<xsd:enumeration value="cstring">
|
204 |
+
<xsd:annotation>
|
205 |
+
<xsd:documentation>Indicates strings from C, ASM, and driver files data.</xsd:documentation>
|
206 |
+
</xsd:annotation>
|
207 |
+
</xsd:enumeration>
|
208 |
+
<xsd:enumeration value="csv">
|
209 |
+
<xsd:annotation>
|
210 |
+
<xsd:documentation>Indicates comma-separated values data.</xsd:documentation>
|
211 |
+
</xsd:annotation>
|
212 |
+
</xsd:enumeration>
|
213 |
+
<xsd:enumeration value="database">
|
214 |
+
<xsd:annotation>
|
215 |
+
<xsd:documentation>Indicates database data.</xsd:documentation>
|
216 |
+
</xsd:annotation>
|
217 |
+
</xsd:enumeration>
|
218 |
+
<xsd:enumeration value="documentfooter">
|
219 |
+
<xsd:annotation>
|
220 |
+
<xsd:documentation>Indicates portions of document that follows data and contains metadata.</xsd:documentation>
|
221 |
+
</xsd:annotation>
|
222 |
+
</xsd:enumeration>
|
223 |
+
<xsd:enumeration value="documentheader">
|
224 |
+
<xsd:annotation>
|
225 |
+
<xsd:documentation>Indicates portions of document that precedes data and contains metadata.</xsd:documentation>
|
226 |
+
</xsd:annotation>
|
227 |
+
</xsd:enumeration>
|
228 |
+
<xsd:enumeration value="filedialog">
|
229 |
+
<xsd:annotation>
|
230 |
+
<xsd:documentation>Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import).</xsd:documentation>
|
231 |
+
</xsd:annotation>
|
232 |
+
</xsd:enumeration>
|
233 |
+
<xsd:enumeration value="form">
|
234 |
+
<xsd:annotation>
|
235 |
+
<xsd:documentation>Indicates standard user input screen data.</xsd:documentation>
|
236 |
+
</xsd:annotation>
|
237 |
+
</xsd:enumeration>
|
238 |
+
<xsd:enumeration value="html">
|
239 |
+
<xsd:annotation>
|
240 |
+
<xsd:documentation>Indicates HyperText Markup Language (HTML) data - document instance.</xsd:documentation>
|
241 |
+
</xsd:annotation>
|
242 |
+
</xsd:enumeration>
|
243 |
+
<xsd:enumeration value="htmlbody">
|
244 |
+
<xsd:annotation>
|
245 |
+
<xsd:documentation>Indicates content within an HTML document’s <body> element.</xsd:documentation>
|
246 |
+
</xsd:annotation>
|
247 |
+
</xsd:enumeration>
|
248 |
+
<xsd:enumeration value="ini">
|
249 |
+
<xsd:annotation>
|
250 |
+
<xsd:documentation>Indicates Windows INI file data.</xsd:documentation>
|
251 |
+
</xsd:annotation>
|
252 |
+
</xsd:enumeration>
|
253 |
+
<xsd:enumeration value="interleaf">
|
254 |
+
<xsd:annotation>
|
255 |
+
<xsd:documentation>Indicates Interleaf data.</xsd:documentation>
|
256 |
+
</xsd:annotation>
|
257 |
+
</xsd:enumeration>
|
258 |
+
<xsd:enumeration value="javaclass">
|
259 |
+
<xsd:annotation>
|
260 |
+
<xsd:documentation>Indicates Java source file data (extension '.java').</xsd:documentation>
|
261 |
+
</xsd:annotation>
|
262 |
+
</xsd:enumeration>
|
263 |
+
<xsd:enumeration value="javapropertyresourcebundle">
|
264 |
+
<xsd:annotation>
|
265 |
+
<xsd:documentation>Indicates Java property resource bundle data.</xsd:documentation>
|
266 |
+
</xsd:annotation>
|
267 |
+
</xsd:enumeration>
|
268 |
+
<xsd:enumeration value="javalistresourcebundle">
|
269 |
+
<xsd:annotation>
|
270 |
+
<xsd:documentation>Indicates Java list resource bundle data.</xsd:documentation>
|
271 |
+
</xsd:annotation>
|
272 |
+
</xsd:enumeration>
|
273 |
+
<xsd:enumeration value="javascript">
|
274 |
+
<xsd:annotation>
|
275 |
+
<xsd:documentation>Indicates JavaScript source file data.</xsd:documentation>
|
276 |
+
</xsd:annotation>
|
277 |
+
</xsd:enumeration>
|
278 |
+
<xsd:enumeration value="jscript">
|
279 |
+
<xsd:annotation>
|
280 |
+
<xsd:documentation>Indicates JScript source file data.</xsd:documentation>
|
281 |
+
</xsd:annotation>
|
282 |
+
</xsd:enumeration>
|
283 |
+
<xsd:enumeration value="layout">
|
284 |
+
<xsd:annotation>
|
285 |
+
<xsd:documentation>Indicates information relating to formatting.</xsd:documentation>
|
286 |
+
</xsd:annotation>
|
287 |
+
</xsd:enumeration>
|
288 |
+
<xsd:enumeration value="lisp">
|
289 |
+
<xsd:annotation>
|
290 |
+
<xsd:documentation>Indicates LISP source file data.</xsd:documentation>
|
291 |
+
</xsd:annotation>
|
292 |
+
</xsd:enumeration>
|
293 |
+
<xsd:enumeration value="margin">
|
294 |
+
<xsd:annotation>
|
295 |
+
<xsd:documentation>Indicates information relating to margin formats.</xsd:documentation>
|
296 |
+
</xsd:annotation>
|
297 |
+
</xsd:enumeration>
|
298 |
+
<xsd:enumeration value="menufile">
|
299 |
+
<xsd:annotation>
|
300 |
+
<xsd:documentation>Indicates a file containing menu.</xsd:documentation>
|
301 |
+
</xsd:annotation>
|
302 |
+
</xsd:enumeration>
|
303 |
+
<xsd:enumeration value="messagefile">
|
304 |
+
<xsd:annotation>
|
305 |
+
<xsd:documentation>Indicates numerically identified string table.</xsd:documentation>
|
306 |
+
</xsd:annotation>
|
307 |
+
</xsd:enumeration>
|
308 |
+
<xsd:enumeration value="mif">
|
309 |
+
<xsd:annotation>
|
310 |
+
<xsd:documentation>Indicates Maker Interchange Format (MIF) data.</xsd:documentation>
|
311 |
+
</xsd:annotation>
|
312 |
+
</xsd:enumeration>
|
313 |
+
<xsd:enumeration value="mimetype">
|
314 |
+
<xsd:annotation>
|
315 |
+
<xsd:documentation>Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute.</xsd:documentation>
|
316 |
+
</xsd:annotation>
|
317 |
+
</xsd:enumeration>
|
318 |
+
<xsd:enumeration value="mo">
|
319 |
+
<xsd:annotation>
|
320 |
+
<xsd:documentation>Indicates GNU Machine Object data.</xsd:documentation>
|
321 |
+
</xsd:annotation>
|
322 |
+
</xsd:enumeration>
|
323 |
+
<xsd:enumeration value="msglib">
|
324 |
+
<xsd:annotation>
|
325 |
+
<xsd:documentation>Indicates Message Librarian strings created by Novell's Message Librarian Tool.</xsd:documentation>
|
326 |
+
</xsd:annotation>
|
327 |
+
</xsd:enumeration>
|
328 |
+
<xsd:enumeration value="pagefooter">
|
329 |
+
<xsd:annotation>
|
330 |
+
<xsd:documentation>Indicates information to be displayed at the bottom of each page of a document.</xsd:documentation>
|
331 |
+
</xsd:annotation>
|
332 |
+
</xsd:enumeration>
|
333 |
+
<xsd:enumeration value="pageheader">
|
334 |
+
<xsd:annotation>
|
335 |
+
<xsd:documentation>Indicates information to be displayed at the top of each page of a document.</xsd:documentation>
|
336 |
+
</xsd:annotation>
|
337 |
+
</xsd:enumeration>
|
338 |
+
<xsd:enumeration value="parameters">
|
339 |
+
<xsd:annotation>
|
340 |
+
<xsd:documentation>Indicates a list of property values (e.g., settings within INI files or preferences dialog).</xsd:documentation>
|
341 |
+
</xsd:annotation>
|
342 |
+
</xsd:enumeration>
|
343 |
+
<xsd:enumeration value="pascal">
|
344 |
+
<xsd:annotation>
|
345 |
+
<xsd:documentation>Indicates Pascal source file data.</xsd:documentation>
|
346 |
+
</xsd:annotation>
|
347 |
+
</xsd:enumeration>
|
348 |
+
<xsd:enumeration value="php">
|
349 |
+
<xsd:annotation>
|
350 |
+
<xsd:documentation>Indicates Hypertext Preprocessor data.</xsd:documentation>
|
351 |
+
</xsd:annotation>
|
352 |
+
</xsd:enumeration>
|
353 |
+
<xsd:enumeration value="plaintext">
|
354 |
+
<xsd:annotation>
|
355 |
+
<xsd:documentation>Indicates plain text file (no formatting other than, possibly, wrapping).</xsd:documentation>
|
356 |
+
</xsd:annotation>
|
357 |
+
</xsd:enumeration>
|
358 |
+
<xsd:enumeration value="po">
|
359 |
+
<xsd:annotation>
|
360 |
+
<xsd:documentation>Indicates GNU Portable Object file.</xsd:documentation>
|
361 |
+
</xsd:annotation>
|
362 |
+
</xsd:enumeration>
|
363 |
+
<xsd:enumeration value="report">
|
364 |
+
<xsd:annotation>
|
365 |
+
<xsd:documentation>Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc.</xsd:documentation>
|
366 |
+
</xsd:annotation>
|
367 |
+
</xsd:enumeration>
|
368 |
+
<xsd:enumeration value="resources">
|
369 |
+
<xsd:annotation>
|
370 |
+
<xsd:documentation>Indicates Windows .NET binary resources.</xsd:documentation>
|
371 |
+
</xsd:annotation>
|
372 |
+
</xsd:enumeration>
|
373 |
+
<xsd:enumeration value="resx">
|
374 |
+
<xsd:annotation>
|
375 |
+
<xsd:documentation>Indicates Windows .NET Resources.</xsd:documentation>
|
376 |
+
</xsd:annotation>
|
377 |
+
</xsd:enumeration>
|
378 |
+
<xsd:enumeration value="rtf">
|
379 |
+
<xsd:annotation>
|
380 |
+
<xsd:documentation>Indicates Rich Text Format (RTF) data.</xsd:documentation>
|
381 |
+
</xsd:annotation>
|
382 |
+
</xsd:enumeration>
|
383 |
+
<xsd:enumeration value="sgml">
|
384 |
+
<xsd:annotation>
|
385 |
+
<xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - document instance.</xsd:documentation>
|
386 |
+
</xsd:annotation>
|
387 |
+
</xsd:enumeration>
|
388 |
+
<xsd:enumeration value="sgmldtd">
|
389 |
+
<xsd:annotation>
|
390 |
+
<xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD).</xsd:documentation>
|
391 |
+
</xsd:annotation>
|
392 |
+
</xsd:enumeration>
|
393 |
+
<xsd:enumeration value="svg">
|
394 |
+
<xsd:annotation>
|
395 |
+
<xsd:documentation>Indicates Scalable Vector Graphic (SVG) data.</xsd:documentation>
|
396 |
+
</xsd:annotation>
|
397 |
+
</xsd:enumeration>
|
398 |
+
<xsd:enumeration value="vbscript">
|
399 |
+
<xsd:annotation>
|
400 |
+
<xsd:documentation>Indicates VisualBasic Script source file.</xsd:documentation>
|
401 |
+
</xsd:annotation>
|
402 |
+
</xsd:enumeration>
|
403 |
+
<xsd:enumeration value="warning">
|
404 |
+
<xsd:annotation>
|
405 |
+
<xsd:documentation>Indicates warning message.</xsd:documentation>
|
406 |
+
</xsd:annotation>
|
407 |
+
</xsd:enumeration>
|
408 |
+
<xsd:enumeration value="winres">
|
409 |
+
<xsd:annotation>
|
410 |
+
<xsd:documentation>Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file).</xsd:documentation>
|
411 |
+
</xsd:annotation>
|
412 |
+
</xsd:enumeration>
|
413 |
+
<xsd:enumeration value="xhtml">
|
414 |
+
<xsd:annotation>
|
415 |
+
<xsd:documentation>Indicates Extensible HyperText Markup Language (XHTML) data - document instance.</xsd:documentation>
|
416 |
+
</xsd:annotation>
|
417 |
+
</xsd:enumeration>
|
418 |
+
<xsd:enumeration value="xml">
|
419 |
+
<xsd:annotation>
|
420 |
+
<xsd:documentation>Indicates Extensible Markup Language (XML) data - document instance.</xsd:documentation>
|
421 |
+
</xsd:annotation>
|
422 |
+
</xsd:enumeration>
|
423 |
+
<xsd:enumeration value="xmldtd">
|
424 |
+
<xsd:annotation>
|
425 |
+
<xsd:documentation>Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD).</xsd:documentation>
|
426 |
+
</xsd:annotation>
|
427 |
+
</xsd:enumeration>
|
428 |
+
<xsd:enumeration value="xsl">
|
429 |
+
<xsd:annotation>
|
430 |
+
<xsd:documentation>Indicates Extensible Stylesheet Language (XSL) data.</xsd:documentation>
|
431 |
+
</xsd:annotation>
|
432 |
+
</xsd:enumeration>
|
433 |
+
<xsd:enumeration value="xul">
|
434 |
+
<xsd:annotation>
|
435 |
+
<xsd:documentation>Indicates XUL elements.</xsd:documentation>
|
436 |
+
</xsd:annotation>
|
437 |
+
</xsd:enumeration>
|
438 |
+
</xsd:restriction>
|
439 |
+
</xsd:simpleType>
|
440 |
+
<xsd:simpleType name="mtypeValueList">
|
441 |
+
<xsd:annotation>
|
442 |
+
<xsd:documentation>Values for the attribute 'mtype'.</xsd:documentation>
|
443 |
+
</xsd:annotation>
|
444 |
+
<xsd:restriction base="xsd:NMTOKEN">
|
445 |
+
<xsd:enumeration value="abbrev">
|
446 |
+
<xsd:annotation>
|
447 |
+
<xsd:documentation>Indicates the marked text is an abbreviation.</xsd:documentation>
|
448 |
+
</xsd:annotation>
|
449 |
+
</xsd:enumeration>
|
450 |
+
<xsd:enumeration value="abbreviated-form">
|
451 |
+
<xsd:annotation>
|
452 |
+
<xsd:documentation>ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept.</xsd:documentation>
|
453 |
+
</xsd:annotation>
|
454 |
+
</xsd:enumeration>
|
455 |
+
<xsd:enumeration value="abbreviation">
|
456 |
+
<xsd:annotation>
|
457 |
+
<xsd:documentation>ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective').</xsd:documentation>
|
458 |
+
</xsd:annotation>
|
459 |
+
</xsd:enumeration>
|
460 |
+
<xsd:enumeration value="acronym">
|
461 |
+
<xsd:annotation>
|
462 |
+
<xsd:documentation>ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging').</xsd:documentation>
|
463 |
+
</xsd:annotation>
|
464 |
+
</xsd:enumeration>
|
465 |
+
<xsd:enumeration value="appellation">
|
466 |
+
<xsd:annotation>
|
467 |
+
<xsd:documentation>ISO-12620: A proper-name term, such as the name of an agency or other proper entity.</xsd:documentation>
|
468 |
+
</xsd:annotation>
|
469 |
+
</xsd:enumeration>
|
470 |
+
<xsd:enumeration value="collocation">
|
471 |
+
<xsd:annotation>
|
472 |
+
<xsd:documentation>ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another.</xsd:documentation>
|
473 |
+
</xsd:annotation>
|
474 |
+
</xsd:enumeration>
|
475 |
+
<xsd:enumeration value="common-name">
|
476 |
+
<xsd:annotation>
|
477 |
+
<xsd:documentation>ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language.</xsd:documentation>
|
478 |
+
</xsd:annotation>
|
479 |
+
</xsd:enumeration>
|
480 |
+
<xsd:enumeration value="datetime">
|
481 |
+
<xsd:annotation>
|
482 |
+
<xsd:documentation>Indicates the marked text is
|