This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bushbaby/develop
Develop
- Loading branch information
Showing
40 changed files
with
745 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
composer.lock | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tools: | ||
external_code_coverage: true | ||
checks: | ||
php: | ||
code_rating: true | ||
duplication: true | ||
filter: | ||
excluded_paths: [test/*] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --dev --prefer-source | ||
- mkdir -p test/build | ||
|
||
script: | ||
- vendor/bin/phpunit -c ./phpunit.xml | ||
- vendor/bin/phpcs --standard=PSR2 ./src/ | ||
|
||
after_script: | ||
- wget https://scrutinizer-ci.com/ocular.phar | ||
- php ocular.phar code-coverage:upload --format=php-clover test/build/logs/clover.xml | ||
|
||
notifications: | ||
irc: "irc.freenode.org#zftalk.modules" | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
v1.1.0 | ||
|
||
- ability to configure orm connection | ||
- configuring of MvcTranslator now done via delegator service | ||
- general refactoring and cleanup | ||
- better unittest | ||
- travis integration | ||
- scrutinzr integration | ||
|
||
v1.0.0 | ||
|
||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2014 Bas Kamer | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...octrine_translation_loader.local.php.dist → ...ctrine_translation_loader.global.php.dist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
<?php | ||
|
||
return array( | ||
'doctrine' => array( | ||
'bsb_doctrine_translation_loader' => array( | ||
'entity_manager' => 'orm_default', | ||
/** | ||
* The $config['doctrine'] configuration will be manipulated with these 'template' options | ||
* and will be removed from $config['bsb_doctrine_translator'] | ||
*/ | ||
'doctrine' => array( | ||
'configuration' => array( | ||
\BsbDoctrineTranslationLoader\Util\ConfigManipulate::EM_REPLACE_TOKEN => array( | ||
'entity_namespaces' => array( | ||
'BsbDoctrineTranslationLoader' => 'BsbDoctrineTranslationLoader\Entity', | ||
), | ||
), | ||
), | ||
'driver' => array( | ||
\BsbDoctrineTranslationLoader\Util\ConfigManipulate::EM_REPLACE_TOKEN => array( | ||
'drivers' => array( | ||
'BsbDoctrineTranslationLoader\Entity' => 'bsbdoctrinetranslationloader_entity', | ||
), | ||
), | ||
), | ||
), | ||
), | ||
'doctrine' => array( | ||
'driver' => array( | ||
'bsbdoctrinetranslationloader_annotation_driver' => array( | ||
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', | ||
'cache' => 'array', | ||
'paths' => array(__DIR__ . '/../src') | ||
'bsbdoctrinetranslationloader_entity' => array( | ||
'class' => 'Doctrine\ORM\Mapping\Driver\XmlDriver', | ||
'paths' => __DIR__ . '/xml/bsbdoctrinetranslationloader', | ||
), | ||
'orm_default' => array( | ||
'drivers' => array( | ||
'BsbDoctrineTranslationLoader\Entity' => 'bsbdoctrinetranslationloader_annotation_driver' | ||
) | ||
) | ||
), | ||
), | ||
'service_manager' => array( | ||
'invokables' => array( | ||
'BsbDoctrineTranslationMvcTranslatorDelegator' => 'BsbDoctrineTranslationLoader\Service\MvcTranslatorDelegatorFactory', | ||
), | ||
'delegators' => array( | ||
'MvcTranslator' => array('BsbDoctrineTranslationMvcTranslatorDelegator'), | ||
), | ||
), | ||
); |
18 changes: 18 additions & 0 deletions
18
config/xml/bsbdoctrinetranslationloader/BsbDoctrineTranslationLoader.Entity.Locale.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | ||
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | ||
|
||
<entity name="BsbDoctrineTranslationLoader\Entity\Locale" table="translation_locale"> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="locale" type="string" length="5" nullable="false"/> | ||
<field name="plural_forms" type="string" nullable="false"/> | ||
|
||
</entity> | ||
|
||
</doctrine-mapping> |
24 changes: 24 additions & 0 deletions
24
config/xml/bsbdoctrinetranslationloader/BsbDoctrineTranslationLoader.Entity.Message.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | ||
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | ||
|
||
<entity name="BsbDoctrineTranslationLoader\Entity\Message" table="translation_message"> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
|
||
<field name="domain" type="string" length="255" nullable="false"/> | ||
<field name="message" type="text" nullable="false"/> | ||
<field name="translation" type="text" nullable="true"/> | ||
<field name="plural_index" type="smallint" nullable="true"/> | ||
|
||
<many-to-one field="locale" target-entity="BsbDoctrineTranslationLoader\Entity\Locale" inversed-by="messages"> | ||
<join-column name="locale_id" referenced-column-name="id" on-delete="CASCADE" /> | ||
</many-to-one> | ||
</entity> | ||
|
||
</doctrine-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
|
||
CREATE TABLE IF NOT EXISTS `translation_locale` ( | ||
`id` int(11) NOT NULL, | ||
`locale` varchar(5) NOT NULL, | ||
`plural_forms` varchar(255) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
CREATE TABLE IF NOT EXISTS `translation_message` ( | ||
`id` int(11) NOT NULL, | ||
`locale_id` int(11) DEFAULT NULL, | ||
`domain` varchar(255) binary NOT NULL, | ||
`message` longtext NOT NULL, | ||
`translation` longtext, | ||
`plural_index` smallint(6) DEFAULT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
|
||
ALTER TABLE `translation_locale` | ||
ADD PRIMARY KEY (`id`); | ||
|
||
ALTER TABLE `translation_message` | ||
ADD PRIMARY KEY (`id`), ADD KEY `IDX_17B1C98DE559DFD1` (`locale_id`); | ||
|
||
|
||
ALTER TABLE `translation_locale` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; | ||
ALTER TABLE `translation_message` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=34045; | ||
|
||
ALTER TABLE `translation_message` | ||
ADD CONSTRAINT `FK_17B1C98DE559DFD1` FOREIGN KEY (`locale_id`) REFERENCES `translation_locale` (`id`) ON DELETE CASCADE; | ||
|
||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
Oops, something went wrong.