Compare commits

...

7 Commits

Author SHA1 Message Date
Maxime Thévenot 1e88a486aa Feat : Update translation 2017-07-24 09:10:21 +02:00
Maxime Thévenot bdc6df6fcd Feat : Start to replace some wording with placeholder
#4987 @1h
2017-07-07 17:11:18 +02:00
Maxime Thévenot 81ed7bdd53 Feat : Create new translations files
#4987 @0h30
2017-07-07 15:05:22 +02:00
Maxime Thévenot 9160e764ed Feat : Config and web UI for I18N bundle
#4988 @1h
#4987 @2h
2017-07-07 14:35:10 +02:00
Maxime Thévenot 794c8003e4 Feat : add fr and en language
- url/test          -> FR
- url/en/test     -> EN

#4988 @2h
2017-07-06 16:47:29 +02:00
Maxime Thévenot 6fd1e1d775 Feat : JMS translation config #4988 @0h20 2017-07-06 10:23:50 +02:00
Maxime Thévenot dd839dd523 Feat : Install and configure JMS I18N and Translation bundle #4988 @1h30 2017-07-05 15:49:42 +02:00
1059 changed files with 83756 additions and 97 deletions
+6
View File
@@ -41,6 +41,12 @@ class AppKernel extends Kernel
new Edeclic\PrestashopBridgeBundle\EdeclicPrestashopBridgeBundle(),
new Edeclic\HistoryBundle\EdeclicHistoryBundle(),
new AppBundle\AppBundle(),
//I18N
new JMS\I18nRoutingBundle\JMSI18nRoutingBundle(),
new JMS\TranslationBundle\JMSTranslationBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\AopBundle\JMSAopBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
+353
View File
@@ -0,0 +1,353 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<!-- GENERAL -->
<trans-unit id="global.save.label">
<source>global.save.label</source>
<target>Save</target>
</trans-unit>
<trans-unit id="global.edit.label">
<source>global.edit.label</source>
<target>Update</target>
</trans-unit>
<trans-unit id="global.video.company.default.label">
<source>global.video.defaultaction.label</source>
<target>Choose this video as presentation video</target>
</trans-unit>
<trans-unit id="global.video.talent.default.label">
<source>global.video.defaultaction.label</source>
<target>Choose this video as presentation video</target>
</trans-unit>
<trans-unit id="global.intitule.label">
<source>global.intitule.label</source>
<target>Label</target>
</trans-unit>
<trans-unit id="global.date.label">
<source>global.date.label</source>
<target>Date</target>
</trans-unit>
<!-- STATUS -->
<trans-unit id="DRAFT">
<source>DRAFT</source>
<target>Draft</target>
</trans-unit>
<trans-unit id="TO_PUBLISH">
<source>TO_PUBLISH</source>
<target>En cours de validation</target>
</trans-unit>
<trans-unit id="VALIDATED">
<source>VALIDATED</source>
<target>Validated</target>
</trans-unit>
<trans-unit id="PUBLISHED">
<source>PUBLISHED</source>
<target>Published</target>
</trans-unit>
<trans-unit id="CLOSED">
<source>CLOSED</source>
<target>Closed</target>
</trans-unit>
<trans-unit id="EXPIRED">
<source>EXPIRED</source>
<target>Expired</target>
</trans-unit>
<trans-unit id="SENDED">
<source>SENDED</source>
<target>Sended</target>
</trans-unit>
<trans-unit id="DECLINED">
<source>DECLINED</source>
<target>Declined</target>
</trans-unit>
<!-- MENU COMPANY-->
<trans-unit id="company.menu.dashboard.label">
<source>company.menu.dashboard.label</source>
<target>Dashboard</target>
</trans-unit>
<trans-unit id="company.menu.profile.label">
<source>company.menu.profile.label</source>
<target>Company profile</target>
</trans-unit>
<trans-unit id="company.menu.ads.label">
<source>company.menu.ads.label</source>
<target>My ads</target>
</trans-unit>
<trans-unit id="company.menu.bookmark.label">
<source>company.menu.bookmark.label</source>
<target>My bookmarks</target>
</trans-unit>
<trans-unit id="company.menu.answers.label">
<source>company.menu.answers.label</source>
<target>Answers</target>
</trans-unit>
<trans-unit id="company.menu.videotheque.label">
<source>company.menu.videotheque.label</source>
<target>Video</target>
</trans-unit>
<trans-unit id="company.menu.search.label">
<source>company.menu.search.label</source>
<target>My searches</target>
</trans-unit>
<trans-unit id="company.menu.advice.label">
<source>company.menu.advice.label</source>
<target>Advices</target>
</trans-unit>
<trans-unit id="company.menu.faq.label">
<source>company.menu.faq.label</source>
<target>FAQ</target>
</trans-unit>
<trans-unit id="company.menu.account.label">
<source>company.menu.account.label</source>
<target>My account</target>
</trans-unit>
<trans-unit id="company.menu.account.contact">
<source>company.menu.account.contact</source>
<target>Contact Talents Tube</target>
</trans-unit>
<!-- PROFIL COMPANY-->
<trans-unit id="company.account.save.title">
<source>company.account.save.title</source>
<target>Your account has been updated</target>
</trans-unit>
<trans-unit id="company.profile.save.title">
<source>company.profile.save.title</source>
<target>Your profile has been saved</target>
</trans-unit>
<trans-unit id="company.account.password.modify.label">
<source>company.account.password.modify.label</source>
<target>Change my password</target>
</trans-unit>
<trans-unit id="profile.edit.submit">
<source>profile.edit.submit</source>
<target>Save my profile</target>
</trans-unit>
<trans-unit id="profile.company.title">
<source>profile.company.title</source>
<target>Company profile</target>
</trans-unit>
<trans-unit id="profile.company.brandname">
<source>profile.company.brandname</source>
<target>Brand name</target>
</trans-unit>
<trans-unit id="profile.company.businessname">
<source>profile.company.businessname</source>
<target>Business name</target>
</trans-unit>
<trans-unit id="profile.company.siren">
<source>profile.company.siren</source>
<target>Siren</target>
</trans-unit>
<trans-unit id="profile.company.size">
<source>profile.company.size</source>
<target>Company size (number of people)</target>
</trans-unit>
<trans-unit id="profile.company.description">
<source>profile.company.description</source>
<target>Description</target>
</trans-unit>
<trans-unit id="profile.company.website">
<source>profile.company.website</source>
<target>Website</target>
</trans-unit>
<trans-unit id="profile.company.address1">
<source>profile.company.address1</source>
<target>Address</target>
</trans-unit>
<trans-unit id="profile.company.address2">
<source>profile.company.address2</source>
<target>Address</target>
</trans-unit>
<trans-unit id="profile.company.postcode">
<source>profile.company.postcode</source>
<target>Zip Code</target>
</trans-unit>
<trans-unit id="profile.company.city">
<source>profile.company.city</source>
<target>City</target>
</trans-unit>
<trans-unit id="profile.company.country">
<source>profile.company.country</source>
<target>Country</target>
</trans-unit>
<trans-unit id="profile.company.tags">
<source>profile.company.tags</source>
<target>Tags : use commas to separate your keywords</target>
</trans-unit>
<trans-unit id="profile.company.logo">
<source>profile.company.logo</source>
<target>Company logo</target>
</trans-unit>
<!-- ANNONCE-->
<trans-unit id="ad.company.add.label">
<source>ad.company.add.label</source>
<target>Add an Ad</target>
</trans-unit>
<trans-unit id="ad.company.video.edit.label">
<source>ad.company.video.edit.label</source>
<target>Edit video</target>
</trans-unit>
<trans-unit id="ad.company.edit.label">
<source>ad.company.edit.label</source>
<target>Edit</target>
</trans-unit>
<trans-unit id="ad.company.dates.extension.label">
<source>ad.company.dates.extension.label</source>
<target>Extend ad</target>
</trans-unit>
<trans-unit id="ad.company.dates.edit.label">
<source>ad.company.dates.edit.label</source>
<target>Edit dates</target>
</trans-unit>
<trans-unit id="ad.company.closed.label">
<source>ad.company.closed.label</source>
<target>Close ad</target>
</trans-unit>
<trans-unit id="ad.company.list.title">
<source>ad.company.list.title</source>
<target>Ad title</target>
</trans-unit>
<trans-unit id="ad.company.list.answers">
<source>ad.company.list.answers</source>
<target>Number of answers</target>
</trans-unit>
<trans-unit id="ad.company.list.actions">
<source>ad.company.list.actions</source>
<target>Actions</target>
</trans-unit>
<trans-unit id="ad.company.list.status">
<source>ad.company.list.status</source>
<target>Status</target>
</trans-unit>
<trans-unit id="ad.save.extension.title">
<source>ad.save.extension.title</source>
<target>Add extension has been saved</target>
</trans-unit>
<!-- MEDIA -->
<trans-unit id="media.delete.video.label">
<source>media.delete.video.label</source>
<target>Delete vidéo</target>
</trans-unit>
<!-- PROFILE TALENT -->
<trans-unit id="profile.talent.title">
<source>profile.talent.title</source>
<target>My profile</target>
</trans-unit>
<trans-unit id="profile.talent.firstname">
<source>profile.talent.firstname</source>
<target>Firstname</target>
</trans-unit>
<trans-unit id="profile.talent.lastname">
<source>profile.talent.lastname</source>
<target>Name</target>
</trans-unit>
<trans-unit id="profile.talent.account.title">
<source>profile.talent.account.title</source>
<target>Account informations</target>
</trans-unit>
<!-- TALENT -->
<trans-unit id="ad.talent.answer.label">
<source>ad.talent.answer.label</source>
<target>Answer the ad</target>
</trans-unit>
<trans-unit id="ad.talent.isAnswer.label">
<source>ad.talent.isAnswer.label</source>
<target>You already answered this ad</target>
</trans-unit>
<trans-unit id="ad.answer.mail.send">
<source>ad.answer.mail.send</source>
<target>Your answer has been sended</target>
</trans-unit>
<trans-unit id="answer.talent.create.title.label">
<source>answer.talent.create.title.label</source>
<target>Answer the as</target>
</trans-unit>
<trans-unit id="talent.mail.contact.send">
<source>talent.mail.contact.send</source>
<target>Your mail has been sended!</target>
</trans-unit>
<!-- NOTES-->
<trans-unit id="note.title">
<source>note.title</source>
<target>Notes</target>
</trans-unit>
<!-- USER -->
<trans-unit id="user.civility.man">
<source>user.civility.man</source>
<target>Mr.</target>
</trans-unit>
<trans-unit id="user.civility.woman">
<source>user.civility.woman</source>
<target>Mrs.</target>
</trans-unit>
<trans-unit id="user.cgu.label">
<source>user.cgu.label</source>
<target>I acknowledge that I have read and understood the conditions of use and declare that I accept
these conditions.
</target>
</trans-unit>
<trans-unit id="user.register.title">
<source>user.register.title</source>
<target>Register to www.talentstube.com</target>
</trans-unit>
<trans-unit id="user.resetpassword.title">
<source>user.resetpassword.title</source>
<target>Reset password</target>
</trans-unit>
<!-- EMAIL -->
<trans-unit id="registration.email.message.talent.html">
<source>registration.email.message.talent.html</source>
<target><![CDATA[Bonjour %firstname% %lastname%,<br /><br />
<p>Vous avez créé votre compte sur TalentsTube, Félicitations !</p>
<p>Pour valider votre compte utilisateur, merci de vous rendre sur %confirmationUrl%
<br />Ce lien ne peut être utilisé qu'une seule fois pour valider votre compte.</p>
<p>Vous pouvez accéder à votre Tableau de Bord et commencer à montrer vos talents aux entreprises de talents.</p>
<p>Soyez vous-même !</p>
L'équipe de TalentsTube]]>
</target>
</trans-unit>
<trans-unit id="registration.email.message.company.html">
<source>registration.email.message.company.html</source>
<target><![CDATA[Bonjour %firstname% %lastname%,<br /><br />
<p>Vous avez créé votre compte sur TalentsTube, Félicitations !</p>
<p>Pour valider votre compte utilisateur, merci de vous rendre sur %confirmationUrl%
<br />Ce lien ne peut être utilisé qu'une seule fois pour valider votre compte.</p>
<p>Talents tube est la plateforme de rencontre des entreprises, des talents et des territoires par la vidéo.</p>
L'équipe de TalentsTube]]>
</target>
</trans-unit>
<trans-unit id="registration.email.message.talent.text">
<source>registration.email.message.talent.text</source>
<target>Bonjour %firstname% %lastname%,
Vous avez créé votre compte sur TalentsTube, Félicitations !
Pour valider votre compte utilisateur, merci de vous rendre sur %confirmationUrl%
Ce lien ne peut être utilisé qu'une seule fois pour valider votre compte.
Vous pouvez accéder à votre Tableau de Bord et commencer à montrer vos talents aux entreprises de
talents.
Soyez vous-même !
L'équipe de TalentsTube
</target>
</trans-unit>
<trans-unit id="registration.email.message.company.text">
<source>registration.email.message.company.text</source>
<target>Bonjour %firstname% %lastname%,
Vous avez créé votre compte sur TalentsTube, Félicitations !
Pour valider votre compte utilisateur, merci de vous rendre sur %confirmationUrl%
Ce lien ne peut être utilisé qu'une seule fois pour valider votre compte.
Talents tube est la plateforme de rencontre des entreprises, des talents et des territoires par la
vidéo.
L'équipe de TalentsTube
</target>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T14:35:51Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="3ed6a1235bf3e6337f499ec08dd3a1d6768b0c57" resname="layout.logged_in_as">
<source>layout.logged_in_as</source>
<target state="new">layout.logged_in_as</target>
<jms:reference-file line="66">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
<jms:reference-file line="3">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="360d5f783c46f5e90f1b24010cb6bf03626ec35b" resname="layout.login">
<source>layout.login</source>
<target state="new">layout.login</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="80a0b95340202d0b8c88ba8bd10b315ecdd1feba" resname="layout.logout">
<source>layout.logout</source>
<target state="new">layout.logout</target>
<jms:reference-file line="68">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6f2b87ab0da336a9cb633f397ff7f86ab7ea522b" resname="profile.show.email">
<source>profile.show.email</source>
<target state="new">profile.show.email</target>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/Profile/show_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="0d6307def2ec4ecb26978118bb2deca9d566945c" resname="profile.show.username">
<source>profile.show.username</source>
<target state="new">profile.show.username</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Profile/show_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="1fa5b2873fe30be026b854f6a51503b86c6ac81a" resname="registration.back">
<source>registration.back</source>
<target state="new">registration.back</target>
<jms:reference-file line="11">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="85a4eff0132a6f92eae3057837f285b3aedf38b8" resname="registration.check_email">
<source>registration.check_email</source>
<target state="new">registration.check_email</target>
<jms:reference-file line="9">/Resources/FOSUserBundle/views/Registration/check_email.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7a0a8fbc70fe82997f8a2ff89090f523ee63f72a" resname="registration.confirmed">
<source>registration.confirmed</source>
<target state="new">registration.confirmed</target>
<jms:reference-file line="9">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="10df4e23ec43b671aafea0a3a9ebc8dcc92b1bd0" resname="registration.email.subject">
<source>registration.email.subject</source>
<target state="new">registration.email.subject</target>
<jms:reference-file line="3">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="4ef79d57e94b4b74349d6533a231e09dc5be0ce2" resname="registration.submit">
<source>registration.submit</source>
<target state="new">registration.submit</target>
<jms:reference-file line="64">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="40c1a483571045e24d606bf00361cfd4d021ba05" resname="resetting.check_email">
<source>resetting.check_email</source>
<target state="new">resetting.check_email</target>
<jms:reference-file line="10">/Resources/FOSUserBundle/views/Resetting/check_email.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="70c8836a0e3b8dadb494b8de56ebed18939359b5" resname="resetting.email.message">
<source>resetting.email.message</source>
<target state="new">resetting.email.message</target>
<jms:reference-file line="10">/Resources/FOSUserBundle/views/Resetting/email.txt.twig</jms:reference-file>
</trans-unit>
<trans-unit id="126cf13058808d8948cc673c7933c6c1ce27841d" resname="resetting.email.subject">
<source>resetting.email.subject</source>
<target state="new">resetting.email.subject</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Resetting/email.txt.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e1470b3c202d9a4fa8e1afa7ed8695917f060ccd" resname="resetting.request.submit">
<source>resetting.request.submit</source>
<target state="new">resetting.request.submit</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Resetting/request_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7ad41bf8fb30013eb0f31ca027ca8d1dc7a3d96f" resname="resetting.request.username">
<source>resetting.request.username</source>
<target state="new">resetting.request.username</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Resetting/request_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="921fd7a5cc7f9e46eab31822855a22d9808b0477" resname="resetting.reset.submit">
<source>resetting.reset.submit</source>
<target state="new">resetting.reset.submit</target>
<jms:reference-file line="6">/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="62d5564c383b885ff0de25abd24a41080499970b" resname="security.login.password">
<source>security.login.password</source>
<target state="new">security.login.password</target>
<jms:reference-file line="18">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="d074ed9a0eb75b7f17ef2274c21d4c3d12d91634" resname="security.login.remember_me">
<source>security.login.remember_me</source>
<target state="new">security.login.remember_me</target>
<jms:reference-file line="24">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="79c180ac5e987e195d1dfeda857a114ed692d07f" resname="security.login.submit">
<source>security.login.submit</source>
<target state="new">security.login.submit</target>
<jms:reference-file line="27">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="64e1b2aaf6156a7e34a13fbc38801e89478efff8" resname="security.login.username">
<source>security.login.username</source>
<target state="new">security.login.username</target>
<jms:reference-file line="12">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
</body>
</file>
</xliff>
+113
View File
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T14:59:44Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="3ed6a1235bf3e6337f499ec08dd3a1d6768b0c57" resname="layout.logged_in_as">
<source>layout.logged_in_as</source>
<target state="new">layout.logged_in_as</target>
<jms:reference-file line="66">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
<jms:reference-file line="3">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="360d5f783c46f5e90f1b24010cb6bf03626ec35b" resname="layout.login">
<source>layout.login</source>
<target state="new">layout.login</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="80a0b95340202d0b8c88ba8bd10b315ecdd1feba" resname="layout.logout">
<source>layout.logout</source>
<target state="new">layout.logout</target>
<jms:reference-file line="68">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/layout.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6f2b87ab0da336a9cb633f397ff7f86ab7ea522b" resname="profile.show.email">
<source>profile.show.email</source>
<target state="new">profile.show.email</target>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/Profile/show_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="0d6307def2ec4ecb26978118bb2deca9d566945c" resname="profile.show.username">
<source>profile.show.username</source>
<target state="new">profile.show.username</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Profile/show_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="1fa5b2873fe30be026b854f6a51503b86c6ac81a" resname="registration.back">
<source>registration.back</source>
<target state="new">registration.back</target>
<jms:reference-file line="11">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="85a4eff0132a6f92eae3057837f285b3aedf38b8" resname="registration.check_email">
<source>registration.check_email</source>
<target state="new">registration.check_email</target>
<jms:reference-file line="9">/Resources/FOSUserBundle/views/Registration/check_email.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7a0a8fbc70fe82997f8a2ff89090f523ee63f72a" resname="registration.confirmed">
<source>registration.confirmed</source>
<target state="new">registration.confirmed</target>
<jms:reference-file line="9">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="10df4e23ec43b671aafea0a3a9ebc8dcc92b1bd0" resname="registration.email.subject">
<source>registration.email.subject</source>
<target state="new">registration.email.subject</target>
<jms:reference-file line="3">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="4ef79d57e94b4b74349d6533a231e09dc5be0ce2" resname="registration.submit">
<source>registration.submit</source>
<target state="new">registration.submit</target>
<jms:reference-file line="64">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="40c1a483571045e24d606bf00361cfd4d021ba05" resname="resetting.check_email">
<source>resetting.check_email</source>
<target state="new">resetting.check_email</target>
<jms:reference-file line="10">/Resources/FOSUserBundle/views/Resetting/check_email.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="70c8836a0e3b8dadb494b8de56ebed18939359b5" resname="resetting.email.message">
<source>resetting.email.message</source>
<target state="new">resetting.email.message</target>
<jms:reference-file line="10">/Resources/FOSUserBundle/views/Resetting/email.txt.twig</jms:reference-file>
</trans-unit>
<trans-unit id="126cf13058808d8948cc673c7933c6c1ce27841d" resname="resetting.email.subject">
<source>resetting.email.subject</source>
<target state="new">resetting.email.subject</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Resetting/email.txt.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e1470b3c202d9a4fa8e1afa7ed8695917f060ccd" resname="resetting.request.submit">
<source>resetting.request.submit</source>
<target state="new">resetting.request.submit</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Resetting/request_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7ad41bf8fb30013eb0f31ca027ca8d1dc7a3d96f" resname="resetting.request.username">
<source>resetting.request.username</source>
<target state="new">resetting.request.username</target>
<jms:reference-file line="4">/Resources/FOSUserBundle/views/Resetting/request_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="921fd7a5cc7f9e46eab31822855a22d9808b0477" resname="resetting.reset.submit">
<source>resetting.reset.submit</source>
<target state="new">resetting.reset.submit</target>
<jms:reference-file line="6">/Resources/FOSUserBundle/views/Resetting/reset_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="62d5564c383b885ff0de25abd24a41080499970b" resname="security.login.password">
<source>security.login.password</source>
<target state="new">security.login.password</target>
<jms:reference-file line="18">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="d074ed9a0eb75b7f17ef2274c21d4c3d12d91634" resname="security.login.remember_me">
<source>security.login.remember_me</source>
<target state="new">security.login.remember_me</target>
<jms:reference-file line="24">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="79c180ac5e987e195d1dfeda857a114ed692d07f" resname="security.login.submit">
<source>security.login.submit</source>
<target state="new">security.login.submit</target>
<jms:reference-file line="27">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="64e1b2aaf6156a7e34a13fbc38801e89478efff8" resname="security.login.username">
<source>security.login.username</source>
<target state="new">security.login.username</target>
<jms:reference-file line="12">/Resources/FOSUserBundle/views/Security/login_content.html.twig</jms:reference-file>
</trans-unit>
</body>
</file>
</xliff>
@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="profile.edit.submit">
<source>profile.edit.submit</source>
<target>Sauvegarder mon profil</target>
</trans-unit>
<trans-unit id="symfony_is_great">
<source>Symfony is great</source>
<target>J'aime Symfony</target>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,697 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T14:35:51Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="a98ccedb028be53b4853ca4df5eed031a88ba4a6" resname="A la une">
<source>A la une</source>
<target state="new">A la une</target>
<jms:reference-file line="81">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ecda7d17e8536f5dfa92691de1435f212530dbb9" resname="A publier">
<source>A publier</source>
<target state="new">A publier</target>
<jms:reference-file line="69">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2eb75f8458bd815f1cdfbbc067cdf6e87eaba50f" resname="Actif">
<source>Actif</source>
<target state="new">Actif</target>
<jms:reference-file line="49">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4e7afebcfbae000b22c7c85e5560f89a2a0280b4" resname="Admin">
<source>Admin</source>
<target state="new">Admin</target>
<jms:reference-file line="41">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="522e146679608203fc36e220c4e176063c0733f2" resname="Adresse">
<source>Adresse</source>
<target state="new">Adresse</target>
<jms:reference-file line="37">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="35">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="981019a82d9cf133f47398a592e51fae5d0b6c89" resname="Annonces">
<source>Annonces</source>
<target state="new">Annonces</target>
<jms:reference-file line="14">/../src/AppBundle/Form/TokenAddType.php</jms:reference-file>
</trans-unit>
<trans-unit id="766035f21969bcc319bba8e0e22e8930b9b4adbb" resname="Apprentissage">
<source>Apprentissage</source>
<target state="new">Apprentissage</target>
<jms:reference-file line="65">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="77">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="57d2d7a71ae2253de30af04b9a538f2551b56c39" resname="Brouillon">
<source>Brouillon</source>
<target state="new">Brouillon</target>
<jms:reference-file line="68">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="389d8399290605d60ce93d60c128f03c9b5fc2fc" resname="CDD">
<source>CDD</source>
<target state="new">CDD</target>
<jms:reference-file line="64">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="76">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="fd35700761aa446fb5f5fc16b0f9d524abec3bdb" resname="CDI">
<source>CDI</source>
<target state="new">CDI</target>
<jms:reference-file line="63">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="75">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="747791094b81444e09821a91f3ce4834cb07338e" resname="Code postal">
<source>Code postal</source>
<target state="new">Code postal</target>
<jms:reference-file line="49">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="46">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ea02f36776ce8cafed582e66b283e80c594ff769" resname="Commentaire (En cas de refus de l'annonce">
<source>Commentaire (En cas de refus de l'annonce</source>
<target state="new">Commentaire (En cas de refus de l'annonce</target>
<jms:reference-file line="19">/../src/AppBundle/Form/Admin/ModerationDeclineType.php</jms:reference-file>
</trans-unit>
<trans-unit id="71e1ec0db56407a09b7186a38d34c6b68ace51e7" resname="Commentaire lié à votre réponse vidéo">
<source>Commentaire lié à votre réponse vidéo</source>
<target state="new">Commentaire lié à votre réponse vidéo</target>
<jms:reference-file line="21">/../src/AppBundle/Form/AnswerType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ea10d7b17c2916c2d89cef01cc71fa3d097eb8a1" resname="Complément Adresse">
<source>Complément Adresse</source>
<target state="new">Complément Adresse</target>
<jms:reference-file line="42">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="40">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f3cb82af6c8203bfe6b4911b7e0e8385964509bf" resname="Contenu">
<source>Contenu</source>
<target state="new">Contenu</target>
<jms:reference-file line="33">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4143e17e399017a2ba56473639fd73d172193e76" resname="Date de fin de mise en ligne">
<source>Date de fin de mise en ligne</source>
<target state="new">Date de fin de mise en ligne</target>
<jms:reference-file line="36">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="d30649b670ad24d13105eae8d54f86947240676b" resname="Date de mise en ligne">
<source>Date de mise en ligne</source>
<target state="new">Date de mise en ligne</target>
<jms:reference-file line="29">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="8851f385b271ba2791c79f1db54ac797860b13a7" resname="Date de naissance">
<source>Date de naissance</source>
<target state="new">Date de naissance</target>
<jms:reference-file line="33">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="144ed124050a91ebe2b66f44c1cd23f8321a4495" resname="Description de l'annonce">
<source>Description de l'annonce</source>
<target state="new">Description de l'annonce</target>
<jms:reference-file line="52">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="64">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="56">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9536826850276edd94b429a5af2c09807be58fcc" resname="Décrire votre annonce">
<source>Décrire votre annonce</source>
<target state="new">Décrire votre annonce</target>
<jms:reference-file line="55">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="67">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="58">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="84add5b2952787581cb9a8851eef63d1ec75d22b" resname="Email">
<source>Email</source>
<target state="new">Email</target>
<jms:reference-file line="18">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1f0808dc8b6d5f1a2b3883ef4d4beb95417212b0" resname="Expirée">
<source>Expirée</source>
<target state="new">Expirée</target>
<jms:reference-file line="73">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e613d038b9a408b893c2c737281d6009f7dc1fc5" resname="Fermée">
<source>Fermée</source>
<target state="new">Fermée</target>
<jms:reference-file line="72">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="69d75a259933155717dfcd97bf50e84907a40583" resname="Indiquer un titre">
<source>Indiquer un titre</source>
<target state="new">Indiquer un titre</target>
<jms:reference-file line="50">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="42">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="b52209e374003c9d3ebb417fa17e89be91b5e50f" resname="Indiquer une référence">
<source>Indiquer une référence</source>
<target state="new">Indiquer une référence</target>
<jms:reference-file line="44">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="36">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="561865bb0092c3763e52d0144935753ae0eadf77" resname="Je confirme la consommation de mes crédits">
<source>Je confirme la consommation de mes crédits</source>
<target state="new">Je confirme la consommation de mes crédits</target>
<jms:reference-file line="31">/../src/AppBundle/Form/AdExtensionType.php</jms:reference-file>
<jms:reference-file line="20">/../src/AppBundle/Form/AdValidationType.php</jms:reference-file>
</trans-unit>
<trans-unit id="57c9479d86924ffcfcb81cd171950fe97573fd25" resname="Je suis">
<source>Je suis</source>
<target state="new">Je suis</target>
<jms:reference-file line="45">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="74341e3c271df3c784e595b804b1f90be0f80429" resname="Label">
<source>Label</source>
<target state="new">Label</target>
<jms:reference-file line="21">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="31c7fd2e291eeee7451ad31168f87183e31b4b9d" resname="Linkedin">
<source>Linkedin</source>
<target state="new">Linkedin</target>
<jms:reference-file line="70">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="64">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bdd7c4794026c9a026cb1523830d2cc818655463" resname="Localisation de l'annonce">
<source>Localisation de l'annonce</source>
<target state="new">Localisation de l'annonce</target>
<jms:reference-file line="43">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="55">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="47">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1b4a1099da9ee909d2adf8a24b1c38c99dd53dad" resname="Localité">
<source>Localité</source>
<target state="new">Localité</target>
<jms:reference-file line="27">/../src/AppBundle/Form/AdSearchType.php</jms:reference-file>
</trans-unit>
<trans-unit id="92379cbb8ecf696194b47b619a87e9e4f9a75db2" resname="Mail">
<source>Mail</source>
<target state="new">Mail</target>
<jms:reference-file line="30">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="68f4145fee7dde76afceb910165924ad14cf0d00" resname="Message">
<source>Message</source>
<target state="new">Message</target>
<jms:reference-file line="16">/../src/AppBundle/Form/ContactTalentType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e1ce0873b4e4d623cf1f74a87278674f1507eeb5" resname="Meta-description">
<source>Meta-description</source>
<target state="new">Meta-description</target>
<jms:reference-file line="29">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e4ef91cb01908af43e1d1735b3390344adbbf219" resname="Modérateur">
<source>Modérateur</source>
<target state="new">Modérateur</target>
<jms:reference-file line="42">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="0d304bea4ce52e963079c68a3e68a0e798d7e7d2" resname="Mois">
<source>Mois</source>
<target state="new">Mois</target>
<jms:reference-file line="19">/../src/AppBundle/Form/TokenAddType.php</jms:reference-file>
</trans-unit>
<trans-unit id="230d2dfcc9f1c94ee0df7bf0b1f4bcfd0945770a" resname="Mon Job de rêve">
<source>Mon Job de rêve</source>
<target state="new">Mon Job de rêve</target>
<jms:reference-file line="20">/../src/AppBundle/Form/AdSearchType.php</jms:reference-file>
</trans-unit>
<trans-unit id="94e2f3ee14b92e2e675a8f6118d28738dbf5c6ba" resname="Mot de passe">
<source>Mot de passe</source>
<target state="new">Mot de passe</target>
<jms:reference-file line="20">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="7ff20370c8e04428109a1801a67963668dd6d1d0" resname="Nom">
<source>Nom</source>
<target state="new">Nom</target>
<jms:reference-file line="29">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
<jms:reference-file line="17">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="09875e47cbd0b2a6b8f4cb8bdfd77794657e043d" resname="Nom d'utilisateur">
<source>Nom d'utilisateur</source>
<target state="new">Nom d'utilisateur</target>
<jms:reference-file line="19">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="8717f9605134bf853dd1dad545207a0b49d87588" resname="Nombre de mois de prolongation">
<source>Nombre de mois de prolongation</source>
<target state="new">Nombre de mois de prolongation</target>
<jms:reference-file line="27">/../src/AppBundle/Form/AdExtensionType.php</jms:reference-file>
</trans-unit>
<trans-unit id="410d84270cd244b1046edbb62d90378bc92cf28f" resname="Nombre de mois de visibilité de l'annonce">
<source>Nombre de mois de visibilité de l'annonce</source>
<target state="new">Nombre de mois de visibilité de l'annonce</target>
<jms:reference-file line="25">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2c924e3088204ee77ba681f72be3444357932fca" resname="Note">
<source>Note</source>
<target state="new">Note</target>
<jms:reference-file line="16">/../src/AppBundle/Form/NoteAjaxType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2a78f0e9eeb4969ad86a55df617e6bb0373df78f" resname="Pays">
<source>Pays</source>
<target state="new">Pays</target>
<jms:reference-file line="60">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="56">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="7415d477584c4c2fc1584b8d75fc94e90f0ca04f" resname="Photo de profil">
<source>Photo de profil</source>
<target state="new">Photo de profil</target>
<jms:reference-file line="48">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="6c8f8ff241538102ab0935bdb66cda6fc5cf5bf7" resname="Professionalisation">
<source>Professionalisation</source>
<target state="new">Professionalisation</target>
<jms:reference-file line="66">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="78">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e4387ade0f0eb6dd33cbfd0cd6a5e1944cca7748" resname="Prénom">
<source>Prénom</source>
<target state="new">Prénom</target>
<jms:reference-file line="28">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
<jms:reference-file line="16">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ebef6edc0d8d46e6f40516ccb85ed95714337429" resname="Publiée">
<source>Publiée</source>
<target state="new">Publiée</target>
<jms:reference-file line="71">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="7936bcb777fdbd9f0378d92a504b3d0bb63ba883" resname="Référence de l'annonce">
<source>Référence de l'annonce</source>
<target state="new">Référence de l'annonce</target>
<jms:reference-file line="42">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="34">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="df3183be383e4fe0f3ce625959b5f0a3d2717b97" resname="Rôles">
<source>Rôles</source>
<target state="new">Rôles</target>
<jms:reference-file line="37">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bcabc83e6e899939cccc4623dfb2c8dc51b20caa" resname="Site internet">
<source>Site internet</source>
<target state="new">Site internet</target>
<jms:reference-file line="69">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="63">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ca6d0e3aaa7d6cc0e9d9fe14eed28587f7ee1133" resname="Stage">
<source>Stage</source>
<target state="new">Stage</target>
<jms:reference-file line="67">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="79">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bae7d5be70820ed56467bd9a63744e23b47bd711" resname="Status">
<source>Status</source>
<target state="new">Status</target>
<jms:reference-file line="66">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
<jms:reference-file line="31">/../src/AppBundle/Form/ContactTalentType.php</jms:reference-file>
</trans-unit>
<trans-unit id="0be36f882561c8eeab583d04b718a374cd81b03e" resname="Tags de l'annonce (séparés par une virgules)">
<source>Tags de l'annonce (séparés par une virgules)</source>
<target state="new">Tags de l'annonce (séparés par une virgules)</target>
<jms:reference-file line="62">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="eb97899aedcd5609782b5ccb4ffa390e0e66a3eb" resname="Titre">
<source>Titre</source>
<target state="new">Titre</target>
<jms:reference-file line="25">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="322c3b70720a4f3c2fb76365a912026bad964be3" resname="Titre de l'annonce">
<source>Titre de l'annonce</source>
<target state="new">Titre de l'annonce</target>
<jms:reference-file line="48">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="40">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="305fa11c1c220fc2c1c5fe3b871ae89477e264d2" resname="Titre de la vidéo">
<source>Titre de la vidéo</source>
<target state="new">Titre de la vidéo</target>
<jms:reference-file line="87">/../src/AppBundle/Controller/MediaController.php</jms:reference-file>
<jms:reference-file line="16">/../src/AppBundle/Form/MediaType.php</jms:reference-file>
</trans-unit>
<trans-unit id="5392c950bdde4be7e5f5b8fdc6a1ca5f21e905cf" resname="Twitter">
<source>Twitter</source>
<target state="new">Twitter</target>
<jms:reference-file line="75">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="69">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4636d41802e8b07d10e46be37205de9c694e1bde" resname="Type de contrat">
<source>Type de contrat</source>
<target state="new">Type de contrat</target>
<jms:reference-file line="60">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="72">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2cc6c327a545b6256e1abe168fb739f6e7b2eb95" resname="Validée">
<source>Validée</source>
<target state="new">Validée</target>
<jms:reference-file line="70">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="972176113f903c45d3c3ae7331b3178a1f322bf8" resname="Ville">
<source>Ville</source>
<target state="new">Ville</target>
<jms:reference-file line="54">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="51">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="3fd06024b9a17e70d9c6028494fb93e91e3f81e0" resname="Vérifiée">
<source>Vérifiée</source>
<target state="new">Vérifiée</target>
<jms:reference-file line="78">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="dbeba0c8cad255e054600b7ac77942cafdaa20fc" resname="Webmaster">
<source>Webmaster</source>
<target state="new">Webmaster</target>
<jms:reference-file line="43">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="49192a770899211443febda21e2bc4dc4708ac52" resname="ad.answer.mail.send">
<source>ad.answer.mail.send</source>
<target state="new">ad.answer.mail.send</target>
<jms:reference-file line="52">/../src/AppBundle/Controller/AnswerController.php</jms:reference-file>
</trans-unit>
<trans-unit id="6426a4899107ecdd419e6424285ad9e244ffbb28" resname="ad.company.add.label">
<source>ad.company.add.label</source>
<target state="new">ad.company.add.label</target>
<jms:reference-file line="100">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="063933db12d96c1391a92b475c656d49eed90685" resname="ad.company.closed.label">
<source>ad.company.closed.label</source>
<target state="new">ad.company.closed.label</target>
<jms:reference-file line="69">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="12cbdcd297c374e4062ce4b68d5edd87e29b7198" resname="ad.company.dates.edit.label">
<source>ad.company.dates.edit.label</source>
<target state="new">ad.company.dates.edit.label</target>
<jms:reference-file line="78">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a12154b9854cf5024a358e24f7e97e9ef6dff077" resname="ad.company.dates.extension.label">
<source>ad.company.dates.extension.label</source>
<target state="new">ad.company.dates.extension.label</target>
<jms:reference-file line="63">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="19696007f641f93a0fdd233b07fbc79e780c7796" resname="ad.company.edit.label">
<source>ad.company.edit.label</source>
<target state="new">ad.company.edit.label</target>
<jms:reference-file line="38">/Resources/views/company/ad_list.html.twig</jms:reference-file>
<jms:reference-file line="45">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="117a8adf0e003c3eac1d47cfa3a80016f60b7a77" resname="ad.company.list.actions">
<source>ad.company.list.actions</source>
<target state="new">ad.company.list.actions</target>
<jms:reference-file line="16">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="3916ace50a75b58b66cef4386307d7aea0963bda" resname="ad.company.list.answers">
<source>ad.company.list.answers</source>
<target state="new">ad.company.list.answers</target>
<jms:reference-file line="15">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="63ad85a77b43cc3aeefb1fab796c19f69d3a524b" resname="ad.company.list.status">
<source>ad.company.list.status</source>
<target state="new">ad.company.list.status</target>
<jms:reference-file line="17">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="d498a2fd7c17bc0b194ac277d28e7833f12acdc2" resname="ad.company.list.title">
<source>ad.company.list.title</source>
<target state="new">ad.company.list.title</target>
<jms:reference-file line="14">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="381ee12cf4688a95d87da59bc99cbb439d10e33a" resname="ad.company.video.edit.label">
<source>ad.company.video.edit.label</source>
<target state="new">ad.company.video.edit.label</target>
<jms:reference-file line="54">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="d33810f5d91f38d2a3d1f5d68d228eb08b81f008" resname="ad.save.extension.title">
<source>ad.save.extension.title</source>
<target state="new">ad.save.extension.title</target>
<jms:reference-file line="237">/../src/AppBundle/Controller/AdController.php</jms:reference-file>
</trans-unit>
<trans-unit id="b4b1bdb58282f9e48c4d74093da9f4f7a8eeb080" resname="ad.talent.isAnswer.label">
<source>ad.talent.isAnswer.label</source>
<target state="new">ad.talent.isAnswer.label</target>
<jms:reference-file line="66">/Resources/views/default/ad_show.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="effef130b62b2682d67da281a156aac17d78bf55" resname="answer.talent.create.title.label">
<source>answer.talent.create.title.label</source>
<target state="new">answer.talent.create.title.label</target>
<jms:reference-file line="7">/Resources/views/talent/answer_create.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="77dda6fca04f6872d7f754aa0760c850fe6343a8" resname="company.account.password.modify.label">
<source>company.account.password.modify.label</source>
<target state="new">company.account.password.modify.label</target>
<jms:reference-file line="17">/Resources/views/company/my_account.html.twig</jms:reference-file>
<jms:reference-file line="32">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="84eb88e37cff29986d624109a10185810b359678" resname="company.account.save.title">
<source>company.account.save.title</source>
<target state="new">company.account.save.title</target>
<jms:reference-file line="74">/../src/AppBundle/Controller/CompanyController.php</jms:reference-file>
<jms:reference-file line="87">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="ccce04f8fc8ed55f4b1f1271098e08f80694c834" resname="company.menu.account.contact">
<source>company.menu.account.contact</source>
<target state="new">company.menu.account.contact</target>
<jms:reference-file line="26">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="24">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="0319931a36206078f2c14a1d1d9704e5868fbf75" resname="company.menu.account.label">
<source>company.menu.account.label</source>
<target state="new">company.menu.account.label</target>
<jms:reference-file line="25">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="8">/Resources/views/company/my_account.html.twig</jms:reference-file>
<jms:reference-file line="23">/Resources/views/talent/menu.html.twig</jms:reference-file>
<jms:reference-file line="9">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e47f4aab1060af9ba1d2e1c359f4695bb0dc0574" resname="company.menu.ads.label">
<source>company.menu.ads.label</source>
<target state="new">company.menu.ads.label</target>
<jms:reference-file line="20">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="2">/Resources/views/company/tabs.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a0d1386e9831142b68b8bfcdc7a173c8b2928b59" resname="company.menu.answers.label">
<source>company.menu.answers.label</source>
<target state="new">company.menu.answers.label</target>
<jms:reference-file line="3">/Resources/views/company/tabs.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ffad82d77bc96cf5d0aee842e6e03e584662b547" resname="company.menu.bookmark.label">
<source>company.menu.bookmark.label</source>
<target state="new">company.menu.bookmark.label</target>
<jms:reference-file line="4">/Resources/views/company/tabs.html.twig</jms:reference-file>
<jms:reference-file line="19">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="78ce66200873f2fad769dc9e1f6fffa813ac7613" resname="company.menu.dashboard.label">
<source>company.menu.dashboard.label</source>
<target state="new">company.menu.dashboard.label</target>
<jms:reference-file line="18">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="15">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7a4d3f7758cb9113ec5bb0f5cecb967400960786" resname="company.menu.profile.label">
<source>company.menu.profile.label</source>
<target state="new">company.menu.profile.label</target>
<jms:reference-file line="19">/Resources/views/company/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6743f54160976c0eab1f78b9950d0592a90bad5b" resname="company.menu.search.label">
<source>company.menu.search.label</source>
<target state="new">company.menu.search.label</target>
<jms:reference-file line="22">/Resources/views/company/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e6dc704080810f16c7ee76017ca9f1b027397070" resname="company.menu.videotheque.label">
<source>company.menu.videotheque.label</source>
<target state="new">company.menu.videotheque.label</target>
<jms:reference-file line="5">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="21">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/views/talent/media_list.html.twig</jms:reference-file>
<jms:reference-file line="18">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="b7a002c9a186dbdd8c3dfc904f114c90b9b8eb22" resname="company.profile.save.title">
<source>company.profile.save.title</source>
<target state="new">company.profile.save.title</target>
<jms:reference-file line="48">/../src/AppBundle/Controller/CompanyController.php</jms:reference-file>
<jms:reference-file line="61">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="ca28597bc66d707738e75e1edaf8ec8e841f3ddf" resname="global.date.label">
<source>global.date.label</source>
<target state="new">global.date.label</target>
<jms:reference-file line="14">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="13">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="53d93d57e23d3253400c74d1dd775837af8a804b" resname="global.edit.label">
<source>global.edit.label</source>
<target state="new">global.edit.label</target>
<jms:reference-file line="21">/Resources/views/company/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a0373f1aca43fe67db31984802677aca03989555" resname="global.intitule.label">
<source>global.intitule.label</source>
<target state="new">global.intitule.label</target>
<jms:reference-file line="13">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="12">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="733e3e6a44a45eda9770b46c4df79e1aea28a504" resname="global.save.label">
<source>global.save.label</source>
<target state="new">global.save.label</target>
<jms:reference-file line="12">/Resources/views/company/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="b9f2bc251b56db50b61480174f5f869640661825" resname="global.video.defaultaction.label">
<source>global.video.defaultaction.label</source>
<target state="new">global.video.defaultaction.label</target>
<jms:reference-file line="20">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="25">/Resources/views/talent/media_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ed7612f060173695a5f848544f6ce41622db38ee" resname="media.delete.video.label">
<source>media.delete.video.label</source>
<target state="new">media.delete.video.label</target>
<jms:reference-file line="32">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="40">/Resources/views/talent/media_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="35f2bb3cc9a0122aa0ec096b6ccf43a493f2bb35" resname="note.title">
<source>note.title</source>
<target state="new">note.title</target>
<jms:reference-file line="15">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="14">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ea4a74a64a9a688c1305a5215f77210accc3baf7" resname="profile.company.address1">
<source>profile.company.address1</source>
<target state="new">profile.company.address1</target>
<jms:reference-file line="50">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1c3948090cc3934ee50de009e32aeb23714fea4b" resname="profile.company.address2">
<source>profile.company.address2</source>
<target state="new">profile.company.address2</target>
<jms:reference-file line="55">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e2e9d5c6b4f8b675210a167d255856c0f746d5a7" resname="profile.company.brandname">
<source>profile.company.brandname</source>
<target state="new">profile.company.brandname</target>
<jms:reference-file line="34">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="68d3770443ea057c58a0df70b0475432f4c82e86" resname="profile.company.businessname">
<source>profile.company.businessname</source>
<target state="new">profile.company.businessname</target>
<jms:reference-file line="35">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="62aad31122d52daace5c0e5368e3fc24f0d27ac8" resname="profile.company.city">
<source>profile.company.city</source>
<target state="new">profile.company.city</target>
<jms:reference-file line="66">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="6a1d4d45f4cb0234faa6c1b106d2129470e8a067" resname="profile.company.country">
<source>profile.company.country</source>
<target state="new">profile.company.country</target>
<jms:reference-file line="71">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9aa42642da13091a263a49c4f3fba9ec3df38a55" resname="profile.company.description">
<source>profile.company.description</source>
<target state="new">profile.company.description</target>
<jms:reference-file line="46">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="15d725b43b87414d45ad406b4c972117d8acf584" resname="profile.company.logo">
<source>profile.company.logo</source>
<target state="new">profile.company.logo</target>
<jms:reference-file line="79">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="65c352b9de1ce2c0371f6e51bf841b9a9cc94c4b" resname="profile.company.postcode">
<source>profile.company.postcode</source>
<target state="new">profile.company.postcode</target>
<jms:reference-file line="61">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="35be2e1c035d032453a0b15b2146670f3e78c174" resname="profile.company.siren">
<source>profile.company.siren</source>
<target state="new">profile.company.siren</target>
<jms:reference-file line="38">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="5e080a8c837b05114e9d055217989f575ac460ff" resname="profile.company.size">
<source>profile.company.size</source>
<target state="new">profile.company.size</target>
<jms:reference-file line="43">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="c074016b06899909fab69ee8a7432261fb9717ae" resname="profile.company.tags">
<source>profile.company.tags</source>
<target state="new">profile.company.tags</target>
<jms:reference-file line="71">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="83">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="65">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="75">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
<jms:reference-file line="60">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f611bcbf0201c55f4f398600fe5adee9545bcb57" resname="profile.company.title">
<source>profile.company.title</source>
<target state="new">profile.company.title</target>
<jms:reference-file line="3">/Resources/views/company/profile.html.twig</jms:reference-file>
<jms:reference-file line="7">/Resources/views/company/profile.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="894c1d46e537fd01373c5834d9830eadebd68e93" resname="profile.company.website">
<source>profile.company.website</source>
<target state="new">profile.company.website</target>
<jms:reference-file line="47">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9741ffbcf8dbb31e1a2d32bd25cb0ccc5a6dea54" resname="profile.edit.submit">
<source>profile.edit.submit</source>
<target state="new">profile.edit.submit</target>
<jms:reference-file line="11">/Resources/views/company/profile.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/talent/profile.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="efaab4f508efe1149895c6ce2b9d41ff4ea97a73" resname="profile.talent.account.title">
<source>profile.talent.account.title</source>
<target state="new">profile.talent.account.title</target>
<jms:reference-file line="6">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="bcf1b85e6a312e073cb66b4e1dc41e4888cbe4a7" resname="profile.talent.firstname">
<source>profile.talent.firstname</source>
<target state="new">profile.talent.firstname</target>
<jms:reference-file line="12">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="4b03178c555dbc7ec4fdc323c26c42b7ba11f711" resname="profile.talent.lastname">
<source>profile.talent.lastname</source>
<target state="new">profile.talent.lastname</target>
<jms:reference-file line="12">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="040b85edc3b558e83386f5879818dc718f4ae94e" resname="profile.talent.title">
<source>profile.talent.title</source>
<target state="new">profile.talent.title</target>
<jms:reference-file line="16">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="db28b51e6987a97f43cfd58c615e88dd4f8e9ebe" resname="registration.email.message.company.html">
<source>registration.email.message.company.html</source>
<target state="new">registration.email.message.company.html</target>
<jms:reference-file line="4">/Resources/views/email/registration_company.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="131d3783053cb78b41e467530fdeee22944dc2a5" resname="registration.email.message.company.text">
<source>registration.email.message.company.text</source>
<target state="new">registration.email.message.company.text</target>
<jms:reference-file line="11">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6bbf1a05295998843d32e88559cce91c7698831a" resname="registration.email.message.talent.html">
<source>registration.email.message.talent.html</source>
<target state="new">registration.email.message.talent.html</target>
<jms:reference-file line="4">/Resources/views/email/registration_talent.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="1e0ce3f39b7425111cc750d835095728c815325e" resname="registration.email.message.talent.text">
<source>registration.email.message.talent.text</source>
<target state="new">registration.email.message.talent.text</target>
<jms:reference-file line="9">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="03a743c920252ba7b4ae7b250788f80629762a4b" resname="talent.mail.contact.send">
<source>talent.mail.contact.send</source>
<target state="new">talent.mail.contact.send</target>
<jms:reference-file line="187">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="352208fb7edf4560d64cf50457abc953fc138d36" resname="un homme">
<source>un homme</source>
<target state="new">un homme</target>
<jms:reference-file line="43">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="374d79499714187123b55d76b06c65ca278eda62" resname="une femme">
<source>une femme</source>
<target state="new">une femme</target>
<jms:reference-file line="42">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="85bbcaee9ce6e05001c449d7e8028e581d34ed06" resname="user.cgu.label">
<source>user.cgu.label</source>
<target state="new">user.cgu.label</target>
<jms:reference-file line="19">/../src/AppBundle/Form/RegistrationType.php</jms:reference-file>
<jms:reference-file line="43">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="306758f849f02a655017c93d84f5afd0c3547dd7" resname="user.register.title">
<source>user.register.title</source>
<target state="new">user.register.title</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Registration/check_email.html.twig</jms:reference-file>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/Registration/register.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="74a8159af7a8be67d7e4ac1bbff872043db517fb" resname="user.resetpassword.title">
<source>user.resetpassword.title</source>
<target state="new">user.resetpassword.title</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Resetting/check_email.html.twig</jms:reference-file>
<jms:reference-file line="6">/Resources/FOSUserBundle/views/Resetting/request.html.twig</jms:reference-file>
<jms:reference-file line="14">/Resources/FOSUserBundle/views/Resetting/reset.html.twig</jms:reference-file>
</trans-unit>
</body>
</file>
</xliff>
+733
View File
@@ -0,0 +1,733 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T17:27:35Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="a98ccedb028be53b4853ca4df5eed031a88ba4a6" resname="A la une">
<source>A la une</source>
<target>test</target>
<jms:reference-file line="81">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2eb75f8458bd815f1cdfbbc067cdf6e87eaba50f" resname="Actif">
<source>Actif</source>
<target>Actif</target>
<jms:reference-file line="49">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4e7afebcfbae000b22c7c85e5560f89a2a0280b4" resname="Admin">
<source>Admin</source>
<target>Admin</target>
<jms:reference-file line="41">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="522e146679608203fc36e220c4e176063c0733f2" resname="Adresse">
<source>Adresse</source>
<target>Adresse</target>
<jms:reference-file line="37">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="35">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="981019a82d9cf133f47398a592e51fae5d0b6c89" resname="Annonces">
<source>Annonces</source>
<target>Annonces</target>
<jms:reference-file line="14">/../src/AppBundle/Form/TokenAddType.php</jms:reference-file>
</trans-unit>
<trans-unit id="766035f21969bcc319bba8e0e22e8930b9b4adbb" resname="Apprentissage">
<source>Apprentissage</source>
<target state="new">Apprentissage</target>
<jms:reference-file line="65">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="389d8399290605d60ce93d60c128f03c9b5fc2fc" resname="CDD">
<source>CDD</source>
<target state="new">CDD</target>
<jms:reference-file line="64">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="fd35700761aa446fb5f5fc16b0f9d524abec3bdb" resname="CDI">
<source>CDI</source>
<target state="new">CDI</target>
<jms:reference-file line="63">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="747791094b81444e09821a91f3ce4834cb07338e" resname="Code postal">
<source>Code postal</source>
<target state="new">Code postal</target>
<jms:reference-file line="49">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="46">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ea02f36776ce8cafed582e66b283e80c594ff769" resname="Commentaire (En cas de refus de l'annonce">
<source>Commentaire (En cas de refus de l'annonce</source>
<target state="new">Commentaire (En cas de refus de l'annonce</target>
<jms:reference-file line="19">/../src/AppBundle/Form/Admin/ModerationDeclineType.php</jms:reference-file>
</trans-unit>
<trans-unit id="71e1ec0db56407a09b7186a38d34c6b68ace51e7" resname="Commentaire lié à votre réponse vidéo">
<source>Commentaire lié à votre réponse vidéo</source>
<target state="new">Commentaire lié à votre réponse vidéo</target>
<jms:reference-file line="21">/../src/AppBundle/Form/AnswerType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ea10d7b17c2916c2d89cef01cc71fa3d097eb8a1" resname="Complément Adresse">
<source>Complément Adresse</source>
<target state="new">Complément Adresse</target>
<jms:reference-file line="42">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="40">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f3cb82af6c8203bfe6b4911b7e0e8385964509bf" resname="Contenu">
<source>Contenu</source>
<target state="new">Contenu</target>
<jms:reference-file line="33">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4143e17e399017a2ba56473639fd73d172193e76" resname="Date de fin de mise en ligne">
<source>Date de fin de mise en ligne</source>
<target state="new">Date de fin de mise en ligne</target>
<jms:reference-file line="36">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="d30649b670ad24d13105eae8d54f86947240676b" resname="Date de mise en ligne">
<source>Date de mise en ligne</source>
<target state="new">Date de mise en ligne</target>
<jms:reference-file line="29">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="8851f385b271ba2791c79f1db54ac797860b13a7" resname="Date de naissance">
<source>Date de naissance</source>
<target state="new">Date de naissance</target>
<jms:reference-file line="33">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="144ed124050a91ebe2b66f44c1cd23f8321a4495" resname="Description de l'annonce">
<source>Description de l'annonce</source>
<target state="new">Description de l'annonce</target>
<jms:reference-file line="52">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9536826850276edd94b429a5af2c09807be58fcc" resname="Décrire votre annonce">
<source>Décrire votre annonce</source>
<target state="new">Décrire votre annonce</target>
<jms:reference-file line="55">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="84add5b2952787581cb9a8851eef63d1ec75d22b" resname="Email">
<source>Email</source>
<target state="new">Email</target>
<jms:reference-file line="18">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="561865bb0092c3763e52d0144935753ae0eadf77" resname="Je confirme la consommation de mes crédits">
<source>Je confirme la consommation de mes crédits</source>
<target state="new">Je confirme la consommation de mes crédits</target>
<jms:reference-file line="31">/../src/AppBundle/Form/AdExtensionType.php</jms:reference-file>
<jms:reference-file line="20">/../src/AppBundle/Form/AdValidationType.php</jms:reference-file>
</trans-unit>
<trans-unit id="57c9479d86924ffcfcb81cd171950fe97573fd25" resname="Je suis">
<source>Je suis</source>
<target state="new">Je suis</target>
<jms:reference-file line="45">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="74341e3c271df3c784e595b804b1f90be0f80429" resname="Label">
<source>Label</source>
<target state="new">Label</target>
<jms:reference-file line="21">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="31c7fd2e291eeee7451ad31168f87183e31b4b9d" resname="Linkedin">
<source>Linkedin</source>
<target state="new">Linkedin</target>
<jms:reference-file line="70">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="64">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bdd7c4794026c9a026cb1523830d2cc818655463" resname="Localisation de l'annonce">
<source>Localisation de l'annonce</source>
<target state="new">Localisation de l'annonce</target>
<jms:reference-file line="43">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1b4a1099da9ee909d2adf8a24b1c38c99dd53dad" resname="Localité">
<source>Localité</source>
<target state="new">Localité</target>
<jms:reference-file line="27">/../src/AppBundle/Form/AdSearchType.php</jms:reference-file>
</trans-unit>
<trans-unit id="92379cbb8ecf696194b47b619a87e9e4f9a75db2" resname="Mail">
<source>Mail</source>
<target state="new">Mail</target>
<jms:reference-file line="30">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="68f4145fee7dde76afceb910165924ad14cf0d00" resname="Message">
<source>Message</source>
<target state="new">Message</target>
<jms:reference-file line="16">/../src/AppBundle/Form/ContactTalentType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e1ce0873b4e4d623cf1f74a87278674f1507eeb5" resname="Meta-description">
<source>Meta-description</source>
<target state="new">Meta-description</target>
<jms:reference-file line="29">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e4ef91cb01908af43e1d1735b3390344adbbf219" resname="Modérateur">
<source>Modérateur</source>
<target state="new">Modérateur</target>
<jms:reference-file line="42">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="0d304bea4ce52e963079c68a3e68a0e798d7e7d2" resname="Mois">
<source>Mois</source>
<target state="new">Mois</target>
<jms:reference-file line="19">/../src/AppBundle/Form/TokenAddType.php</jms:reference-file>
</trans-unit>
<trans-unit id="230d2dfcc9f1c94ee0df7bf0b1f4bcfd0945770a" resname="Mon Job de rêve">
<source>Mon Job de rêve</source>
<target state="new">Mon Job de rêve</target>
<jms:reference-file line="20">/../src/AppBundle/Form/AdSearchType.php</jms:reference-file>
</trans-unit>
<trans-unit id="94e2f3ee14b92e2e675a8f6118d28738dbf5c6ba" resname="Mot de passe">
<source>Mot de passe</source>
<target state="new">Mot de passe</target>
<jms:reference-file line="20">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="7ff20370c8e04428109a1801a67963668dd6d1d0" resname="Nom">
<source>Nom</source>
<target state="new">Nom</target>
<jms:reference-file line="29">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
<jms:reference-file line="17">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="09875e47cbd0b2a6b8f4cb8bdfd77794657e043d" resname="Nom d'utilisateur">
<source>Nom d'utilisateur</source>
<target state="new">Nom d'utilisateur</target>
<jms:reference-file line="19">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="8717f9605134bf853dd1dad545207a0b49d87588" resname="Nombre de mois de prolongation">
<source>Nombre de mois de prolongation</source>
<target state="new">Nombre de mois de prolongation</target>
<jms:reference-file line="27">/../src/AppBundle/Form/AdExtensionType.php</jms:reference-file>
</trans-unit>
<trans-unit id="410d84270cd244b1046edbb62d90378bc92cf28f" resname="Nombre de mois de visibilité de l'annonce">
<source>Nombre de mois de visibilité de l'annonce</source>
<target state="new">Nombre de mois de visibilité de l'annonce</target>
<jms:reference-file line="25">/../src/AppBundle/Form/AdDateType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2c924e3088204ee77ba681f72be3444357932fca" resname="Note">
<source>Note</source>
<target state="new">Note</target>
<jms:reference-file line="16">/../src/AppBundle/Form/NoteAjaxType.php</jms:reference-file>
</trans-unit>
<trans-unit id="2a78f0e9eeb4969ad86a55df617e6bb0373df78f" resname="Pays">
<source>Pays</source>
<target state="new">Pays</target>
<jms:reference-file line="60">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="56">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="7415d477584c4c2fc1584b8d75fc94e90f0ca04f" resname="Photo de profil">
<source>Photo de profil</source>
<target state="new">Photo de profil</target>
<jms:reference-file line="48">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="6c8f8ff241538102ab0935bdb66cda6fc5cf5bf7" resname="Professionalisation">
<source>Professionalisation</source>
<target state="new">Professionalisation</target>
<jms:reference-file line="66">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e4387ade0f0eb6dd33cbfd0cd6a5e1944cca7748" resname="Prénom">
<source>Prénom</source>
<target state="new">Prénom</target>
<jms:reference-file line="28">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
<jms:reference-file line="16">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="df3183be383e4fe0f3ce625959b5f0a3d2717b97" resname="Rôles">
<source>Rôles</source>
<target state="new">Rôles</target>
<jms:reference-file line="37">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bcabc83e6e899939cccc4623dfb2c8dc51b20caa" resname="Site internet">
<source>Site internet</source>
<target state="new">Site internet</target>
<jms:reference-file line="69">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="63">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ca6d0e3aaa7d6cc0e9d9fe14eed28587f7ee1133" resname="Stage">
<source>Stage</source>
<target state="new">Stage</target>
<jms:reference-file line="67">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bae7d5be70820ed56467bd9a63744e23b47bd711" resname="Status">
<source>Status</source>
<target state="new">Status</target>
<jms:reference-file line="72">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
<jms:reference-file line="31">/../src/AppBundle/Form/ContactTalentType.php</jms:reference-file>
</trans-unit>
<trans-unit id="eb97899aedcd5609782b5ccb4ffa390e0e66a3eb" resname="Titre">
<source>Titre</source>
<target state="new">Titre</target>
<jms:reference-file line="25">/../src/AppBundle/Form/Admin/PageType.php</jms:reference-file>
</trans-unit>
<trans-unit id="305fa11c1c220fc2c1c5fe3b871ae89477e264d2" resname="Titre de la vidéo">
<source>Titre de la vidéo</source>
<target state="new">Titre de la vidéo</target>
<jms:reference-file line="87">/../src/AppBundle/Controller/MediaController.php</jms:reference-file>
<jms:reference-file line="16">/../src/AppBundle/Form/MediaType.php</jms:reference-file>
</trans-unit>
<trans-unit id="5392c950bdde4be7e5f5b8fdc6a1ca5f21e905cf" resname="Twitter">
<source>Twitter</source>
<target state="new">Twitter</target>
<jms:reference-file line="75">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="69">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4636d41802e8b07d10e46be37205de9c694e1bde" resname="Type de contrat">
<source>Type de contrat</source>
<target state="new">Type de contrat</target>
<jms:reference-file line="60">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
</trans-unit>
<trans-unit id="972176113f903c45d3c3ae7331b3178a1f322bf8" resname="Ville">
<source>Ville</source>
<target state="new">Ville</target>
<jms:reference-file line="54">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="51">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="dbeba0c8cad255e054600b7ac77942cafdaa20fc" resname="Webmaster">
<source>Webmaster</source>
<target state="new">Webmaster</target>
<jms:reference-file line="43">/../src/AppBundle/Form/UserType.php</jms:reference-file>
</trans-unit>
<trans-unit id="49192a770899211443febda21e2bc4dc4708ac52" resname="ad.answer.mail.send">
<source>ad.answer.mail.send</source>
<target state="new">ad.answer.mail.send</target>
<jms:reference-file line="52">/../src/AppBundle/Controller/AnswerController.php</jms:reference-file>
</trans-unit>
<trans-unit id="6426a4899107ecdd419e6424285ad9e244ffbb28" resname="ad.company.add.label">
<source>ad.company.add.label</source>
<target state="new">ad.company.add.label</target>
<jms:reference-file line="100">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="063933db12d96c1391a92b475c656d49eed90685" resname="ad.company.closed.label">
<source>ad.company.closed.label</source>
<target state="new">ad.company.closed.label</target>
<jms:reference-file line="69">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="12cbdcd297c374e4062ce4b68d5edd87e29b7198" resname="ad.company.dates.edit.label">
<source>ad.company.dates.edit.label</source>
<target state="new">ad.company.dates.edit.label</target>
<jms:reference-file line="78">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a12154b9854cf5024a358e24f7e97e9ef6dff077" resname="ad.company.dates.extension.label">
<source>ad.company.dates.extension.label</source>
<target state="new">ad.company.dates.extension.label</target>
<jms:reference-file line="63">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="19696007f641f93a0fdd233b07fbc79e780c7796" resname="ad.company.edit.label">
<source>ad.company.edit.label</source>
<target state="new">ad.company.edit.label</target>
<jms:reference-file line="38">/Resources/views/company/ad_list.html.twig</jms:reference-file>
<jms:reference-file line="45">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="117a8adf0e003c3eac1d47cfa3a80016f60b7a77" resname="ad.company.list.actions">
<source>ad.company.list.actions</source>
<target state="new">ad.company.list.actions</target>
<jms:reference-file line="16">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="3916ace50a75b58b66cef4386307d7aea0963bda" resname="ad.company.list.answers">
<source>ad.company.list.answers</source>
<target state="new">ad.company.list.answers</target>
<jms:reference-file line="15">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="63ad85a77b43cc3aeefb1fab796c19f69d3a524b" resname="ad.company.list.status">
<source>ad.company.list.status</source>
<target state="new">ad.company.list.status</target>
<jms:reference-file line="17">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="d498a2fd7c17bc0b194ac277d28e7833f12acdc2" resname="ad.company.list.title">
<source>ad.company.list.title</source>
<target state="new">ad.company.list.title</target>
<jms:reference-file line="14">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="381ee12cf4688a95d87da59bc99cbb439d10e33a" resname="ad.company.video.edit.label">
<source>ad.company.video.edit.label</source>
<target state="new">ad.company.video.edit.label</target>
<jms:reference-file line="54">/Resources/views/company/ad_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="f374eee088ad7af52c23c4800b7a61478632db67" resname="ad.contract_type">
<source>ad.contract_type</source>
<target state="new">ad.contract_type</target>
<jms:reference-file line="72">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f619f1154c01edb1df80115034145bc557585cf8" resname="ad.desc">
<source>Description de l'annonce</source>
<target>Description de l'annonce</target>
<jms:reference-file line="64">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="60">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="c53ed0d007a72abaf1d8fb8cea4b009e88c23463" resname="ad.desc.p">
<source>Décrire votre annonce</source>
<target>Décrire votre annonce</target>
<jms:reference-file line="67">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="63">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="bd63234f9bc4c7e68e22cc1789bc2f710537f5db" resname="ad.location">
<source>Localisation de l'annonce</source>
<target>Localisation de l'annonce</target>
<jms:reference-file line="55">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="50">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="58de5f0b8e2d91dee1a35257e1fd3f231d3f9d0c" resname="ad.reference">
<source>ad.reference</source>
<target>Référence</target>
<jms:reference-file line="42">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="34">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="55eb0b00a07ad5862a12b7cfcced43734ad5ea22" resname="ad.reference.p">
<source>indiquez une référence</source>
<target>indiquez une référence</target>
<jms:reference-file line="44">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="37">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="d33810f5d91f38d2a3d1f5d68d228eb08b81f008" resname="ad.save.extension.title">
<source>ad.save.extension.title</source>
<target state="new">ad.save.extension.title</target>
<jms:reference-file line="237">/../src/AppBundle/Controller/AdController.php</jms:reference-file>
</trans-unit>
<trans-unit id="803056550c5125dfb932f58a0715908773656a5a" resname="ad.tags">
<source>TTags : merci de séparer vos mots clés par une virgule</source>
<target>Tags : merci de séparer vos mots clés par une virgule</target>
<jms:reference-file line="83">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="68">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="b4b1bdb58282f9e48c4d74093da9f4f7a8eeb080" resname="ad.talent.isAnswer.label">
<source>ad.talent.isAnswer.label</source>
<target>ad.talent.isAnswer.label</target>
<jms:reference-file line="66">/Resources/views/default/ad_show.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a1e354e851c25197009d3f27bb34a588f70700c7" resname="ad.title">
<source>ad.title</source>
<target>Titre</target>
<jms:reference-file line="48">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="41">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="4a35846f9bd89184862468fb5b886a4b2b420137" resname="ad.title.p">
<source>indiquez un titre</source>
<target state="new">indiquez un titre</target>
<jms:reference-file line="50">/../src/AppBundle/Form/AdType.php</jms:reference-file>
<jms:reference-file line="44">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f2bb3f8020b1ecac44155b37f87ba6a359a59e71" resname="ad.verified">
<source>ad.verified</source>
<target state="new">ad.verified</target>
<jms:reference-file line="84">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="effef130b62b2682d67da281a156aac17d78bf55" resname="answer.talent.create.title.label">
<source>answer.talent.create.title.label</source>
<target state="new">answer.talent.create.title.label</target>
<jms:reference-file line="7">/Resources/views/talent/answer_create.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="77dda6fca04f6872d7f754aa0760c850fe6343a8" resname="company.account.password.modify.label">
<source>company.account.password.modify.label</source>
<target state="new">company.account.password.modify.label</target>
<jms:reference-file line="17">/Resources/views/company/my_account.html.twig</jms:reference-file>
<jms:reference-file line="32">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="84eb88e37cff29986d624109a10185810b359678" resname="company.account.save.title">
<source>company.account.save.title</source>
<target state="new">company.account.save.title</target>
<jms:reference-file line="74">/../src/AppBundle/Controller/CompanyController.php</jms:reference-file>
<jms:reference-file line="87">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="ccce04f8fc8ed55f4b1f1271098e08f80694c834" resname="company.menu.account.contact">
<source>company.menu.account.contact</source>
<target state="new">company.menu.account.contact</target>
<jms:reference-file line="26">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="24">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="0319931a36206078f2c14a1d1d9704e5868fbf75" resname="company.menu.account.label">
<source>company.menu.account.label</source>
<target state="new">company.menu.account.label</target>
<jms:reference-file line="25">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="8">/Resources/views/company/my_account.html.twig</jms:reference-file>
<jms:reference-file line="23">/Resources/views/talent/menu.html.twig</jms:reference-file>
<jms:reference-file line="9">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e47f4aab1060af9ba1d2e1c359f4695bb0dc0574" resname="company.menu.ads.label">
<source>company.menu.ads.label</source>
<target state="new">company.menu.ads.label</target>
<jms:reference-file line="20">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="2">/Resources/views/company/tabs.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a0d1386e9831142b68b8bfcdc7a173c8b2928b59" resname="company.menu.answers.label">
<source>company.menu.answers.label</source>
<target state="new">company.menu.answers.label</target>
<jms:reference-file line="3">/Resources/views/company/tabs.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ffad82d77bc96cf5d0aee842e6e03e584662b547" resname="company.menu.bookmark.label">
<source>company.menu.bookmark.label</source>
<target state="new">company.menu.bookmark.label</target>
<jms:reference-file line="4">/Resources/views/company/tabs.html.twig</jms:reference-file>
<jms:reference-file line="19">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="78ce66200873f2fad769dc9e1f6fffa813ac7613" resname="company.menu.dashboard.label">
<source>company.menu.dashboard.label</source>
<target state="new">company.menu.dashboard.label</target>
<jms:reference-file line="18">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="15">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="7a4d3f7758cb9113ec5bb0f5cecb967400960786" resname="company.menu.profile.label">
<source>company.menu.profile.label</source>
<target state="new">company.menu.profile.label</target>
<jms:reference-file line="19">/Resources/views/company/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6743f54160976c0eab1f78b9950d0592a90bad5b" resname="company.menu.search.label">
<source>company.menu.search.label</source>
<target state="new">company.menu.search.label</target>
<jms:reference-file line="22">/Resources/views/company/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="e6dc704080810f16c7ee76017ca9f1b027397070" resname="company.menu.videotheque.label">
<source>company.menu.videotheque.label</source>
<target state="new">company.menu.videotheque.label</target>
<jms:reference-file line="5">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="21">/Resources/views/company/menu.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/views/talent/media_list.html.twig</jms:reference-file>
<jms:reference-file line="18">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="b7a002c9a186dbdd8c3dfc904f114c90b9b8eb22" resname="company.profile.save.title">
<source>company.profile.save.title</source>
<target state="new">company.profile.save.title</target>
<jms:reference-file line="48">/../src/AppBundle/Controller/CompanyController.php</jms:reference-file>
<jms:reference-file line="61">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="d287b85f8c30e5e5e086acc1fb840382823edae6" resname="contract_type.apprentissage">
<source>contract_type.apprentissage</source>
<target state="new">contract_type.apprentissage</target>
<jms:reference-file line="77">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="6b42c660af513217ec1bb72d63507a11738b4f4d" resname="contract_type.cdd">
<source>contract_type.cdd</source>
<target state="new">contract_type.cdd</target>
<jms:reference-file line="76">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="082753fe7dbe472cb72f4f16bf7e827e5f92f367" resname="contract_type.cdi">
<source>contract_type.cdi</source>
<target state="new">contract_type.cdi</target>
<jms:reference-file line="75">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f2233747164bdc4303d2a04653e39adf5f4a69f9" resname="contract_type.professionalisation">
<source>contract_type.professionalisation</source>
<target state="new">contract_type.professionalisation</target>
<jms:reference-file line="78">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="a4697d3841f432342ec8af8424d3bcdd9c35bda1" resname="contract_type.stage">
<source>contract_type.stage</source>
<target state="new">contract_type.stage</target>
<jms:reference-file line="79">/../src/AppBundle/Form/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="ca28597bc66d707738e75e1edaf8ec8e841f3ddf" resname="global.date.label">
<source>global.date.label</source>
<target state="new">global.date.label</target>
<jms:reference-file line="14">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="13">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="53d93d57e23d3253400c74d1dd775837af8a804b" resname="global.edit.label">
<source>global.edit.label</source>
<target state="new">global.edit.label</target>
<jms:reference-file line="21">/Resources/views/company/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="a0373f1aca43fe67db31984802677aca03989555" resname="global.intitule.label">
<source>global.intitule.label</source>
<target state="new">global.intitule.label</target>
<jms:reference-file line="13">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="12">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="733e3e6a44a45eda9770b46c4df79e1aea28a504" resname="global.save.label">
<source>global.save.label</source>
<target state="new">global.save.label</target>
<jms:reference-file line="12">/Resources/views/company/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="b9f2bc251b56db50b61480174f5f869640661825" resname="global.video.defaultaction.label">
<source>global.video.defaultaction.label</source>
<target state="new">global.video.defaultaction.label</target>
<jms:reference-file line="20">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="25">/Resources/views/talent/media_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ed7612f060173695a5f848544f6ce41622db38ee" resname="media.delete.video.label">
<source>media.delete.video.label</source>
<target state="new">media.delete.video.label</target>
<jms:reference-file line="32">/Resources/views/company/media_list.html.twig</jms:reference-file>
<jms:reference-file line="40">/Resources/views/talent/media_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="35f2bb3cc9a0122aa0ec096b6ccf43a493f2bb35" resname="note.title">
<source>note.title</source>
<target state="new">note.title</target>
<jms:reference-file line="15">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="14">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="ea4a74a64a9a688c1305a5215f77210accc3baf7" resname="profile.company.address1">
<source>profile.company.address1</source>
<target state="new">profile.company.address1</target>
<jms:reference-file line="50">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1c3948090cc3934ee50de009e32aeb23714fea4b" resname="profile.company.address2">
<source>profile.company.address2</source>
<target state="new">profile.company.address2</target>
<jms:reference-file line="55">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="e2e9d5c6b4f8b675210a167d255856c0f746d5a7" resname="profile.company.brandname">
<source>profile.company.brandname</source>
<target state="new">profile.company.brandname</target>
<jms:reference-file line="34">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="68d3770443ea057c58a0df70b0475432f4c82e86" resname="profile.company.businessname">
<source>profile.company.businessname</source>
<target state="new">profile.company.businessname</target>
<jms:reference-file line="35">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="62aad31122d52daace5c0e5368e3fc24f0d27ac8" resname="profile.company.city">
<source>profile.company.city</source>
<target state="new">profile.company.city</target>
<jms:reference-file line="66">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="6a1d4d45f4cb0234faa6c1b106d2129470e8a067" resname="profile.company.country">
<source>profile.company.country</source>
<target state="new">profile.company.country</target>
<jms:reference-file line="71">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9aa42642da13091a263a49c4f3fba9ec3df38a55" resname="profile.company.description">
<source>profile.company.description</source>
<target state="new">profile.company.description</target>
<jms:reference-file line="46">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="15d725b43b87414d45ad406b4c972117d8acf584" resname="profile.company.logo">
<source>profile.company.logo</source>
<target state="new">profile.company.logo</target>
<jms:reference-file line="79">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="65c352b9de1ce2c0371f6e51bf841b9a9cc94c4b" resname="profile.company.postcode">
<source>profile.company.postcode</source>
<target state="new">profile.company.postcode</target>
<jms:reference-file line="61">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="35be2e1c035d032453a0b15b2146670f3e78c174" resname="profile.company.siren">
<source>profile.company.siren</source>
<target state="new">profile.company.siren</target>
<jms:reference-file line="38">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="5e080a8c837b05114e9d055217989f575ac460ff" resname="profile.company.size">
<source>profile.company.size</source>
<target state="new">profile.company.size</target>
<jms:reference-file line="43">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="c074016b06899909fab69ee8a7432261fb9717ae" resname="profile.company.tags">
<source>profile.company.tags</source>
<target>profile.company.tags</target>
<jms:reference-file line="71">/../src/AppBundle/Form/AdSoftType.php</jms:reference-file>
<jms:reference-file line="65">/../src/AppBundle/Form/Admin/TalentAdminType.php</jms:reference-file>
<jms:reference-file line="75">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
<jms:reference-file line="60">/../src/AppBundle/Form/TalentProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="f611bcbf0201c55f4f398600fe5adee9545bcb57" resname="profile.company.title">
<source>profile.company.title</source>
<target state="new">profile.company.title</target>
<jms:reference-file line="3">/Resources/views/company/profile.html.twig</jms:reference-file>
<jms:reference-file line="7">/Resources/views/company/profile.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="894c1d46e537fd01373c5834d9830eadebd68e93" resname="profile.company.website">
<source>profile.company.website</source>
<target state="new">profile.company.website</target>
<jms:reference-file line="47">/../src/AppBundle/Form/CompanyProfileType.php</jms:reference-file>
</trans-unit>
<trans-unit id="9741ffbcf8dbb31e1a2d32bd25cb0ccc5a6dea54" resname="profile.edit.submit">
<source>profile.edit.submit</source>
<target state="new">profile.edit.submit</target>
<jms:reference-file line="11">/Resources/views/company/profile.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/talent/profile.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="efaab4f508efe1149895c6ce2b9d41ff4ea97a73" resname="profile.talent.account.title">
<source>profile.talent.account.title</source>
<target state="new">profile.talent.account.title</target>
<jms:reference-file line="6">/Resources/views/talent/my_account.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="bcf1b85e6a312e073cb66b4e1dc41e4888cbe4a7" resname="profile.talent.firstname">
<source>profile.talent.firstname</source>
<target state="new">profile.talent.firstname</target>
<jms:reference-file line="12">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="4b03178c555dbc7ec4fdc323c26c42b7ba11f711" resname="profile.talent.lastname">
<source>profile.talent.lastname</source>
<target state="new">profile.talent.lastname</target>
<jms:reference-file line="12">/Resources/views/company/ad_answer_list.html.twig</jms:reference-file>
<jms:reference-file line="11">/Resources/views/company/answer_list.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="040b85edc3b558e83386f5879818dc718f4ae94e" resname="profile.talent.title">
<source>profile.talent.title</source>
<target state="new">profile.talent.title</target>
<jms:reference-file line="16">/Resources/views/talent/menu.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="db28b51e6987a97f43cfd58c615e88dd4f8e9ebe" resname="registration.email.message.company.html">
<source>registration.email.message.company.html</source>
<target state="new">registration.email.message.company.html</target>
<jms:reference-file line="4">/Resources/views/email/registration_company.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="131d3783053cb78b41e467530fdeee22944dc2a5" resname="registration.email.message.company.text">
<source>registration.email.message.company.text</source>
<target state="new">registration.email.message.company.text</target>
<jms:reference-file line="11">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="6bbf1a05295998843d32e88559cce91c7698831a" resname="registration.email.message.talent.html">
<source>registration.email.message.talent.html</source>
<target state="new">registration.email.message.talent.html</target>
<jms:reference-file line="4">/Resources/views/email/registration_talent.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="1e0ce3f39b7425111cc750d835095728c815325e" resname="registration.email.message.talent.text">
<source>registration.email.message.talent.text</source>
<target state="new">registration.email.message.talent.text</target>
<jms:reference-file line="9">/Resources/views/email/registration.email.twig</jms:reference-file>
</trans-unit>
<trans-unit id="c34e9ff48aacea57c3744b7b06ed6daa6310248b" resname="status.closed">
<source>status.closed</source>
<target state="new">status.closed</target>
<jms:reference-file line="78">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="0abfe8e0248c7f23c78328147857976f560be365" resname="status.draft">
<source>status.draft</source>
<target state="new">status.draft</target>
<jms:reference-file line="74">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="78f75814c9c8a8be8e132aff86479e27d34f4917" resname="status.expired">
<source>status.expired</source>
<target state="new">status.expired</target>
<jms:reference-file line="79">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="1216b4287a5fc1be5eb29ecc9a0de2585e1a81bd" resname="status.published">
<source>status.published</source>
<target state="new">status.published</target>
<jms:reference-file line="77">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="8463f5bb86135114441e1a20a7a68a02d636dc6f" resname="status.to_publish">
<source>status.to_publish</source>
<target state="new">status.to_publish</target>
<jms:reference-file line="75">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="875192291cec838f2ecd6118c68cc054551e9396" resname="status.validated">
<source>status.validated</source>
<target state="new">status.validated</target>
<jms:reference-file line="76">/../src/AppBundle/Form/Admin/AdType.php</jms:reference-file>
</trans-unit>
<trans-unit id="03a743c920252ba7b4ae7b250788f80629762a4b" resname="talent.mail.contact.send">
<source>talent.mail.contact.send</source>
<target state="new">talent.mail.contact.send</target>
<jms:reference-file line="187">/../src/AppBundle/Controller/TalentController.php</jms:reference-file>
</trans-unit>
<trans-unit id="352208fb7edf4560d64cf50457abc953fc138d36" resname="un homme">
<source>un homme</source>
<target state="new">un homme</target>
<jms:reference-file line="43">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="374d79499714187123b55d76b06c65ca278eda62" resname="une femme">
<source>une femme</source>
<target state="new">une femme</target>
<jms:reference-file line="42">/../src/AppBundle/Form/MyAccountType.php</jms:reference-file>
</trans-unit>
<trans-unit id="85bbcaee9ce6e05001c449d7e8028e581d34ed06" resname="user.cgu.label">
<source>user.cgu.label</source>
<target state="new">user.cgu.label</target>
<jms:reference-file line="19">/../src/AppBundle/Form/RegistrationType.php</jms:reference-file>
<jms:reference-file line="43">/Resources/FOSUserBundle/views/Registration/register_content.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="306758f849f02a655017c93d84f5afd0c3547dd7" resname="user.register.title">
<source>user.register.title</source>
<target state="new">user.register.title</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Registration/check_email.html.twig</jms:reference-file>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Registration/confirmed.html.twig</jms:reference-file>
<jms:reference-file line="5">/Resources/FOSUserBundle/views/Registration/register.html.twig</jms:reference-file>
</trans-unit>
<trans-unit id="74a8159af7a8be67d7e4ac1bbff872043db517fb" resname="user.resetpassword.title">
<source>user.resetpassword.title</source>
<target state="new">user.resetpassword.title</target>
<jms:reference-file line="8">/Resources/FOSUserBundle/views/Resetting/check_email.html.twig</jms:reference-file>
<jms:reference-file line="6">/Resources/FOSUserBundle/views/Resetting/request.html.twig</jms:reference-file>
<jms:reference-file line="14">/Resources/FOSUserBundle/views/Resetting/reset.html.twig</jms:reference-file>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T14:35:51Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="fbafec0bd8b6d8dd89ea060933b4b9a00df73c8e" resname="La date de fin de mise en ligne doit être superieur à la date de début">
<source>La date de fin de mise en ligne doit être superieur à la date de début</source>
<target state="new">La date de fin de mise en ligne doit être superieur à la date de début</target>
</trans-unit>
<trans-unit id="f48ccf84018671218aac090abf90770212497b70" resname="fos_user.email.already_used">
<source>fos_user.email.already_used</source>
<target state="new">fos_user.email.already_used</target>
</trans-unit>
<trans-unit id="d0e28536be754aebc7ef73cdc6cf0d729311ce1d" resname="fos_user.email.blank">
<source>fos_user.email.blank</source>
<target state="new">fos_user.email.blank</target>
</trans-unit>
<trans-unit id="17a097b4a496b3378a290ea4f8a05bc2a7879142" resname="fos_user.email.invalid">
<source>fos_user.email.invalid</source>
<target state="new">fos_user.email.invalid</target>
</trans-unit>
<trans-unit id="9760d0f9c28fee7f91e5cad9e282921b13cd2f0b" resname="fos_user.email.long">
<source>fos_user.email.long</source>
<target state="new">fos_user.email.long</target>
</trans-unit>
<trans-unit id="1a1b926521b2b3010b91de1787f9265b3d6a97ae" resname="fos_user.email.short">
<source>fos_user.email.short</source>
<target state="new">fos_user.email.short</target>
</trans-unit>
<trans-unit id="1df43a6e24af03c39d20b2f1f5cbefdef7b30416" resname="fos_user.password.blank">
<source>fos_user.password.blank</source>
<target state="new">fos_user.password.blank</target>
</trans-unit>
<trans-unit id="4b3130df261ac66147653997d2d83952a330faac" resname="fos_user.password.short">
<source>fos_user.password.short</source>
<target state="new">fos_user.password.short</target>
</trans-unit>
<trans-unit id="77c8ec07f205976bbed1a3ce90fdc458891bb81d" resname="fos_user.username.already_used">
<source>fos_user.username.already_used</source>
<target state="new">fos_user.username.already_used</target>
</trans-unit>
<trans-unit id="312a20b0239a4236f4b08e4e0ed35153a03667d0" resname="fos_user.username.blank">
<source>fos_user.username.blank</source>
<target state="new">fos_user.username.blank</target>
</trans-unit>
<trans-unit id="56ef686ed0b86d02dd4077e0796a4f1e61377552" resname="fos_user.username.long">
<source>fos_user.username.long</source>
<target state="new">fos_user.username.long</target>
</trans-unit>
<trans-unit id="920e8d37f8a7c923ece7d123d55668ac522d612d" resname="fos_user.username.short">
<source>fos_user.username.short</source>
<target state="new">fos_user.username.short</target>
</trans-unit>
</body>
</file>
</xliff>
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:jms="urn:jms:translation" version="1.2">
<file date="2017-07-07T14:59:44Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">
<header>
<tool tool-id="JMSTranslationBundle" tool-name="JMSTranslationBundle" tool-version="1.1.0-DEV"/>
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="fbafec0bd8b6d8dd89ea060933b4b9a00df73c8e" resname="La date de fin de mise en ligne doit être superieur à la date de début">
<source>La date de fin de mise en ligne doit être superieur à la date de début</source>
<target state="new">La date de fin de mise en ligne doit être superieur à la date de début</target>
</trans-unit>
<trans-unit id="f48ccf84018671218aac090abf90770212497b70" resname="fos_user.email.already_used">
<source>fos_user.email.already_used</source>
<target state="new">fos_user.email.already_used</target>
</trans-unit>
<trans-unit id="d0e28536be754aebc7ef73cdc6cf0d729311ce1d" resname="fos_user.email.blank">
<source>fos_user.email.blank</source>
<target state="new">fos_user.email.blank</target>
</trans-unit>
<trans-unit id="17a097b4a496b3378a290ea4f8a05bc2a7879142" resname="fos_user.email.invalid">
<source>fos_user.email.invalid</source>
<target state="new">fos_user.email.invalid</target>
</trans-unit>
<trans-unit id="9760d0f9c28fee7f91e5cad9e282921b13cd2f0b" resname="fos_user.email.long">
<source>fos_user.email.long</source>
<target state="new">fos_user.email.long</target>
</trans-unit>
<trans-unit id="1a1b926521b2b3010b91de1787f9265b3d6a97ae" resname="fos_user.email.short">
<source>fos_user.email.short</source>
<target state="new">fos_user.email.short</target>
</trans-unit>
<trans-unit id="1df43a6e24af03c39d20b2f1f5cbefdef7b30416" resname="fos_user.password.blank">
<source>fos_user.password.blank</source>
<target state="new">fos_user.password.blank</target>
</trans-unit>
<trans-unit id="4b3130df261ac66147653997d2d83952a330faac" resname="fos_user.password.short">
<source>fos_user.password.short</source>
<target state="new">fos_user.password.short</target>
</trans-unit>
<trans-unit id="77c8ec07f205976bbed1a3ce90fdc458891bb81d" resname="fos_user.username.already_used">
<source>fos_user.username.already_used</source>
<target state="new">fos_user.username.already_used</target>
</trans-unit>
<trans-unit id="312a20b0239a4236f4b08e4e0ed35153a03667d0" resname="fos_user.username.blank">
<source>fos_user.username.blank</source>
<target state="new">fos_user.username.blank</target>
</trans-unit>
<trans-unit id="56ef686ed0b86d02dd4077e0796a4f1e61377552" resname="fos_user.username.long">
<source>fos_user.username.long</source>
<target state="new">fos_user.username.long</target>
</trans-unit>
<trans-unit id="920e8d37f8a7c923ece7d123d55668ac522d612d" resname="fos_user.username.short">
<source>fos_user.username.short</source>
<target state="new">fos_user.username.short</target>
</trans-unit>
</body>
</file>
</xliff>
+31 -29
View File
@@ -16,42 +16,44 @@
{% block content %}
{{ form_start(form) }}
<div class="row">
<div class="col-xs-8">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">{{ ad.title }}</h3>
</div>
<div class="box-body">
{{ form_errors(form) }}
{{ form_row(form.reference) }}
{{ form_row(form.title) }}
{{ form_row(form.location) }}
{{ form_row(form.location_gmap) }}
{{ form_row(form.description) }}
{{ form_row(form.publicTag) }}
<div class="col-xs-12">
<div class="row">
<div class="col-xs-8">
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">{{ ad.title }}</h3>
</div>
<div class="box-body">
{{ form_errors(form) }}
{{ form_row(form.reference) }}
{{ form_row(form.title) }}
{{ form_row(form.location) }}
{{ form_row(form.location_gmap) }}
{{ form_row(form.description) }}
{{ form_row(form.publicTag) }}
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title">Informations</h3>
</div>
<div class="box-body">
{{ form_row(form.status) }}
{{ form_row(form.isVerified) }}
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title">Informations</h3>
</div>
<div class="box-body">
{{ form_row(form.status) }}
{{ form_row(form.isVerified) }}
</div>
<div class="row">
<div class="col-xs-12">
<button class="btn btn-success" type="submit">Enregistrer</button>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<button class="btn btn-success" type="submit">Enregistrer</button>
</div>
</div>
{{ form_end(form) }}
{% endblock %}
@@ -16,7 +16,7 @@
<li><a href="{{ path('talent_profile') }}">{{ 'profile.talent.title'|trans }}</a></li>
<li><a href="{{ path('talent_ad_space') }}">Espace offre d'emploi</a></li>
<li><a href="{{ path('talent_media') }}">{{'company.menu.videotheque.label'|trans}}</a></li>
<li><a href="{{ path('talent_ad_bookmark_list') }}">Mes favoris</a></li>
<li><a href="{{ path('talent_ad_bookmark_list') }}">{{ 'company.menu.bookmark.label'|trans }}</a></li>
<!--<li><a href="{{ path('talent_my_searches') }}">Mes recherches</a></li>-->
{#<li><a href="#">Conseils</a></li>#}
{#<li><a href="#">FAQ</a></li>#}
+22 -1
View File
@@ -169,4 +169,25 @@ monolog:
syslog_debug:
level: debug
type: stream
path: '%kernel.logs_dir%/%kernel.environment%_debug.log'
path: '%kernel.logs_dir%/%kernel.environment%_debug.log'
# I18N
jms_i18n_routing:
default_locale: fr
locales: [en, fr]
strategy: prefix_except_default
jms_translation:
configs:
app:
dirs: [%kernel.root_dir%, %kernel.root_dir%/../src]
output_dir: %kernel.root_dir%/Resources/translations
ignored_domains: [routes]
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs]
extractors: [jms_i18n_routing]
jms_di_extra:
locations:
all_bundles: true
# bundles: [AppBundle]
# directories: ["%kernel.root_dir%/../src"]
+10 -1
View File
@@ -7,4 +7,13 @@ app:
type: annotation
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.xml"
resource: "@LiipImagineBundle/Resources/config/routing.xml"
#app:
# prefix : /{_locale}
# resource: "@AppBundle/Controller/"
# type: annotation
# defaults: { _locale: fr}
# requirements:
# _locale: fr|en
+5
View File
@@ -13,3 +13,8 @@ _errors:
_main:
resource: routing.yml
JMSTranslationBundle_ui:
resource: "@JMSTranslationBundle/Controller/"
type: annotation
prefix: /_trans
+14 -12
View File
@@ -11,28 +11,30 @@ security:
security: false
main:
pattern: ^/
pattern: ^/|(en)/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
success_handler: redirect.after.login
check_path: fos_user_security_check
# logout: true
logout:
handlers: ['edeclic.prestashop.logout']
path: fos_user_security_logout
anonymous: true
access_control:
- { path: ^/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, roles: ROLE_ADMIN }
- { path: ^/admin/moderation/, role: [ROLE_MODERATOR,ROLE_SUPER_ADMIN, ROLE_WEBMASTER] }
- { path: ^/admin/config/, role: [ROLE_WEBMASTER,ROLE_SUPER_ADMIN] }
- { path: ^/talent/me/, roles: ROLE_TALENT }
- { path: ^/talent/recherche/, roles: ROLE_COMPANY }
#- { path: ^/talent/(.+)/, roles: ROLE_COMPANY }
- { path: ^/entreprise/me/, roles: ROLE_COMPANY }
- { path: ^/annonce/(.+)/repondre, roles: ROLE_TALENT }
- { path: ^/[^/]+/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/[^/]+/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/[^/]+/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/[^/]+/admin/, roles: ROLE_ADMIN }
- { path: ^/[^/]+/admin/moderation/, role: [ROLE_MODERATOR,ROLE_SUPER_ADMIN, ROLE_WEBMASTER] }
- { path: ^/[^/]+/admin/config/, role: [ROLE_WEBMASTER,ROLE_SUPER_ADMIN] }
- { path: ^/[^/]+/talent/me/, roles: ROLE_TALENT }
- { path: ^/[^/]+/talent/recherche/, roles: ROLE_COMPANY }
#- { path: ^/[^/]+/talent/(.+)/, roles: ROLE_COMPANY }
- { path: ^/[^/]+/entreprise/me/, roles: ROLE_COMPANY }
- { path: ^/[^/]+/annonce/(.+)/repondre, roles: ROLE_TALENT }
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
+5
View File
@@ -35,6 +35,11 @@ services:
tags:
- { name: twig.extension }
twig.text_extension:
class: Twig_Extensions_Extension_Text
tags:
- name: twig.extension
# Listeners
user.registration_listener:
class: AppBundle\Utils\EventListener\RegistrationListener
+2 -1
View File
@@ -43,7 +43,8 @@
"requestlab/vimeo-bundle": "^0.0.3",
"vimeo/vimeo-api": "^1.1",
"pulse00/ffmpeg-bundle": "^0.6.0",
"doctrine/doctrine-migrations-bundle": "^1.0"
"doctrine/doctrine-migrations-bundle": "^1.0",
"jms/translation-bundle": "^1.3"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
+450 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "28aab85bf0baca286ec58cdb48a380b5",
"content-hash": "f8f763856a091480267c08f90ca61a8c",
"packages": [
{
"name": "alcaeus/mongo-php-adapter",
@@ -1551,6 +1551,291 @@
],
"time": "2014-01-12T16:20:24+00:00"
},
{
"name": "jms/aop-bundle",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSAopBundle.git",
"reference": "78000d007e74283cc564a58e184d7f62548ad394"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSAopBundle/zipball/78000d007e74283cc564a58e184d7f62548ad394",
"reference": "78000d007e74283cc564a58e184d7f62548ad394",
"shasum": ""
},
"require": {
"jms/cg": "^1.1",
"php": ">=5.3.9",
"symfony/framework-bundle": "^2.3|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^2.7"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"JMS\\AopBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Adds AOP capabilities to Symfony2",
"keywords": [
"annotations",
"aop"
],
"time": "2015-12-09T16:30:46+00:00"
},
{
"name": "jms/cg",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/cg-library.git",
"reference": "2152ea2c48f746a676debb841644ae64cae27835"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/cg-library/zipball/2152ea2c48f746a676debb841644ae64cae27835",
"reference": "2152ea2c48f746a676debb841644ae64cae27835",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-0": {
"CG\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Toolset for generating PHP code",
"keywords": [
"code generation"
],
"time": "2016-04-07T10:21:44+00:00"
},
{
"name": "jms/di-extra-bundle",
"version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSDiExtraBundle.git",
"reference": "bd261ce117608be02533b901b07c5366997c5846"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSDiExtraBundle/zipball/bd261ce117608be02533b901b07c5366997c5846",
"reference": "bd261ce117608be02533b901b07c5366997c5846",
"shasum": ""
},
"require": {
"jms/aop-bundle": "~1.1",
"jms/metadata": "~1.0",
"php": "~5.3|~7.0",
"symfony/dependency-injection": "~2.3|~3.0",
"symfony/finder": "~2.3|~3.0",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/http-kernel": "^2.3.24|~3.0",
"symfony/process": "~2.3|~3.0",
"symfony/routing": "~2.3|~3.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "~1.5",
"doctrine/orm": "~2.3",
"jms/security-extra-bundle": "~1.0",
"phpcollection/phpcollection": ">=0.2,<0.3-dev",
"sensio/framework-extra-bundle": "~2.0|~3.0",
"symfony/browser-kit": "~2.3|~3.0",
"symfony/class-loader": "~2.3|~3.0",
"symfony/expression-language": "~2.6|~3.0",
"symfony/form": "~2.3|~3.0",
"symfony/phpunit-bridge": "~2.7",
"symfony/security-bundle": "~2.3",
"symfony/twig-bundle": "~2.3|~3.0",
"symfony/validator": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"autoload": {
"psr-4": {
"JMS\\DiExtraBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Allows to configure dependency injection using annotations",
"homepage": "http://jmsyst.com/bundles/JMSDiExtraBundle",
"keywords": [
"annotations",
"dependency injection"
],
"time": "2017-05-31T11:52:22+00:00"
},
{
"name": "jms/metadata",
"version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/metadata.git",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/cache": "~1.0",
"symfony/cache": "~3.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Metadata\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Class/method/property metadata management in PHP",
"keywords": [
"annotations",
"metadata",
"xml",
"yaml"
],
"time": "2016-12-05T10:18:33+00:00"
},
{
"name": "jms/translation-bundle",
"version": "1.3.2",
"target-dir": "JMS/TranslationBundle",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSTranslationBundle.git",
"reference": "08b8db92aa376b8e50ce4e779e849916abffd805"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSTranslationBundle/zipball/08b8db92aa376b8e50ce4e779e849916abffd805",
"reference": "08b8db92aa376b8e50ce4e779e849916abffd805",
"shasum": ""
},
"require": {
"nikic/php-parser": "^1.4 || ^2.0 || ^3.0",
"php": "^5.3.3 || ^7.0",
"symfony/console": "^2.3 || ^3.0",
"symfony/framework-bundle": "^2.3 || ^3.0",
"twig/twig": "^1.27 || ^2.0"
},
"require-dev": {
"jms/di-extra-bundle": "^1.1",
"matthiasnoback/symfony-dependency-injection-test": "^0.7.6",
"nyholm/nsa": "^1.0.1",
"phpunit/phpunit": "4.8.27",
"psr/log": "^1.0",
"sensio/framework-extra-bundle": "^2.3 || ^3.0",
"symfony/expression-language": "^2.6 || ^3.0",
"symfony/symfony": "^2.3 || ^3.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-0": {
"JMS\\TranslationBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Puts the Symfony Translation Component on steroids",
"homepage": "http://jmsyst.com/bundles/JMSTranslationBundle",
"keywords": [
"extract",
"extraction",
"i18n",
"interface",
"multilanguage",
"translation",
"ui",
"webinterface"
],
"time": "2017-04-20T19:44:02+00:00"
},
{
"name": "mongodb/mongodb",
"version": "1.1.2",
@@ -1727,6 +2012,57 @@
"description": "Symfony filesystem extension to handle temporary files",
"time": "2016-03-05T10:22:50+00:00"
},
{
"name": "nikic/php-parser",
"version": "v3.0.6",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0808939f81c1347a3c8a82a5925385a08074b0f1",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2017-06-28T20:53:48+00:00"
},
{
"name": "ocramius/package-versions",
"version": "1.1.2",
@@ -3410,6 +3746,63 @@
],
"time": "2015-09-19T16:54:05+00:00"
},
{
"name": "jms/i18n-routing-bundle",
"version": "2.0.1",
"target-dir": "JMS/I18nRoutingBundle",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSI18nRoutingBundle.git",
"reference": "dc80158b793c3cad8008deb4dbee835291e94643"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSI18nRoutingBundle/zipball/dc80158b793c3cad8008deb4dbee835291e94643",
"reference": "dc80158b793c3cad8008deb4dbee835291e94643",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/framework-bundle": "~2.3|~3.0"
},
"require-dev": {
"jms/di-extra-bundle": "~1.1",
"phpunit/phpunit": "~4",
"sensio/framework-extra-bundle": "*",
"symfony/symfony": "~2.3|~3.0"
},
"suggest": {
"jms/translation-bundle": "If you want to use the RouteTranslation extractor"
},
"type": "symfony-bundle",
"autoload": {
"psr-0": {
"JMS\\I18nRoutingBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Albert Casademont",
"email": "albertcasademont@gmail.com"
}
],
"description": "This bundle allows you to create i18n routes. Fork of the jms/i18n-routing-bundle",
"homepage": "http://jmsyst.com/bundles/JMSI18nRoutingBundle",
"keywords": [
"multilanguage",
"routing",
"translation"
],
"time": "2017-06-25T10:46:29+00:00"
},
{
"name": "kriswallsmith/assetic",
"version": "v1.4.0",
@@ -3829,6 +4222,62 @@
"description": "Symfony PHPUnit Bridge",
"homepage": "https://symfony.com",
"time": "2017-03-09T12:58:16+00:00"
},
{
"name": "twig/extensions",
"version": "v1.5.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig-extensions.git",
"reference": "d188c76168b853481cc75879ea045bf93d718e9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/d188c76168b853481cc75879ea045bf93d718e9c",
"reference": "d188c76168b853481cc75879ea045bf93d718e9c",
"shasum": ""
},
"require": {
"twig/twig": "~1.27|~2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
"symfony/translation": "~2.3|~3.0"
},
"suggest": {
"symfony/translation": "Allow the time_diff output to be translated"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-0": {
"Twig_Extensions_": "lib/"
},
"psr-4": {
"Twig\\Extensions\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Common additional features for Twig that do not directly belong in core",
"homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
"keywords": [
"i18n",
"text"
],
"time": "2017-06-08T18:19:53+00:00"
}
],
"aliases": [],
+14 -19
View File
@@ -39,20 +39,20 @@ class AdType extends AbstractType
$builder
->add('reference', TextType::class, array(
'label' => 'Référence de l\'annonce',
'label' => 'ad.reference',
'attr' => array(
'placeholder' => 'Indiquer une référence'
'placeholder' => 'ad.reference.p'
)
))
->add('title', TextType::class, array(
'label' => 'Titre de l\'annonce',
'label' => 'ad.title',
'attr' => array(
'placeholder' => 'Indiquer un titre'
'placeholder' => 'ad.title.p'
)
))
->add('location_gmap', TextType::class, array(
'mapped' => false,
'label' => 'Localisation de l\'annonce',
'label' => 'ad.location',
'attr' => array(
'value' => $location_gmap
)
@@ -61,32 +61,27 @@ class AdType extends AbstractType
'data' => $location,
))
->add('description', TextareaType::class, array(
'label' => 'Description de l\'annonce',
'label' => 'ad.desc',
'attr' => array(
'class' => 'materialize-textarea',
'placeholder' => 'Décrire votre annonce'
'placeholder' => 'ad.desc.p'
)
))
->add('contract_type', ChoiceType::class, array(
'mapped' => false,
'label' => 'Type de contrat',
'label' => 'ad.contract_type',
'data' => $contract_type,
'choices' => array(
'CDI' => 'CDI',
'CDD' => 'CDD',
'Apprentissage' => 'Apprentissage',
'Professionalisation' => 'Professionalisation',
'Stage' => 'Stage'
'contract_type.cdi' => 'CDI',
'contract_type.cdd' => 'CDD',
'contract_type.apprentissage' => 'Apprentissage',
'contract_type.professionalisation' => 'Professionalisation',
'contract_type.stage' => 'Stage'
)
))
->add('publicTag', TextType::class, array(
'label' => 'profile.company.tags',
'label' => 'ad.tags',
'data' => $publicTags,
));
// ->add('privateTag', TextType::class, array(
// 'label' => 'private Tags',
// 'data' => $privateTags
// ));
}
}
+22 -16
View File
@@ -31,20 +31,23 @@ class AdType extends AbstractType
$builder
->add('reference', TextType::class, array(
'label' => 'Référence de l\'annonce',
'label' => 'ad.reference',
'attr' => array(
'placeholder' => 'Indiquer une référence'
/** @Desc("indiquez une référence") */
'placeholder' => 'ad.reference.p'
)
))
->add('title', TextType::class, array(
'label' => 'Titre de l\'annonce',
'label' => 'ad.title',
'attr' => array(
'placeholder' => 'Indiquer un titre'
/** @Desc("indiquez un titre") */
'placeholder' => 'ad.title.p'
)
))
->add('location_gmap', TextType::class, array(
'mapped' => false,
'label' => 'Localisation de l\'annonce',
/** @Desc("Localisation de l'annonce") */
'label' => 'ad.location',
'attr' => array(
'value' => $location_gmap
)
@@ -53,29 +56,32 @@ class AdType extends AbstractType
'data' => $location,
))
->add('description', TextareaType::class, array(
'label' => 'Description de l\'annonce',
/** @Desc("Description de l'annonce") */
'label' => 'ad.desc',
'attr' => array(
'placeholder' => 'Décrire votre annonce'
/** @Desc("Décrire votre annonce") */
'placeholder' => 'ad.desc.p'
)
))
->add('publicTag', TextType::class, array(
'label' => 'Tags de l\'annonce (séparés par une virgules)',
/** @Desc("TTags : merci de séparer vos mots clés par une virgule") */
'label' => 'ad.tags',
'data' => $publicTags,
))
->add('status', ChoiceType::class, array(
'label' =>'Status',
'label' => 'Status',
'choices' => array(
'Brouillon' => 'DRAFT',
'A publier' => 'TO_PUBLISH',
'Validée' => 'VALIDATED',
'Publiée' => 'PUBLISHED',
'Fermée' => 'CLOSED',
'Expirée' => 'EXPIRED',
'status.draft' => 'DRAFT',
'status.to_publish' => 'TO_PUBLISH',
'status.validated' => 'VALIDATED',
'status.published' => 'PUBLISHED',
'status.closed' => 'CLOSED',
'status.expired' => 'EXPIRED',
)
))
->add('isVerified', CheckboxType::class, array(
'label' => 'rifiée',
'label' => 'ad.verified',
'required' => false
));
+1
View File
@@ -0,0 +1 @@
../nikic/php-parser/bin/php-parse
+5
View File
@@ -6,12 +6,16 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Twig_Extensions_' => array($vendorDir . '/twig/extensions/lib'),
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'SensioLabs\\Security' => array($vendorDir . '/sensiolabs/security-checker'),
'RequestLab\\VimeoBundle' => array($vendorDir . '/requestlab/vimeo-bundle'),
'ProxyManager\\' => array($vendorDir . '/ocramius/proxy-manager/src'),
'Neutron' => array($vendorDir . '/neutron/temporary-filesystem/src'),
'Mongo' => array($vendorDir . '/alcaeus/mongo-php-adapter/lib/Mongo'),
'Metadata\\' => array($vendorDir . '/jms/metadata/src'),
'JMS\\TranslationBundle' => array($vendorDir . '/jms/translation-bundle'),
'JMS\\I18nRoutingBundle' => array($vendorDir . '/jms/i18n-routing-bundle'),
'Imagine' => array($vendorDir . '/imagine/imagine/lib'),
'FFMpeg' => array($vendorDir . '/php-ffmpeg/php-ffmpeg/src'),
'Evenement' => array($vendorDir . '/evenement/evenement/src'),
@@ -21,6 +25,7 @@ return array(
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
'CG\\' => array($vendorDir . '/jms/cg/src'),
'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
'Alom' => array($vendorDir . '/alom/graphviz/src'),
'Alex\\DoctrineExtraBundle' => array($vendorDir . '/alexandresalome/doctrine-extra-bundle'),
+4
View File
@@ -9,6 +9,7 @@ return array(
'Zend\\EventManager\\' => array($vendorDir . '/zendframework/zend-eventmanager/src'),
'Zend\\Code\\' => array($vendorDir . '/zendframework/zend-code/src'),
'Vimeo\\' => array($vendorDir . '/vimeo/vimeo-api/src/Vimeo'),
'Twig\\Extensions\\' => array($vendorDir . '/twig/extensions/src'),
'Tests\\' => array($baseDir . '/tests'),
'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'),
'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'),
@@ -30,10 +31,13 @@ return array(
'Sensio\\Bundle\\DistributionBundle\\' => array($vendorDir . '/sensio/distribution-bundle'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'PackageVersions\\' => array($vendorDir . '/ocramius/package-versions/src/PackageVersions'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'MongoDB\\' => array($vendorDir . '/mongodb/mongodb/src'),
'Liip\\ImagineBundle\\' => array($vendorDir . '/liip/imagine-bundle'),
'JMS\\DiExtraBundle\\' => array($vendorDir . '/jms/di-extra-bundle'),
'JMS\\AopBundle\\' => array($vendorDir . '/jms/aop-bundle'),
'Incenteev\\ParameterHandler\\' => array($vendorDir . '/incenteev/composer-parameter-handler'),
'FOS\\UserBundle\\' => array($vendorDir . '/friendsofsymfony/user-bundle'),
'FOS\\ElasticaBundle\\' => array($vendorDir . '/friendsofsymfony/elastica-bundle'),
+49
View File
@@ -32,6 +32,7 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
),
'T' =>
array (
'Twig\\Extensions\\' => 16,
'Tests\\' => 6,
),
'S' =>
@@ -59,6 +60,7 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
'Psr\\Log\\' => 8,
'Psr\\Cache\\' => 10,
'PhpParser\\' => 10,
'PackageVersions\\' => 16,
),
'M' =>
@@ -70,6 +72,11 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
'Liip\\ImagineBundle\\' => 19,
),
'J' =>
array (
'JMS\\DiExtraBundle\\' => 18,
'JMS\\AopBundle\\' => 14,
),
'I' =>
array (
'Incenteev\\ParameterHandler\\' => 27,
@@ -117,6 +124,10 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
0 => __DIR__ . '/..' . '/vimeo/vimeo-api/src/Vimeo',
),
'Twig\\Extensions\\' =>
array (
0 => __DIR__ . '/..' . '/twig/extensions/src',
),
'Tests\\' =>
array (
0 => __DIR__ . '/../..' . '/tests',
@@ -201,6 +212,10 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
0 => __DIR__ . '/..' . '/psr/cache/src',
),
'PhpParser\\' =>
array (
0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser',
),
'PackageVersions\\' =>
array (
0 => __DIR__ . '/..' . '/ocramius/package-versions/src/PackageVersions',
@@ -217,6 +232,14 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
0 => __DIR__ . '/..' . '/liip/imagine-bundle',
),
'JMS\\DiExtraBundle\\' =>
array (
0 => __DIR__ . '/..' . '/jms/di-extra-bundle',
),
'JMS\\AopBundle\\' =>
array (
0 => __DIR__ . '/..' . '/jms/aop-bundle',
),
'Incenteev\\ParameterHandler\\' =>
array (
0 => __DIR__ . '/..' . '/incenteev/composer-parameter-handler',
@@ -294,6 +317,10 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
public static $prefixesPsr0 = array (
'T' =>
array (
'Twig_Extensions_' =>
array (
0 => __DIR__ . '/..' . '/twig/extensions/lib',
),
'Twig_' =>
array (
0 => __DIR__ . '/..' . '/twig/twig/lib',
@@ -333,6 +360,21 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
array (
0 => __DIR__ . '/..' . '/alcaeus/mongo-php-adapter/lib/Mongo',
),
'Metadata\\' =>
array (
0 => __DIR__ . '/..' . '/jms/metadata/src',
),
),
'J' =>
array (
'JMS\\TranslationBundle' =>
array (
0 => __DIR__ . '/..' . '/jms/translation-bundle',
),
'JMS\\I18nRoutingBundle' =>
array (
0 => __DIR__ . '/..' . '/jms/i18n-routing-bundle',
),
),
'I' =>
array (
@@ -382,6 +424,13 @@ class ComposerStaticInit1b32d02bd8fea2d524bf79b36ada5830
0 => __DIR__ . '/..' . '/doctrine/collections/lib',
),
),
'C' =>
array (
'CG\\' =>
array (
0 => __DIR__ . '/..' . '/jms/cg/src',
),
),
'A' =>
array (
'Assetic' =>
+465
View File
@@ -3942,5 +3942,470 @@
"migrations",
"schema"
]
},
{
"name": "jms/i18n-routing-bundle",
"version": "2.0.1",
"version_normalized": "2.0.1.0",
"target-dir": "JMS/I18nRoutingBundle",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSI18nRoutingBundle.git",
"reference": "dc80158b793c3cad8008deb4dbee835291e94643"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSI18nRoutingBundle/zipball/dc80158b793c3cad8008deb4dbee835291e94643",
"reference": "dc80158b793c3cad8008deb4dbee835291e94643",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/framework-bundle": "~2.3|~3.0"
},
"require-dev": {
"jms/di-extra-bundle": "~1.1",
"phpunit/phpunit": "~4",
"sensio/framework-extra-bundle": "*",
"symfony/symfony": "~2.3|~3.0"
},
"suggest": {
"jms/translation-bundle": "If you want to use the RouteTranslation extractor"
},
"time": "2017-06-25T10:46:29+00:00",
"type": "symfony-bundle",
"installation-source": "dist",
"autoload": {
"psr-0": {
"JMS\\I18nRoutingBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Albert Casademont",
"email": "albertcasademont@gmail.com"
}
],
"description": "This bundle allows you to create i18n routes. Fork of the jms/i18n-routing-bundle",
"homepage": "http://jmsyst.com/bundles/JMSI18nRoutingBundle",
"keywords": [
"multilanguage",
"routing",
"translation"
]
},
{
"name": "nikic/php-parser",
"version": "v3.0.6",
"version_normalized": "3.0.6.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0808939f81c1347a3c8a82a5925385a08074b0f1",
"reference": "0808939f81c1347a3c8a82a5925385a08074b0f1",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
},
"time": "2017-06-28T20:53:48+00:00",
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
]
},
{
"name": "jms/translation-bundle",
"version": "1.3.2",
"version_normalized": "1.3.2.0",
"target-dir": "JMS/TranslationBundle",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSTranslationBundle.git",
"reference": "08b8db92aa376b8e50ce4e779e849916abffd805"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSTranslationBundle/zipball/08b8db92aa376b8e50ce4e779e849916abffd805",
"reference": "08b8db92aa376b8e50ce4e779e849916abffd805",
"shasum": ""
},
"require": {
"nikic/php-parser": "^1.4 || ^2.0 || ^3.0",
"php": "^5.3.3 || ^7.0",
"symfony/console": "^2.3 || ^3.0",
"symfony/framework-bundle": "^2.3 || ^3.0",
"twig/twig": "^1.27 || ^2.0"
},
"require-dev": {
"jms/di-extra-bundle": "^1.1",
"matthiasnoback/symfony-dependency-injection-test": "^0.7.6",
"nyholm/nsa": "^1.0.1",
"phpunit/phpunit": "4.8.27",
"psr/log": "^1.0",
"sensio/framework-extra-bundle": "^2.3 || ^3.0",
"symfony/expression-language": "^2.6 || ^3.0",
"symfony/symfony": "^2.3 || ^3.0"
},
"time": "2017-04-20T19:44:02+00:00",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"JMS\\TranslationBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Puts the Symfony Translation Component on steroids",
"homepage": "http://jmsyst.com/bundles/JMSTranslationBundle",
"keywords": [
"extract",
"extraction",
"i18n",
"interface",
"multilanguage",
"translation",
"ui",
"webinterface"
]
},
{
"name": "twig/extensions",
"version": "v1.5.1",
"version_normalized": "1.5.1.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig-extensions.git",
"reference": "d188c76168b853481cc75879ea045bf93d718e9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/d188c76168b853481cc75879ea045bf93d718e9c",
"reference": "d188c76168b853481cc75879ea045bf93d718e9c",
"shasum": ""
},
"require": {
"twig/twig": "~1.27|~2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
"symfony/translation": "~2.3|~3.0"
},
"suggest": {
"symfony/translation": "Allow the time_diff output to be translated"
},
"time": "2017-06-08T18:19:53+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Twig_Extensions_": "lib/"
},
"psr-4": {
"Twig\\Extensions\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Common additional features for Twig that do not directly belong in core",
"homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
"keywords": [
"i18n",
"text"
]
},
{
"name": "jms/metadata",
"version": "1.6.0",
"version_normalized": "1.6.0.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/metadata.git",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab",
"reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"doctrine/cache": "~1.0",
"symfony/cache": "~3.1"
},
"time": "2016-12-05T10:18:33+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Metadata\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Class/method/property metadata management in PHP",
"keywords": [
"annotations",
"metadata",
"xml",
"yaml"
]
},
{
"name": "jms/cg",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/cg-library.git",
"reference": "2152ea2c48f746a676debb841644ae64cae27835"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/cg-library/zipball/2152ea2c48f746a676debb841644ae64cae27835",
"reference": "2152ea2c48f746a676debb841644ae64cae27835",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.5"
},
"time": "2016-04-07T10:21:44+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"CG\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Toolset for generating PHP code",
"keywords": [
"code generation"
]
},
{
"name": "jms/aop-bundle",
"version": "1.2.0",
"version_normalized": "1.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSAopBundle.git",
"reference": "78000d007e74283cc564a58e184d7f62548ad394"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSAopBundle/zipball/78000d007e74283cc564a58e184d7f62548ad394",
"reference": "78000d007e74283cc564a58e184d7f62548ad394",
"shasum": ""
},
"require": {
"jms/cg": "^1.1",
"php": ">=5.3.9",
"symfony/framework-bundle": "^2.3|^3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^2.7"
},
"time": "2015-12-09T16:30:46+00:00",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"JMS\\AopBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Adds AOP capabilities to Symfony2",
"keywords": [
"annotations",
"aop"
]
},
{
"name": "jms/di-extra-bundle",
"version": "1.8.2",
"version_normalized": "1.8.2.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/JMSDiExtraBundle.git",
"reference": "bd261ce117608be02533b901b07c5366997c5846"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/JMSDiExtraBundle/zipball/bd261ce117608be02533b901b07c5366997c5846",
"reference": "bd261ce117608be02533b901b07c5366997c5846",
"shasum": ""
},
"require": {
"jms/aop-bundle": "~1.1",
"jms/metadata": "~1.0",
"php": "~5.3|~7.0",
"symfony/dependency-injection": "~2.3|~3.0",
"symfony/finder": "~2.3|~3.0",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/http-kernel": "^2.3.24|~3.0",
"symfony/process": "~2.3|~3.0",
"symfony/routing": "~2.3|~3.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "~1.5",
"doctrine/orm": "~2.3",
"jms/security-extra-bundle": "~1.0",
"phpcollection/phpcollection": ">=0.2,<0.3-dev",
"sensio/framework-extra-bundle": "~2.0|~3.0",
"symfony/browser-kit": "~2.3|~3.0",
"symfony/class-loader": "~2.3|~3.0",
"symfony/expression-language": "~2.6|~3.0",
"symfony/form": "~2.3|~3.0",
"symfony/phpunit-bridge": "~2.7",
"symfony/security-bundle": "~2.3",
"symfony/twig-bundle": "~2.3|~3.0",
"symfony/validator": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0"
},
"time": "2017-05-31T11:52:22+00:00",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.8-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"JMS\\DiExtraBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Allows to configure dependency injection using annotations",
"homepage": "http://jmsyst.com/bundles/JMSDiExtraBundle",
"keywords": [
"annotations",
"dependency injection"
]
}
]
+2
View File
@@ -0,0 +1,2 @@
vendor
composer.lock
+31
View File
@@ -0,0 +1,31 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
include:
- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
- php: 5.6
env: SYMFONY_VERSION='2.7.*'
- php: 5.6
env: SYMFONY_VERSION='2.8.*'
before_install:
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi
install: composer update $COMPOSER_FLAGS
script: phpunit
+62
View File
@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Aop;
use CG\Proxy\InterceptorLoaderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Lazy-loading interceptor loader implementation.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class InterceptorLoader implements InterceptorLoaderInterface
{
private $container;
private $interceptors;
private $loadedInterceptors = array();
/**
* @param ContainerInterface $container
* @param array<array<string>> $interceptors
*/
public function __construct(ContainerInterface $container, array $interceptors)
{
$this->container = $container;
$this->interceptors = $interceptors;
}
public function loadInterceptors(\ReflectionMethod $method)
{
if (!isset($this->interceptors[$method->class][$method->name])) {
return array();
}
if (isset($this->loadedInterceptors[$method->class][$method->name])) {
return $this->loadedInterceptors[$method->class][$method->name];
}
$interceptors = array();
foreach ($this->interceptors[$method->class][$method->name] as $id) {
$interceptors[] = $this->container->get($id);
}
return $this->loadedInterceptors[$method->class][$method->name] = $interceptors;
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Aop;
final class PointcutContainer
{
private $pointcuts;
/**
* @param array<PointcutInterface> $pointcuts
*/
public function __construct(array $pointcuts)
{
$this->pointcuts = $pointcuts;
}
public function getPointcuts()
{
return $this->pointcuts;
}
}
+54
View File
@@ -0,0 +1,54 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Aop;
/**
* Pointcut Interface.
*
* Implementations of this class are responsible for making a decision on whether
* a certain method call matches the advice which is associated with this pointcut.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface PointcutInterface
{
/**
* Determines whether the advice applies to instances of the given class.
*
* There are some limits as to what you can do in this method. Namely, you may
* only base your decision on resources that are part of the ContainerBuilder.
* Specifically, you may not use any data in the class itself, such as
* annotations.
*
* @param \ReflectionClass $class
* @return boolean
*/
public function matchesClass(\ReflectionClass $class);
/**
* Determines whether the advice applies to the given method.
*
* This method is not limited in the way the matchesClass method is. It may
* use information in the associated class to make its decision.
*
* @param \ReflectionMethod $method
* @return boolean
*/
public function matchesMethod(\ReflectionMethod $method);
}
+49
View File
@@ -0,0 +1,49 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Aop;
/**
* A regex pointcut implementation.
*
* Uses a regular expression for determining whether the pointcut matches.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class RegexPointcut implements PointcutInterface
{
private $pattern;
/**
* @param array<string> $pattern
*/
public function __construct($pattern)
{
$this->pattern = $pattern;
}
public function matchesClass(\ReflectionClass $class)
{
return true;
}
public function matchesMethod(\ReflectionMethod $method)
{
return 0 < preg_match('#'.$this->pattern.'#', sprintf('%s::%s', $method->class, $method->name));
}
}
@@ -0,0 +1,244 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\DependencyInjection\Compiler;
use CG\Core\ClassUtils;
use CG\Core\DefaultNamingStrategy;
use CG\Generator\RelativePath;
use JMS\AopBundle\Exception\RuntimeException;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\Reference;
use CG\Proxy\Enhancer;
use CG\Proxy\InterceptionGenerator;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use JMS\AopBundle\Aop\PointcutInterface;
use CG\Core\ReflectionUtils;
/**
* Matches pointcuts against service methods.
*
* This pass will collect the advices that match a certain method, and then
* generate proxy classes where necessary.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class PointcutMatchingPass implements CompilerPassInterface
{
private $pointcuts;
private $cacheDir;
private $container;
/**
* @param array<PointcutInterface> $pointcuts
*/
public function __construct(array $pointcuts = null)
{
$this->pointcuts = $pointcuts;
}
public function process(ContainerBuilder $container)
{
$this->container = $container;
$this->cacheDir = $container->getParameter('jms_aop.cache_dir').'/proxies';
$pointcuts = $this->getPointcuts();
$interceptors = array();
foreach ($container->getDefinitions() as $id => $definition) {
$this->processDefinition($definition, $pointcuts, $interceptors);
$this->processInlineDefinitions($pointcuts, $interceptors, $definition->getArguments());
$this->processInlineDefinitions($pointcuts, $interceptors, $definition->getMethodCalls());
$this->processInlineDefinitions($pointcuts, $interceptors, $definition->getProperties());
}
$container
->getDefinition('jms_aop.interceptor_loader')
->addArgument($interceptors)
;
}
/**
* @param array<PointcutInterface> $pointcuts
* @param array<string,string> $interceptors
*/
private function processInlineDefinitions($pointcuts, &$interceptors, array $a)
{
foreach ($a as $k => $v) {
if ($v instanceof Definition) {
$this->processDefinition($v, $pointcuts, $interceptors);
} elseif (is_array($v)) {
$this->processInlineDefinitions($pointcuts, $interceptors, $v);
}
}
}
/**
* @param array<PointcutInterface> $pointcuts
* @param array<string,string> $interceptors
*/
private function processDefinition(Definition $definition, $pointcuts, &$interceptors)
{
if ($definition->isSynthetic()) {
return;
}
// Symfony 2.6 getFactory method
// TODO: Use only getFactory when bumping require to Symfony >= 2.6
if (method_exists($definition, 'getFactory') && $definition->getFactory()) {
return;
}
if (!method_exists($definition, 'getFactory') && ($definition->getFactoryService() || $definition->getFactoryClass())) {
return;
}
if ($originalFilename = $definition->getFile()) {
require_once $originalFilename;
}
if (!class_exists($definition->getClass())) {
return;
}
$class = new \ReflectionClass($definition->getClass());
// check if class is matched
$matchingPointcuts = array();
foreach ($pointcuts as $interceptor => $pointcut) {
if ($pointcut->matchesClass($class)) {
$matchingPointcuts[$interceptor] = $pointcut;
}
}
if (empty($matchingPointcuts)) {
return;
}
$this->addResources($class, $this->container);
if ($class->isFinal()) {
return;
}
$classAdvices = array();
foreach (ReflectionUtils::getOverrideableMethods($class) as $method) {
if ('__construct' === $method->name) {
continue;
}
$advices = array();
foreach ($matchingPointcuts as $interceptor => $pointcut) {
if ($pointcut->matchesMethod($method)) {
$advices[] = $interceptor;
}
}
if (empty($advices)) {
continue;
}
$classAdvices[$method->name] = $advices;
}
if (empty($classAdvices)) {
return;
}
$interceptors[ClassUtils::getUserClass($class->name)] = $classAdvices;
$proxyFilename = $this->cacheDir.'/'.str_replace('\\', '-', $class->name).'.php';
$generator = new InterceptionGenerator();
$generator->setFilter(function(\ReflectionMethod $method) use ($classAdvices) {
return isset($classAdvices[$method->name]);
});
if ($originalFilename) {
$relativeOriginalFilename = $this->relativizePath($proxyFilename, $originalFilename);
if ($relativeOriginalFilename[0] === '.') {
$generator->setRequiredFile(new RelativePath($relativeOriginalFilename));
} else {
$generator->setRequiredFile($relativeOriginalFilename);
}
}
$enhancer = new Enhancer($class, array(), array(
$generator
));
$enhancer->setNamingStrategy(new DefaultNamingStrategy('EnhancedProxy'.substr(md5($this->container->getParameter('jms_aop.cache_dir')), 0, 8)));
$enhancer->writeClass($proxyFilename);
$definition->setFile($proxyFilename);
$definition->setClass($enhancer->getClassName($class));
$definition->addMethodCall('__CGInterception__setLoader', array(
new Reference('jms_aop.interceptor_loader')
));
}
private function relativizePath($targetPath, $path)
{
$commonPath = dirname($targetPath);
$level = 0;
while ( ! empty($commonPath)) {
if (0 === strpos($path, $commonPath)) {
$relativePath = str_repeat('../', $level).substr($path, strlen($commonPath) + 1);
return $relativePath;
}
$commonPath = dirname($commonPath);
$level += 1;
}
return $path;
}
private function addResources(\ReflectionClass $class)
{
do {
$this->container->addResource(new FileResource($class->getFilename()));
} while (($class = $class->getParentClass()) && $class->getFilename());
}
private function getPointcuts()
{
if (null !== $this->pointcuts) {
return $this->pointcuts;
}
$pointcuts = $pointcutReferences = array();
foreach ($this->container->findTaggedServiceIds('jms_aop.pointcut') as $id => $attr) {
if (!isset($attr[0]['interceptor'])) {
throw new RuntimeException('You need to set the "interceptor" attribute for the "jms_aop.pointcut" tag of service "'.$id.'".');
}
$pointcutReferences[$attr[0]['interceptor']] = new Reference($id);
$pointcuts[$attr[0]['interceptor']] = $this->container->get($id);
}
$this->container
->getDefinition('jms_aop.pointcut_container')
->addArgument($pointcutReferences)
;
return $pointcuts;
}
}
@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('jms_aop')
->children()
->scalarNode('cache_dir')->cannotBeEmpty()->defaultValue('%kernel.cache_dir%/jms_aop')->end()
->end()
;
return $treeBuilder;
}
}
@@ -0,0 +1,54 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\DependencyInjection;
use JMS\AopBundle\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* JMSAopExtension.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class JMSAopExtension extends Extension
{
/**
* {@inheritDoc}
* @param array<array<string,string>> $configs
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$cacheDir = $container->getParameterBag()->resolveValue($config['cache_dir']);
if (!is_dir($cacheDir)) {
if (false === @mkdir($cacheDir, 0777, true)) {
throw new RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir));
}
}
$container->setParameter('jms_aop.cache_dir', $cacheDir);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Exception;
/**
* Base exception for the AopBundle.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface Exception
{
}
@@ -0,0 +1,28 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Exception;
/**
* RuntimeException for the AopBundle.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class RuntimeException extends \RuntimeException implements Exception
{
}
+34
View File
@@ -0,0 +1,34 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class JMSAopBundle extends Bundle
{
const VERSION = '1.1.0-DEV';
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new PointcutMatchingPass(), PassConfig::TYPE_AFTER_REMOVING);
}
}
+8
View File
@@ -0,0 +1,8 @@
For documentation, see:
Resources/doc
For license, see:
Resources/meta/LICENSE
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="jms_aop.interceptor_loader.class">JMS\AopBundle\Aop\InterceptorLoader</parameter>
</parameters>
<services>
<service id="jms_aop.pointcut_container" class="JMS\AopBundle\Aop\PointcutContainer" />
<service id="jms_aop.interceptor_loader" class="%jms_aop.interceptor_loader.class%">
<argument type="service" id="service_container" />
</service>
</services>
</container>
+252
View File
@@ -0,0 +1,252 @@
========
Overview
========
This bundle adds AOP capabilities to Symfony2.
If you haven't heard of AOP yet, it basically allows you to separate a
cross-cutting concern (for example, security checks) into a dedicated class,
and not having to repeat that code in all places where it is needed.
In other words, this allows you to execute custom code before, and after the
invocation of certain methods in your service layer, or your controllers. You
can also choose to skip the invocation of the original method, or throw exceptions.
Installation
------------
Checkout a copy of the code::
git submodule add https://github.com/schmittjoh/JMSAopBundle.git src/JMS/AopBundle
Then register the bundle with your kernel::
// in AppKernel::registerBundles()
$bundles = array(
// ...
new JMS\AopBundle\JMSAopBundle(),
// ...
);
This bundle also requires the CG library for code generation::
git submodule add https://github.com/schmittjoh/cg-library.git vendor/cg-library
Make sure that you also register the namespaces with the autoloader::
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'JMS' => __DIR__.'/../vendor/bundles',
'CG' => __DIR__.'/../vendor/cg-library/src',
// ...
));
Configuration
-------------
::
jms_aop:
cache_dir: %kernel.cache_dir%/jms_aop
Usage
-----
In order to execute custom code, you need two classes. First, you need a so-called
pointcut. The purpose of this class is to make a decision whether a method call
should be intercepted by a certain interceptor. This decision has to be made
statically only on the basis of the method signature itself.
The second class is the interceptor. This class is being called instead
of the original method. It contains the custom code that you would like to
execute. At this point, you have access to the object on which the method is
called, and all the arguments which were passed to that method.
Examples
--------
1. Logging
~~~~~~~~~~
In this example, we will be implementing logging for all methods that contain
"delete".
Pointcut
^^^^^^^^
::
<?php
use JMS\AopBundle\Aop\PointcutInterface;
class LoggingPointcut implements PointcutInterface
{
public function matchesClass(\ReflectionClass $class)
{
return true;
}
public function matchesMethod(\ReflectionMethod $method)
{
return false !== strpos($method->name, 'delete');
}
}
::
# services.yml
services:
my_logging_pointcut:
class: LoggingPointcut
tags:
- { name: jms_aop.pointcut, interceptor: logging_interceptor }
LoggingInterceptor
^^^^^^^^^^^^^^^^^^
::
<?php
use CG\Proxy\MethodInterceptorInterface;
use CG\Proxy\MethodInvocation;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
class LoggingInterceptor implements MethodInterceptorInterface
{
private $context;
private $logger;
public function __construct(SecurityContextInterface $context,
LoggerInterface $logger)
{
$this->context = $context;
$this->logger = $logger;
}
public function intercept(MethodInvocation $invocation)
{
$user = $this->context->getToken()->getUsername();
$this->logger->info(sprintf('User "%s" invoked method "%s".', $user, $invocation->reflection->name));
// make sure to proceed with the invocation otherwise the original
// method will never be called
return $invocation->proceed();
}
}
::
# services.yml
services:
logging_interceptor:
class: LoggingInterceptor
arguments: [@security.context, @logger]
2. Transaction Management
~~~~~~~~~~~~~~~~~~~~~~~~~
In this example, we add a @Transactional annotation, and we automatically wrap all methods
where this annotation is declared in a transaction.
Pointcut
^^^^^^^^
::
use Doctrine\Common\Annotations\Reader;
use JMS\AopBundle\Aop\PointcutInterface;
use JMS\DiExtraBundle\Annotation as DI;
/**
* @DI\Service
* @DI\Tag("jms_aop.pointcut", attributes = {"interceptor" = "aop.transactional_interceptor"})
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class TransactionalPointcut implements PointcutInterface
{
private $reader;
/**
* @DI\InjectParams({
* "reader" = @DI\Inject("annotation_reader"),
* })
* @param Reader $reader
*/
public function __construct(Reader $reader)
{
$this->reader = $reader;
}
public function matchesClass(\ReflectionClass $class)
{
return true;
}
public function matchesMethod(\ReflectionMethod $method)
{
return null !== $this->reader->getMethodAnnotation($method, 'Annotation\Transactional');
}
}
Interceptor
^^^^^^^^^^^
::
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use CG\Proxy\MethodInvocation;
use CG\Proxy\MethodInterceptorInterface;
use Doctrine\ORM\EntityManager;
use JMS\DiExtraBundle\Annotation as DI;
/**
* @DI\Service("aop.transactional_interceptor")
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class TransactionalInterceptor implements MethodInterceptorInterface
{
private $em;
private $logger;
/**
* @DI\InjectParams
* @param EntityManager $em
*/
public function __construct(EntityManager $em, LoggerInterface $logger)
{
$this->em = $em;
$this->logger = $logger;
}
public function intercept(MethodInvocation $invocation)
{
$this->logger->info('Beginning transaction for method "'.$invocation.'")');
$this->em->getConnection()->beginTransaction();
try {
$rs = $invocation->proceed();
$this->logger->info(sprintf('Comitting transaction for method "%s" (method invocation successful)', $invocation));
$this->em->getConnection()->commit();
return $rs;
} catch (\Exception $ex) {
if ($ex instanceof NotFoundHttpException) {
$this->logger->info(sprintf('Committing transaction for method "%s" (exception thrown, but no rollback)', $invocation));
$this->em->getConnection()->commit();
} else {
$this->logger->info(sprintf('Rolling back transaction for method "%s" (exception thrown)', $invocation));
$this->em->getConnection()->rollBack();
}
throw $ex;
}
}
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\Aop;
use JMS\AopBundle\Aop\InterceptorLoader;
class InterceptorLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testLoadInterceptors()
{
$interceptor = $this->getMock('CG\Proxy\MethodInterceptorInterface');
list($loader, $container) = $this->getLoader(array(
'JMS\AopBundle\Tests\Aop\InterceptorLoaderTestClass' => array(
'foo' => array('foo'),
),
));
$container
->expects($this->once())
->method('get')
->with($this->equalTo('foo'))
->will($this->returnValue($interceptor))
;
$method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\InterceptorLoaderTestClass', 'foo');
$this->assertSame(array($interceptor), $loader->loadInterceptors($method));
// yes, twice
$this->assertSame(array($interceptor), $loader->loadInterceptors($method));
}
private function getLoader(array $interceptors = array())
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
return array(new InterceptorLoader($container, $interceptors), $container);
}
}
class InterceptorLoaderTestClass
{
public function foo()
{
}
}
@@ -0,0 +1,47 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\Aop;
use JMS\AopBundle\Aop\RegexPointcut;
class RegexPointcutTest extends \PHPUnit_Framework_TestCase
{
public function testMatchesClass()
{
$pointcut = new RegexPointcut('');
$this->assertTrue($pointcut->matchesClass(new \ReflectionClass('stdClass')));
}
public function testMatchesMethod()
{
$pointcut = new RegexPointcut('foo$');
$method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\RegexPointcutTestClass', 'foo');
$this->assertTrue($pointcut->matchesMethod($method));
$method = new \ReflectionMethod('JMS\AopBundle\Tests\Aop\RegexPointcutTestClass', 'bar');
$this->assertFalse($pointcut->matchesMethod($method));
}
}
class RegexPointcutTestClass
{
public function foo() {}
public function bar() {}
}
@@ -0,0 +1,39 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture;
use CG\Proxy\MethodInvocation;
use CG\Proxy\MethodInterceptorInterface;
class LoggingInterceptor implements MethodInterceptorInterface
{
private $log = array();
public function getLog()
{
return $this->log;
}
public function intercept(MethodInvocation $invocation)
{
$this->log[] = $invocation->reflection->name;
return $invocation->proceed();
}
}
@@ -0,0 +1,34 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture;
use JMS\AopBundle\Aop\PointcutInterface;
class LoggingPointcut implements PointcutInterface
{
public function matchesClass(\ReflectionClass $class)
{
return true;
}
public function matchesMethod(\ReflectionMethod $method)
{
return false !== strpos($method->name, 'delete');
}
}
@@ -0,0 +1,32 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture;
class TestService
{
public function add()
{
return true;
}
public function delete()
{
return true;
}
}
@@ -0,0 +1,96 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\AopBundle\Tests\DependencyInjection\Compiler;
use JMS\AopBundle\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass;
use JMS\AopBundle\DependencyInjection\JMSAopExtension;
use JMS\AopBundle\DependencyInjection\Compiler\PointcutMatchingPass;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class PointcutMatchingPassTest extends \PHPUnit_Framework_TestCase
{
private $cacheDir;
private $fs;
public function testProcess()
{
$container = $this->getContainer();
$container
->register('pointcut', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\LoggingPointcut')
->addTag('jms_aop.pointcut', array('interceptor' => 'interceptor'))
;
$container
->register('interceptor', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\LoggingInterceptor')
;
$container
->register('test', 'JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\TestService')
;
$this->process($container);
$service = $container->get('test');
$this->assertInstanceOf('JMS\AopBundle\Tests\DependencyInjection\Compiler\Fixture\TestService', $service);
$this->assertTrue($service->add());
$this->assertTrue($service->delete());
$this->assertEquals(array('delete'), $container->get('interceptor')->getLog());
}
protected function setUp()
{
$this->cacheDir = sys_get_temp_dir().'/jms_aop_test';
$this->fs = new Filesystem();
if (is_dir($this->cacheDir)) {
$this->fs->remove($this->cacheDir);
}
if (false === @mkdir($this->cacheDir, 0777, true)) {
throw new RuntimeException(sprintf('Could not create cache dir "%s".', $this->cacheDir));
}
}
protected function tearDown()
{
$this->fs->remove($this->cacheDir);
}
private function getContainer()
{
$container = new ContainerBuilder();
$extension = new JMSAopExtension();
$extension->load(array(array(
'cache_dir' => $this->cacheDir,
)), $container);
return $container;
}
private function process(ContainerBuilder $container)
{
$pass = new ResolveParameterPlaceHoldersPass();
$pass->process($container);
$pass = new PointcutMatchingPass();
$pass->process($container);
}
}
+29
View File
@@ -0,0 +1,29 @@
{
"name": "jms/aop-bundle",
"description": "Adds AOP capabilities to Symfony2",
"keywords": ["annotations","aop"],
"type": "symfony-bundle",
"license": "Apache-2.0",
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"require": {
"php": ">=5.3.9",
"symfony/framework-bundle": "^2.3|^3.0",
"jms/cg": "^1.1"
},
"require-dev": {
"symfony/phpunit-bridge": "^2.7"
},
"autoload": {
"psr-4": { "JMS\\AopBundle\\": "" }
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
}
}
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="AopBundle Test Suite">
<directory>./Tests</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>performance</group>
</exclude>
</groups>
</phpunit>
+4
View File
@@ -0,0 +1,4 @@
composer.lock
phpunit.xml
vendor/
+17
View File
@@ -0,0 +1,17 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
script: phpunit --coverage-clover clover
after_success:
- curl -sL https://bit.ly/artifact-uploader | php
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+9
View File
@@ -0,0 +1,9 @@
CG library provides a toolset for generating PHP code
=====================================================
Overview
--------
This library provides some tools that you commonly need for generating PHP code.
One of it's strength lies in the enhancement of existing classes with behaviors.
+27
View File
@@ -0,0 +1,27 @@
{
"name": "jms/cg",
"description": "Toolset for generating PHP code",
"keywords": ["code generation"],
"type": "library",
"license": "Apache2",
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.5"
},
"autoload": {
"psr-0": { "CG\\": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
}
}
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>
<testsuites>
<testsuite name="CG Test Suite">
<directory>./tests/CG/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>performance</group>
</exclude>
</groups>
</phpunit>
@@ -0,0 +1,63 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
use CG\Generator\PhpClass;
/**
* Abstract base class for all class generators.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class AbstractClassGenerator implements ClassGeneratorInterface
{
private $namingStrategy;
private $generatorStrategy;
public function setNamingStrategy(NamingStrategyInterface $namingStrategy = null)
{
$this->namingStrategy = $namingStrategy;
}
public function setGeneratorStrategy(GeneratorStrategyInterface $generatorStrategy = null)
{
$this->generatorStrategy = $generatorStrategy;
}
/**
* @return string
*/
public function getClassName(\ReflectionClass $class)
{
if (null === $this->namingStrategy) {
$this->namingStrategy = new DefaultNamingStrategy();
}
return $this->namingStrategy->getClassName($class);
}
protected function generateCode(PhpClass $class)
{
if (null === $this->generatorStrategy) {
$this->generatorStrategy = new DefaultGeneratorStrategy();
}
return $this->generatorStrategy->generate($class);
}
}
@@ -0,0 +1,34 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
/**
* Interface for class generators.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface ClassGeneratorInterface
{
/**
* Generates the PHP class.
*
* @return string
*/
public function generateClass();
}
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
abstract class ClassUtils
{
/**
* @param string $className
*/
public static function getUserClass($className)
{
if (false === $pos = strrpos($className, '\\'.NamingStrategyInterface::SEPARATOR.'\\')) {
return $className;
}
return substr($className, $pos + NamingStrategyInterface::SEPARATOR_LENGTH + 2);
}
final private function __construct() {}
}
@@ -0,0 +1,67 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
use CG\Generator\DefaultVisitorInterface;
use CG\Generator\PhpClass;
use CG\Generator\DefaultVisitor;
use CG\Generator\DefaultNavigator;
/**
* The default generator strategy.
*
* This strategy allows to change the order in which methods, properties and
* constants are sorted.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class DefaultGeneratorStrategy implements GeneratorStrategyInterface
{
private $navigator;
private $visitor;
public function __construct(DefaultVisitorInterface $visitor = null)
{
$this->navigator = new DefaultNavigator();
$this->visitor = $visitor ?: new DefaultVisitor();
}
public function setConstantSortFunc(\Closure $func = null)
{
$this->navigator->setConstantSortFunc($func);
}
public function setMethodSortFunc(\Closure $func = null)
{
$this->navigator->setMethodSortFunc($func);
}
public function setPropertySortFunc(\Closure $func = null)
{
$this->navigator->setPropertySortFunc($func);
}
public function generate(PhpClass $class)
{
$this->visitor->reset();
$this->navigator->accept($this->visitor, $class);
return $this->visitor->getContent();
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
/**
* The default naming strategy.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class DefaultNamingStrategy implements NamingStrategyInterface
{
private $prefix;
public function __construct($prefix = 'EnhancedProxy')
{
$this->prefix = $prefix;
}
public function getClassName(\ReflectionClass $class)
{
$userClass = ClassUtils::getUserClass($class->name);
return $this->prefix.'_'.sha1($class->name).'\\'.self::SEPARATOR.'\\'.$userClass;
}
}
@@ -0,0 +1,34 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
use CG\Generator\PhpClass;
/**
* Generator Strategy Interface.
*
* Implementing classes are responsible for generating PHP code from the given
* PhpClass instance.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface GeneratorStrategyInterface
{
public function generate(PhpClass $class);
}
@@ -0,0 +1,50 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
/**
* The naming strategy interface.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface NamingStrategyInterface
{
const SEPARATOR = '__CG__';
const SEPARATOR_LENGTH = 6;
/**
* Returns the class name for the proxy class.
*
* The generated class name MUST be the concatenation of a nonempty prefix,
* the namespace separator __CG__, and the original class name.
*
* Examples:
*
* +----------------------------+------------------------------+
* | Original Name | Generated Name |
* +============================+==============================+
* | Foo\Bar | dred332\__CG__\Foo\Bar |
* | Bar\Baz | Foo\Doo\__CG__\Bar\Baz |
* +----------------------------+------------------------------+
*
* @param \ReflectionClass $class
* @return string the class name for the generated class
*/
public function getClassName(\ReflectionClass $class);
}
+63
View File
@@ -0,0 +1,63 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Core;
abstract class ReflectionUtils
{
/**
* @param boolean $publicOnly
*/
public static function getOverrideableMethods(\ReflectionClass $class, $publicOnly = false)
{
$filter = \ReflectionMethod::IS_PUBLIC;
if (!$publicOnly) {
$filter |= \ReflectionMethod::IS_PROTECTED;
}
return array_filter(
$class->getMethods($filter),
function($method) { return !$method->isFinal() && !$method->isStatic(); }
);
}
/**
* @param string $docComment
*/
public static function getUnindentedDocComment($docComment)
{
$lines = explode("\n", $docComment);
for ($i=0,$c=count($lines); $i<$c; $i++) {
if (0 === $i) {
$docBlock = $lines[0]."\n";
continue;
}
$docBlock .= ' '.ltrim($lines[$i]);
if ($i+1 < $c) {
$docBlock .= "\n";
}
}
return $docBlock;
}
final private function __construct() { }
}
+58
View File
@@ -0,0 +1,58 @@
<?php
namespace CG\Generator;
abstract class AbstractBuilder
{
private $attributes;
public function setAttribute($key, $value)
{
$this->attributes[$key] = $value;
return $this;
}
public function removeAttribute($key)
{
unset($this->attributes[$key]);
}
public function getAttribute($key)
{
if ( ! isset($this->attributes[$key])) {
throw new \InvalidArgumentException(sprintf('There is no attribute named "%s".', $key));
}
return $this->attributes[$key];
}
/**
* @param string $key
*/
public function getAttributeOrElse($key, $default)
{
if ( ! isset($this->attributes[$key])) {
return $default;
}
return $this->attributes[$key];
}
public function hasAttribute($key)
{
return isset($this->attributes[$key]);
}
public function setAttributes(array $attrs)
{
$this->attributes = $attrs;
return $this;
}
public function getAttributes()
{
return $this->attributes;
}
}
+107
View File
@@ -0,0 +1,107 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* Abstract PHP member class.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class AbstractPhpMember extends AbstractBuilder
{
const VISIBILITY_PRIVATE = 'private';
const VISIBILITY_PROTECTED = 'protected';
const VISIBILITY_PUBLIC = 'public';
private $static = false;
private $visibility = self::VISIBILITY_PUBLIC;
private $name;
private $docblock;
public function __construct($name = null)
{
$this->setName($name);
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @param string $visibility
*/
public function setVisibility($visibility)
{
if ($visibility !== self::VISIBILITY_PRIVATE
&& $visibility !== self::VISIBILITY_PROTECTED
&& $visibility !== self::VISIBILITY_PUBLIC) {
throw new \InvalidArgumentException(sprintf('The visibility "%s" does not exist.', $visibility));
}
$this->visibility = $visibility;
return $this;
}
/**
* @param boolean $bool
*/
public function setStatic($bool)
{
$this->static = (Boolean) $bool;
return $this;
}
/**
* @param string|null $doc
*/
public function setDocblock($doc)
{
$this->docblock = $doc;
return $this;
}
public function isStatic()
{
return $this->static;
}
public function getVisibility()
{
return $this->visibility;
}
public function getName()
{
return $this->name;
}
public function getDocblock()
{
return $this->docblock;
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace CG\Generator;
class BuiltinType
{
private static $builtinTypes = array('self', 'array', 'callable', 'bool', 'float', 'int', 'string');
private function __construct(){
// Static class
}
public static function isBuiltin($type)
{
return in_array($type, static::$builtinTypes);
}
}
+172
View File
@@ -0,0 +1,172 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* The default navigator.
*
* This class is responsible for the default traversal algorithm of the different
* code elements.
*
* Unlike other visitor pattern implementations, this allows to separate the
* traversal logic from the objects that are traversed.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class DefaultNavigator
{
private $constantSortFunc;
private $propertySortFunc;
private $methodSortFunc;
/**
* Sets a custom constant sorting function.
*
* @param null|\Closure $func
*/
public function setConstantSortFunc(\Closure $func = null)
{
$this->constantSortFunc = $func;
}
/**
* Sets a custom property sorting function.
*
* @param null|\Closure $func
*/
public function setPropertySortFunc(\Closure $func = null)
{
$this->propertySortFunc = $func;
}
/**
* Sets a custom method sorting function.
*
* @param null|\Closure $func
*/
public function setMethodSortFunc(\Closure $func = null)
{
$this->methodSortFunc = $func;
}
public function accept(DefaultVisitorInterface $visitor, PhpClass $class)
{
$visitor->startVisitingClass($class);
$constants = $class->getConstants(true);
if (!empty($constants)) {
uksort($constants, $this->getConstantSortFunc());
$visitor->startVisitingClassConstants();
foreach ($constants as $constant) {
$visitor->visitClassConstant($constant);
}
$visitor->endVisitingClassConstants();
}
$properties = $class->getProperties();
if (!empty($properties)) {
usort($properties, $this->getPropertySortFunc());
$visitor->startVisitingProperties();
foreach ($properties as $property) {
$visitor->visitProperty($property);
}
$visitor->endVisitingProperties();
}
$methods = $class->getMethods();
if (!empty($methods)) {
usort($methods, $this->getMethodSortFunc());
$visitor->startVisitingMethods();
foreach ($methods as $method) {
$visitor->visitMethod($method);
}
$visitor->endVisitingMethods();
}
$visitor->endVisitingClass($class);
}
private function getConstantSortFunc()
{
return $this->constantSortFunc ?: 'strcasecmp';
}
private function getMethodSortFunc()
{
if (null !== $this->methodSortFunc) {
return $this->methodSortFunc;
}
static $defaultSortFunc;
if (empty($defaultSortFunc)) {
$defaultSortFunc = function($a, $b) {
if ($a->isStatic() !== $isStatic = $b->isStatic()) {
return $isStatic ? 1 : -1;
}
if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) {
$aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1);
$bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1);
return $aV > $bV ? -1 : 1;
}
$rs = strcasecmp($a->getName(), $b->getName());
if (0 === $rs) {
return 0;
}
return $rs > 0 ? -1 : 1;
};
}
return $defaultSortFunc;
}
private function getPropertySortFunc()
{
if (null !== $this->propertySortFunc) {
return $this->propertySortFunc;
}
static $defaultSortFunc;
if (empty($defaultSortFunc)) {
$defaultSortFunc = function($a, $b) {
if (($aV = $a->getVisibility()) !== $bV = $b->getVisibility()) {
$aV = 'public' === $aV ? 3 : ('protected' === $aV ? 2 : 1);
$bV = 'public' === $bV ? 3 : ('protected' === $bV ? 2 : 1);
return $aV > $bV ? -1 : 1;
}
$rs = strcasecmp($a->getName(), $b->getName());
if (0 === $rs) {
return 0;
}
return $rs > 0 ? -1 : 1;
};
}
return $defaultSortFunc;
}
}
+301
View File
@@ -0,0 +1,301 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* The default code generation visitor.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class DefaultVisitor implements DefaultVisitorInterface
{
protected $writer;
private $isInterface;
public function __construct()
{
$this->writer = new Writer();
}
public function reset()
{
$this->writer->reset();
}
public function startVisitingClass(PhpClass $class)
{
if ($namespace = $class->getNamespace()) {
$this->writer->write('namespace '.$namespace.';'."\n\n");
}
if ($files = $class->getRequiredFiles()) {
foreach ($files as $file) {
if ($file instanceof RelativePath) {
$this->writer->writeln('require_once __DIR__ . '.var_export('/'.$file->getRelativePath(), true).';');
continue;
}
$this->writer->writeln('require_once '.var_export($file, true).';');
}
$this->writer->write("\n");
}
if ($useStatements = $class->getUseStatements()) {
foreach ($useStatements as $alias => $namespace) {
$this->writer->write('use '.$namespace);
if (substr($namespace, strrpos($namespace, '\\') + 1) !== $alias) {
$this->writer->write(' as '.$alias);
}
$this->writer->write(";\n");
}
$this->writer->write("\n");
}
if ($docblock = $class->getDocblock()) {
$this->writer->writeln($docblock);
}
if ($class->isAbstract()) {
$this->writer->write('abstract ');
}
if ($class->isFinal()) {
$this->writer->write('final ');
}
// TODO: Interfaces should be modeled as separate classes.
$this->isInterface = $class->getAttributeOrElse('interface', false);
$this->writer->write($this->isInterface ? 'interface ' : 'class ');
$this->writer->write($class->getShortName());
if ( ! $this->isInterface) {
if ($parentClassName = $class->getParentClassName()) {
$this->writer->write(' extends '.('\\' === $parentClassName[0] ? $parentClassName : '\\'.$parentClassName));
}
}
$interfaceNames = $class->getInterfaceNames();
if (!empty($interfaceNames)) {
$interfaceNames = array_unique($interfaceNames);
$interfaceNames = array_map(function($name) {
if ('\\' === $name[0]) {
return $name;
}
return '\\'.$name;
}, $interfaceNames);
$this->writer->write($this->isInterface ? ' extends ' : ' implements ');
$this->writer->write(implode(', ', $interfaceNames));
}
$this->writer
->write("\n{\n")
->indent()
;
}
public function startVisitingClassConstants()
{
}
public function visitClassConstant(PhpConstant $constant)
{
$this->writer->writeln('const '.$constant->getName().' = '.var_export($constant->getValue(), true).';');
}
public function endVisitingClassConstants()
{
$this->writer->write("\n");
}
public function startVisitingProperties()
{
}
public function visitProperty(PhpProperty $property)
{
if ($docblock = $property->getDocblock()) {
$this->writer->writeln($docblock)->rtrim();
}
$this->writer->write($property->getVisibility().' '.($property->isStatic()? 'static ' : '').'$'.$property->getName());
if ($property->hasDefaultValue()) {
$this->writer->write(' = '.var_export($property->getDefaultValue(), true));
}
$this->writer->writeln(';');
}
public function endVisitingProperties()
{
$this->writer->write("\n");
}
public function startVisitingMethods()
{
}
public function visitMethod(PhpMethod $method)
{
if ($docblock = $method->getDocblock()) {
$this->writer->writeln($docblock)->rtrim();
}
if ($method->isAbstract()) {
$this->writer->write('abstract ');
}
$this->writer->write($method->getVisibility().' ');
if ($method->isStatic()) {
$this->writer->write('static ');
}
$this->writer->write('function ');
if ($method->isReferenceReturned()) {
$this->writer->write('& ');
}
$this->writer->write($method->getName().'(');
$this->writeParameters($method->getParameters());
$this->writer->write(")");
if ($method->hasReturnType()) {
$type = $method->getReturnType();
$this->writer->write(': ');
if (!$method->hasBuiltInReturnType() && '\\' !== $type[0]) {
$this->writer->write('\\');
}
$this->writer->write($type);
}
if ($method->isAbstract() || $this->isInterface) {
$this->writer->write(";\n\n");
return;
}
$this->writer
->writeln("\n{")
->indent()
->writeln($method->getBody())
->outdent()
->rtrim()
->write("}\n\n")
;
}
public function endVisitingMethods()
{
}
public function endVisitingClass(PhpClass $class)
{
$this->writer
->outdent()
->rtrim()
->write('}')
;
}
public function visitFunction(PhpFunction $function)
{
if ($namespace = $function->getNamespace()) {
$this->writer->write("namespace $namespace;\n\n");
}
if ($docblock = $function->getDocblock()) {
$this->writer->writeln($docblock)->rtrim();
}
$this->writer->write("function {$function->getName()}(");
$this->writeParameters($function->getParameters());
$this->writer->write(')');
if ($function->hasReturnType()) {
$type = $function->getReturnType();
$this->writer->write(': ');
if (!$function->hasBuiltinReturnType() && '\\' !== $type[0]) {
$this->writer->write('\\');
}
$this->writer->write($type);
}
$this->writer
->write("\n{\n")
->indent()
->writeln($function->getBody())
->outdent()
->rtrim()
->write('}')
;
}
public function getContent()
{
return $this->writer->getContent();
}
private function writeParameters(array $parameters)
{
$first = true;
foreach ($parameters as $parameter) {
if (!$first) {
$this->writer->write(', ');
}
$first = false;
if ($parameter->hasType()) {
$type = $parameter->getType();
if (!$parameter->hasBuiltinType() && '\\' !== $type[0]) {
$this->writer->write('\\');
}
$this->writer->write($type . ' ');
}
if ($parameter->isPassedByReference()) {
$this->writer->write('&');
}
$this->writer->write('$'.$parameter->getName());
if ($parameter->hasDefaultValue()) {
$this->writer->write(' = ');
$defaultValue = $parameter->getDefaultValue();
if (is_array($defaultValue) && empty($defaultValue)) {
$this->writer->write('array()');
} else {
$this->writer->write(var_export($defaultValue, true));
}
}
}
}
}
@@ -0,0 +1,95 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* The visitor interface required by the DefaultNavigator.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface DefaultVisitorInterface
{
/**
* Resets the visitors internal state to allow re-using the same instance.
*
* @return void
*/
public function reset();
/**
* @return void
*/
public function startVisitingClass(PhpClass $class);
/**
* @return void
*/
public function startVisitingClassConstants();
/**
* @param PhpConstant $constant
* @return void
*/
public function visitClassConstant(PhpConstant $constant);
/**
* @return void
*/
public function endVisitingClassConstants();
/**
* @return void
*/
public function startVisitingProperties();
/**
* @return void
*/
public function visitProperty(PhpProperty $property);
/**
* @return void
*/
public function endVisitingProperties();
/**
* @return void
*/
public function startVisitingMethods();
/**
* @return void
*/
public function visitMethod(PhpMethod $method);
/**
* @return void
*/
public function endVisitingMethods();
/**
* @return void
*/
public function endVisitingClass(PhpClass $class);
/**
* @return void
*/
public function visitFunction(PhpFunction $function);
}
+38
View File
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* Some Generator utils.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class GeneratorUtils
{
final private function __construct() {}
public static function callMethod(\ReflectionMethod $method, array $params = null)
{
if (null === $params) {
$params = array_map(function($p) { return '$'.$p->name; }, $method->getParameters());
}
return '\\'.$method->getDeclaringClass()->name.'::'.$method->name.'('.implode(', ', $params).')';
}
}
+498
View File
@@ -0,0 +1,498 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
use Doctrine\Common\Annotations\PhpParser;
use CG\Core\ReflectionUtils;
/**
* Represents a PHP class.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class PhpClass extends AbstractBuilder
{
private static $phpParser;
private $name;
private $parentClassName;
private $interfaceNames = array();
private $useStatements = array();
private $constants = array();
private $properties = array();
private $requiredFiles = array();
private $methods = array();
private $abstract = false;
private $final = false;
private $docblock;
public static function create($name = null)
{
return new self($name);
}
public static function fromReflection(\ReflectionClass $ref)
{
$class = new static();
$class
->setName($ref->name)
->setAbstract($ref->isAbstract())
->setFinal($ref->isFinal())
->setConstants($ref->getConstants())
;
if (null === self::$phpParser) {
if (!class_exists('Doctrine\Common\Annotations\PhpParser')) {
self::$phpParser = false;
} else {
self::$phpParser = new PhpParser();
}
}
if (false !== self::$phpParser) {
$class->setUseStatements(self::$phpParser->parseClass($ref));
}
if ($docComment = $ref->getDocComment()) {
$class->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment));
}
foreach ($ref->getMethods() as $method) {
$class->setMethod(static::createMethod($method));
}
foreach ($ref->getProperties() as $property) {
$class->setProperty(static::createProperty($property));
}
return $class;
}
/**
* @return PhpMethod
*/
protected static function createMethod(\ReflectionMethod $method)
{
return PhpMethod::fromReflection($method);
}
/**
* @return PhpProperty
*/
protected static function createProperty(\ReflectionProperty $property)
{
return PhpProperty::fromReflection($property);
}
public function __construct($name = null)
{
$this->name = $name;
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @param string|null $name
*/
public function setParentClassName($name)
{
$this->parentClassName = $name;
return $this;
}
public function setInterfaceNames(array $names)
{
$this->interfaceNames = $names;
return $this;
}
/**
* @param string $name
*/
public function addInterfaceName($name)
{
$this->interfaceNames[] = $name;
return $this;
}
public function setRequiredFiles(array $files)
{
$this->requiredFiles = $files;
return $this;
}
/**
* @param string $file
*/
public function addRequiredFile($file)
{
$this->requiredFiles[] = $file;
return $this;
}
public function setUseStatements(array $useStatements)
{
foreach ($useStatements as $alias => $namespace) {
if (!is_string($alias)) {
$alias = null;
}
$this->addUseStatement($namespace, $alias);
}
return $this;
}
/**
* @param string $namespace
* @param string|null $alias
*/
public function addUseStatement($namespace, $alias = null)
{
if (null === $alias) {
$alias = substr($namespace, strrpos($namespace, '\\') + 1);
}
$this->useStatements[$alias] = $namespace;
return $this;
}
public function setConstants(array $constants)
{
$normalizedConstants = array();
foreach ($constants as $name => $value) {
if ( ! $value instanceof PhpConstant) {
$constValue = $value;
$value = new PhpConstant($name);
$value->setValue($constValue);
}
$normalizedConstants[$name] = $value;
}
$this->constants = $normalizedConstants;
return $this;
}
/**
* @param string|PhpConstant $name
* @param string $value
*/
public function setConstant($nameOrConstant, $value = null)
{
if ($nameOrConstant instanceof PhpConstant) {
if (null !== $value) {
throw new \InvalidArgumentException('If a PhpConstant object is passed, $value must be null.');
}
$name = $nameOrConstant->getName();
$constant = $nameOrConstant;
} else {
$name = $nameOrConstant;
$constant = new PhpConstant($nameOrConstant);
$constant->setValue($value);
}
$this->constants[$name] = $constant;
return $this;
}
/**
* @param string $name
*
* @return boolean
*/
public function hasConstant($name)
{
return array_key_exists($name, $this->constants);
}
/**
* Returns a constant.
*
* @param string $name
*
* @return PhpConstant
*/
public function getConstant($name)
{
if ( ! isset($this->constants[$name])) {
throw new \InvalidArgumentException(sprintf('The constant "%s" does not exist.'));
}
return $this->constants[$name];
}
/**
* @param string $name
*/
public function removeConstant($name)
{
if (!array_key_exists($name, $this->constants)) {
throw new \InvalidArgumentException(sprintf('The constant "%s" does not exist.', $name));
}
unset($this->constants[$name]);
return $this;
}
public function setProperties(array $properties)
{
$this->properties = $properties;
return $this;
}
public function setProperty(PhpProperty $property)
{
$this->properties[$property->getName()] = $property;
return $this;
}
/**
* @param string $property
*/
public function hasProperty($property)
{
if ($property instanceof PhpProperty) {
$property = $property->getName();
}
return isset($this->properties[$property]);
}
/**
* @param string $property
*/
public function removeProperty($property)
{
if ($property instanceof PhpProperty) {
$property = $property->getName();
}
if (!array_key_exists($property, $this->properties)) {
throw new \InvalidArgumentException(sprintf('The property "%s" does not exist.', $property));
}
unset($this->properties[$property]);
return $this;
}
public function setMethods(array $methods)
{
$this->methods = $methods;
return $this;
}
public function setMethod(PhpMethod $method)
{
$this->methods[$method->getName()] = $method;
return $this;
}
public function getMethod($method)
{
if ( ! isset($this->methods[$method])) {
throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $method));
}
return $this->methods[$method];
}
/**
* @param string|PhpMethod $method
*/
public function hasMethod($method)
{
if ($method instanceof PhpMethod) {
$method = $method->getName();
}
return isset($this->methods[$method]);
}
/**
* @param string|PhpMethod $method
*/
public function removeMethod($method)
{
if ($method instanceof PhpMethod) {
$method = $method->getName();
}
if (!array_key_exists($method, $this->methods)) {
throw new \InvalidArgumentException(sprintf('The method "%s" does not exist.', $method));
}
unset($this->methods[$method]);
return $this;
}
/**
* @param boolean $bool
*/
public function setAbstract($bool)
{
$this->abstract = (Boolean) $bool;
return $this;
}
/**
* @param boolean $bool
*/
public function setFinal($bool)
{
$this->final = (Boolean) $bool;
return $this;
}
/**
* @param string $block
*/
public function setDocblock($block)
{
$this->docblock = $block;
return $this;
}
public function getName()
{
return $this->name;
}
public function getParentClassName()
{
return $this->parentClassName;
}
public function getInterfaceNames()
{
return $this->interfaceNames;
}
public function getRequiredFiles()
{
return $this->requiredFiles;
}
public function getUseStatements()
{
return $this->useStatements;
}
public function getNamespace()
{
if (false === $pos = strrpos($this->name, '\\')) {
return null;
}
return substr($this->name, 0, $pos);
}
public function getShortName()
{
if (false === $pos = strrpos($this->name, '\\')) {
return $this->name;
}
return substr($this->name, $pos+1);
}
public function getConstants($asObjects = false)
{
if ($asObjects) {
return $this->constants;
}
return array_map(function(PhpConstant $constant) {
return $constant->getValue();
}, $this->constants);
}
public function getProperties()
{
return $this->properties;
}
public function getMethods()
{
return $this->methods;
}
public function isAbstract()
{
return $this->abstract;
}
public function isFinal()
{
return $this->final;
}
public function getDocblock()
{
return $this->docblock;
}
public function hasUseStatements()
{
return count($this->getUseStatements()) > 0;
}
public function uses($typeDef)
{
if (empty($typeDef)) {
throw new \InvalidArgumentException("Empty type definition name given in " . __METHOD__);
}
if (!$this->hasUseStatements()) {
return false;
}
if ('\\' === $typeDef[0]) {
return false; // typedef references the root
}
$parts = explode('\\', $typeDef);
$typeDef = array_shift($parts);
return isset($this->useStatements[$typeDef]);
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace CG\Generator;
use CG\Generator\AbstractBuilder;
class PhpConstant extends AbstractBuilder
{
private $name;
private $value;
public function __construct($name = null)
{
$this->name = $name;
}
public function setName($name)
{
$this->name = $name;
return $this;
}
public function setValue($value)
{
$this->value = $value;
return $this;
}
public function getName()
{
return $this->name;
}
public function getValue()
{
return $this->value;
}
}
+279
View File
@@ -0,0 +1,279 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* Represents a PHP function.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
use CG\Core\ReflectionUtils;
class PhpFunction extends AbstractBuilder
{
private $name;
private $namespace;
private $parameters = array();
private $body = '';
private $referenceReturned = false;
private $docblock;
private $returnType;
private $returnTypeBuiltin = false;
public static function fromReflection(\ReflectionFunction $ref)
{
$function = new static();
if (false === $pos = strrpos($ref->name, '\\')) {
$function->setName(substr($ref->name, $pos + 1));
$function->setNamespace(substr($ref->name, $pos));
} else {
$function->setName($ref->name);
}
if (method_exists($ref, 'getReturnType')) {
if ($type = $ref->getReturnType()) {
$function->setReturnType((string)$type);
}
}
$function->referenceReturned = $ref->returnsReference();
$function->docblock = ReflectionUtils::getUnindentedDocComment($ref->getDocComment());
foreach ($ref->getParameters() as $refParam) {
assert($refParam instanceof \ReflectionParameter);
$param = PhpParameter::fromReflection($refParam);
$function->addParameter($param);
}
return $function;
}
public static function create($name = null)
{
return new static($name);
}
public function __construct($name = null)
{
$this->name = $name;
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @param string $namespace
*/
public function setNamespace($namespace)
{
$this->namespace = $namespace;
return $this;
}
/**
* In contrast to getName(), this method accepts the fully qualified name
* including the namespace.
*
* @param string $name
*/
public function setQualifiedName($name)
{
if (false !== $pos = strrpos($name, '\\')) {
$this->namespace = substr($name, 0, $pos);
$this->name = substr($name, $pos + 1);
return $this;
}
$this->namespace = null;
$this->name = $name;
return $this;
}
public function setParameters(array $parameters)
{
$this->parameters = $parameters;
return $this;
}
/**
* @param boolean $bool
*/
public function setReferenceReturned($bool)
{
$this->referenceReturned = (Boolean) $bool;
return $this;
}
public function setReturnType($type)
{
$this->returnType = $type;
$this->returnTypeBuiltin = BuiltinType::isBuiltIn($type);
return $this;
}
/**
* @param integer $position
*/
public function replaceParameter($position, PhpParameter $parameter)
{
if ($position < 0 || $position > count($this->parameters)) {
throw new \InvalidArgumentException(sprintf('$position must be in the range [0, %d].', count($this->parameters)));
}
$this->parameters[$position] = $parameter;
return $this;
}
public function addParameter(PhpParameter $parameter)
{
$this->parameters[] = $parameter;
return $this;
}
/**
* @param string|integer $nameOrIndex
*
* @return PhpParameter
*/
public function getParameter($nameOrIndex)
{
if (is_int($nameOrIndex)) {
if ( ! isset($this->parameters[$nameOrIndex])) {
throw new \InvalidArgumentException(sprintf('There is no parameter at position %d (0-based).', $nameOrIndex));
}
return $this->parameters[$nameOrIndex];
}
foreach ($this->parameters as $param) {
assert($param instanceof PhpParameter);
if ($param->getName() === $nameOrIndex) {
return $param;
}
}
throw new \InvalidArgumentException(sprintf('There is no parameter named "%s".', $nameOrIndex));
}
/**
* @param integer $position
*/
public function removeParameter($position)
{
if (!isset($this->parameters[$position])) {
throw new \InvalidArgumentException(sprintf('There is not parameter at position %d.', $position));
}
unset($this->parameters[$position]);
$this->parameters = array_values($this->parameters);
return $this;
}
/**
* @param string $body
*/
public function setBody($body)
{
$this->body = $body;
return $this;
}
/**
* @param string $docBlock
*/
public function setDocblock($docBlock)
{
$this->docblock = $docBlock;
return $this;
}
public function getName()
{
return $this->name;
}
public function getNamespace()
{
return $this->namespace;
}
public function getQualifiedName()
{
if ($this->namespace) {
return $this->namespace.'\\'.$this->name;
}
return $this->name;
}
public function getParameters()
{
return $this->parameters;
}
public function getBody()
{
return $this->body;
}
public function getDocblock()
{
return $this->docblock;
}
public function isReferenceReturned()
{
return $this->referenceReturned;
}
public function getReturnType()
{
return $this->returnType;
}
public function hasReturnType()
{
return null !== $this->getReturnType();
}
public function hasBuiltinReturnType()
{
return $this->returnTypeBuiltin;
}
}
+234
View File
@@ -0,0 +1,234 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
use CG\Core\ReflectionUtils;
/**
* Represents a PHP method.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class PhpMethod extends AbstractPhpMember
{
private $final = false;
private $abstract = false;
private $parameters = array();
private $referenceReturned = false;
private $returnType = null;
private $returnTypeBuiltin = false;
private $body = '';
/**
* @param string|null $name
*/
public static function create($name = null)
{
return new static($name);
}
public static function fromReflection(\ReflectionMethod $ref)
{
$method = new static();
$method
->setFinal($ref->isFinal())
->setAbstract($ref->isAbstract())
->setStatic($ref->isStatic())
->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE))
->setReferenceReturned($ref->returnsReference())
->setName($ref->name)
;
if (method_exists($ref, 'getReturnType')) {
if ($type = $ref->getReturnType()) {
$method->setReturnType((string)$type);
}
}
if ($docComment = $ref->getDocComment()) {
$method->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment));
}
foreach ($ref->getParameters() as $param) {
$method->addParameter(static::createParameter($param));
}
// FIXME: Extract body?
return $method;
}
/**
* @return PhpParameter
*/
protected static function createParameter(\ReflectionParameter $parameter)
{
return PhpParameter::fromReflection($parameter);
}
/**
* @param boolean $bool
*/
public function setFinal($bool)
{
$this->final = (Boolean) $bool;
return $this;
}
/**
* @param boolean $bool
*/
public function setAbstract($bool)
{
$this->abstract = $bool;
return $this;
}
/**
* @param boolean $bool
*/
public function setReferenceReturned($bool)
{
$this->referenceReturned = (Boolean) $bool;
return $this;
}
/**
* @param string $body
*/
public function setBody($body)
{
$this->body = $body;
return $this;
}
public function setParameters(array $parameters)
{
$this->parameters = array_values($parameters);
return $this;
}
public function addParameter(PhpParameter $parameter)
{
$this->parameters[] = $parameter;
return $this;
}
public function setReturnType($type)
{
$this->returnType = $type;
$this->returnTypeBuiltin = BuiltinType::isBuiltin($type);
return $this;
}
/**
* @param string|integer $nameOrIndex
*
* @return PhpParameter
*/
public function getParameter($nameOrIndex)
{
if (is_int($nameOrIndex)) {
if ( ! isset($this->parameters[$nameOrIndex])) {
throw new \InvalidArgumentException(sprintf('There is no parameter at position %d (0-based).', $nameOrIndex));
}
return $this->parameters[$nameOrIndex];
}
foreach ($this->parameters as $param) {
assert($param instanceof PhpParameter);
if ($param->getName() === $nameOrIndex) {
return $param;
}
}
throw new \InvalidArgumentException(sprintf('There is no parameter named "%s".', $nameOrIndex));
}
public function replaceParameter($position, PhpParameter $parameter)
{
if ($position < 0 || $position > strlen($this->parameters)) {
throw new \InvalidArgumentException(sprintf('The position must be in the range [0, %d].', strlen($this->parameters)));
}
$this->parameters[$position] = $parameter;
return $this;
}
/**
* @param integer $position
*/
public function removeParameter($position)
{
if (!isset($this->parameters[$position])) {
throw new \InvalidArgumentException(sprintf('There is no parameter at position "%d" does not exist.', $position));
}
unset($this->parameters[$position]);
$this->parameters = array_values($this->parameters);
return $this;
}
public function isFinal()
{
return $this->final;
}
public function isAbstract()
{
return $this->abstract;
}
public function isReferenceReturned()
{
return $this->referenceReturned;
}
public function getBody()
{
return $this->body;
}
public function getParameters()
{
return $this->parameters;
}
public function getReturnType()
{
return $this->returnType;
}
public function hasReturnType()
{
return null !== $this->getReturnType();
}
public function hasBuiltInReturnType()
{
return $this->returnTypeBuiltin;
}
}
+158
View File
@@ -0,0 +1,158 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* Represents a PHP parameter.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class PhpParameter extends AbstractBuilder
{
private $name;
private $defaultValue;
private $hasDefaultValue = false;
private $passedByReference = false;
private $type;
private $typeBuiltin;
/**
* @param string|null $name
*/
public static function create($name = null)
{
return new static($name);
}
public static function fromReflection(\ReflectionParameter $ref)
{
$parameter = new static();
$parameter
->setName($ref->name)
->setPassedByReference($ref->isPassedByReference())
;
if ($ref->isDefaultValueAvailable()) {
$parameter->setDefaultValue($ref->getDefaultValue());
}
if (method_exists($ref, 'getType')) {
if ($type = $ref->getType()) {
$parameter->setType((string)$type);
}
} else {
if ($ref->isArray()) {
$parameter->setType('array');
} elseif ($class = $ref->getClass()) {
$parameter->setType($class->name);
} elseif (method_exists($ref, 'isCallable') && $ref->isCallable()) {
$parameter->setType('callable');
}
}
return $parameter;
}
public function __construct($name = null)
{
$this->name = $name;
}
/**
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
public function setDefaultValue($value)
{
$this->defaultValue = $value;
$this->hasDefaultValue = true;
return $this;
}
public function unsetDefaultValue()
{
$this->defaultValue = null;
$this->hasDefaultValue = false;
return $this;
}
/**
* @param boolean $bool
*/
public function setPassedByReference($bool)
{
$this->passedByReference = (Boolean) $bool;
return $this;
}
/**
* @param string $type
*/
public function setType($type)
{
$this->type = $type;
$this->typeBuiltin = BuiltinType::isBuiltIn($type);
return $this;
}
public function getName()
{
return $this->name;
}
public function getDefaultValue()
{
return $this->defaultValue;
}
public function hasDefaultValue()
{
return $this->hasDefaultValue;
}
public function isPassedByReference()
{
return $this->passedByReference;
}
public function getType()
{
return $this->type;
}
public function hasType()
{
return null !== $this->type;
}
public function hasBuiltinType()
{
return $this->typeBuiltin;
}
}
+90
View File
@@ -0,0 +1,90 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
use CG\Core\ReflectionUtils;
/**
* Represents a PHP property.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class PhpProperty extends AbstractPhpMember
{
private $hasDefaultValue = false;
private $defaultValue;
/**
* @param string|null $name
*/
public static function create($name = null)
{
return new static($name);
}
public static function fromReflection(\ReflectionProperty $ref)
{
$property = new static();
$property
->setName($ref->name)
->setStatic($ref->isStatic())
->setVisibility($ref->isPublic() ? self::VISIBILITY_PUBLIC : ($ref->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE))
;
if ($docComment = $ref->getDocComment()) {
$property->setDocblock(ReflectionUtils::getUnindentedDocComment($docComment));
}
$defaultProperties = $ref->getDeclaringClass()->getDefaultProperties();
if (isset($defaultProperties[$ref->name])) {
$property->setDefaultValue($defaultProperties[$ref->name]);
}
return $property;
}
/**
* @param string|false $value
*/
public function setDefaultValue($value)
{
$this->defaultValue = $value;
$this->hasDefaultValue = true;
return $this;
}
public function unsetDefaultValue()
{
$this->hasDefaultValue = false;
$this->defaultValue = null;
return $this;
}
public function hasDefaultValue()
{
return $this->hasDefaultValue;
}
public function getDefaultValue()
{
return $this->defaultValue;
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace CG\Generator;
class RelativePath
{
private $relativePath;
public function __construct($relativePath)
{
$this->relativePath = $relativePath;
}
public function getRelativePath()
{
return $this->relativePath;
}
}
+109
View File
@@ -0,0 +1,109 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Generator;
/**
* A writer implementation.
*
* This may be used to simplify writing well-formatted code.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class Writer
{
private $content = '';
private $indentationSpaces = 4;
private $indentationLevel = 0;
public function indent()
{
$this->indentationLevel += 1;
return $this;
}
public function outdent()
{
$this->indentationLevel -= 1;
if ($this->indentationLevel < 0) {
throw new \RuntimeException('The identation level cannot be less than zero.');
}
return $this;
}
/**
* @param string $content
*/
public function writeln($content)
{
$this->write($content."\n");
return $this;
}
/**
* @param string $content
*/
public function write($content)
{
$lines = explode("\n", $content);
for ($i=0,$c=count($lines); $i<$c; $i++) {
if ($this->indentationLevel > 0
&& !empty($lines[$i])
&& (empty($this->content) || "\n" === substr($this->content, -1))) {
$this->content .= str_repeat(' ', $this->indentationLevel * $this->indentationSpaces);
}
$this->content .= $lines[$i];
if ($i+1 < $c) {
$this->content .= "\n";
}
}
return $this;
}
public function rtrim()
{
$addNl = "\n" === substr($this->content, -1);
$this->content = rtrim($this->content);
if ($addNl) {
$this->content .= "\n";
}
return $this;
}
public function reset()
{
$this->content = '';
$this->indentationLevel = 0;
return $this;
}
public function getContent()
{
return $this->content;
}
}
+156
View File
@@ -0,0 +1,156 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
use CG\Core\NamingStrategyInterface;
use CG\Generator\Writer;
use CG\Generator\PhpMethod;
use CG\Generator\PhpClass;
use CG\Core\AbstractClassGenerator;
/**
* Class enhancing generator implementation.
*
* This class enhances existing classes by generating a proxy and leveraging
* different generator implementation.
*
* There are several built-in generator such as lazy-initializing objects, or
* a generator for creating AOP joinpoints.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class Enhancer extends AbstractClassGenerator
{
private $generatedClass;
private $class;
private $interfaces;
private $generators;
public function __construct(\ReflectionClass $class, array $interfaces = array(), array $generators = array())
{
if (empty($generators) && empty($interfaces)) {
throw new \RuntimeException('Either generators, or interfaces must be given.');
}
$this->class = $class;
$this->interfaces = $interfaces;
$this->generators = $generators;
}
/**
* Creates a new instance of the enhanced class.
*
* @param array $args
* @return object
*/
public function createInstance(array $args = array())
{
$generatedClass = $this->getClassName($this->class);
if (!class_exists($generatedClass, false)) {
eval($this->generateClass());
}
$ref = new \ReflectionClass($generatedClass);
return $ref->newInstanceArgs($args);
}
public function writeClass($filename)
{
if (!is_dir($dir = dirname($filename))) {
if (false === @mkdir($dir, 0777, true)) {
throw new \RuntimeException(sprintf('Could not create directory "%s".', $dir));
}
}
if (!is_writable($dir)) {
throw new \RuntimeException(sprintf('The directory "%s" is not writable.', $dir));
}
file_put_contents($filename, "<?php\n\n".$this->generateClass());
}
/**
* Creates a new enhanced class
*
* @return string
*/
final public function generateClass()
{
static $docBlock;
if (empty($docBlock)) {
$writer = new Writer();
$writer
->writeln('/**')
->writeln(' * CG library enhanced proxy class.')
->writeln(' *')
->writeln(' * This code was generated automatically by the CG library, manual changes to it')
->writeln(' * will be lost upon next generation.')
->write(' */')
;
$docBlock = $writer->getContent();
}
$this->generatedClass = PhpClass::create()
->setDocblock($docBlock)
->setParentClassName($this->class->name)
;
$proxyClassName = $this->getClassName($this->class);
if (false === strpos($proxyClassName, NamingStrategyInterface::SEPARATOR)) {
throw new \RuntimeException(sprintf('The proxy class name must be suffixed with "%s" and an optional string, but got "%s".', NamingStrategyInterface::SEPARATOR, $proxyClassName));
}
$this->generatedClass->setName($proxyClassName);
if (!empty($this->interfaces)) {
$this->generatedClass->setInterfaceNames(array_map(function($v) { return '\\'.$v; }, $this->interfaces));
foreach ($this->getInterfaceMethods() as $method) {
$method = PhpMethod::fromReflection($method);
$method->setAbstract(false);
$this->generatedClass->setMethod($method);
}
}
if (!empty($this->generators)) {
foreach ($this->generators as $generator) {
$generator->generate($this->class, $this->generatedClass);
}
}
return $this->generateCode($this->generatedClass);
}
/**
* Adds stub methods for the interfaces that have been implemented.
*/
protected function getInterfaceMethods()
{
$methods = array();
foreach ($this->interfaces as $interface) {
$ref = new \ReflectionClass($interface);
$methods = array_merge($methods, $ref->getMethods());
}
return $methods;
}
}
+38
View File
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
use CG\Generator\PhpClass;
/**
* Interface for enhancing generators.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface GeneratorInterface
{
/**
* Generates the necessary changes in the class.
*
* @param \ReflectionClass $originalClass
* @param PhpClass $generatedClass The generated class
* @return void
*/
public function generate(\ReflectionClass $originalClass, PhpClass $generatedClass);
}
+118
View File
@@ -0,0 +1,118 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
use CG\Core\ClassUtils;
use CG\Core\ReflectionUtils;
use CG\Generator\PhpParameter;
use CG\Generator\PhpProperty;
use CG\Generator\PhpMethod;
use CG\Generator\PhpClass;
/**
* Interception Generator.
*
* This generator creates joinpoints to allow for AOP advices. Right now, it only
* supports the most powerful around advice.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class InterceptionGenerator implements GeneratorInterface
{
private $prefix = '__CGInterception__';
private $filter;
private $requiredFile;
public function setRequiredFile($file)
{
$this->requiredFile = $file;
}
/**
* @param string $prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
public function setFilter(\Closure $filter)
{
$this->filter = $filter;
}
public function generate(\ReflectionClass $originalClass, PhpClass $genClass)
{
$methods = ReflectionUtils::getOverrideableMethods($originalClass);
if (null !== $this->filter) {
$methods = array_filter($methods, $this->filter);
}
if (empty($methods)) {
return;
}
if (!empty($this->requiredFile)) {
$genClass->addRequiredFile($this->requiredFile);
}
$interceptorLoader = new PhpProperty();
$interceptorLoader
->setName($this->prefix.'loader')
->setVisibility(PhpProperty::VISIBILITY_PRIVATE)
;
$genClass->setProperty($interceptorLoader);
$loaderSetter = new PhpMethod();
$loaderSetter
->setName($this->prefix.'setLoader')
->setVisibility(PhpMethod::VISIBILITY_PUBLIC)
->setBody('$this->'.$this->prefix.'loader = $loader;')
;
$genClass->setMethod($loaderSetter);
$loaderParam = new PhpParameter();
$loaderParam
->setName('loader')
->setType('CG\Proxy\InterceptorLoaderInterface')
;
$loaderSetter->addParameter($loaderParam);
$interceptorCode =
'$ref = new \ReflectionMethod(%s, %s);'."\n"
.'$interceptors = $this->'.$this->prefix.'loader->loadInterceptors($ref, $this, array(%s));'."\n"
.'$invocation = new \CG\Proxy\MethodInvocation($ref, $this, array(%s), $interceptors);'."\n\n"
.'return $invocation->proceed();'
;
foreach ($methods as $method) {
$params = array();
foreach ($method->getParameters() as $param) {
$params[] = '$'.$param->name;
}
$params = implode(', ', $params);
$genMethod = PhpMethod::fromReflection($method)
->setBody(sprintf($interceptorCode, var_export(ClassUtils::getUserClass($method->class), true), var_export($method->name, true), $params, $params))
->setDocblock(null)
;
$genClass->setMethod($genMethod);
}
}
}
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
/**
* Interception Loader.
*
* Implementations of this interface are responsible for loading the interceptors
* for a certain method.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface InterceptorLoaderInterface
{
/**
* Loads interceptors.
*
* @param \ReflectionMethod $method
* @return MethodInterceptorInterface[]
*/
function loadInterceptors(\ReflectionMethod $method);
}
@@ -0,0 +1,156 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
use CG\Generator\Writer;
use CG\Core\ReflectionUtils;
use CG\Generator\GeneratorUtils;
use CG\Generator\PhpParameter;
use CG\Generator\PhpMethod;
use CG\Generator\PhpProperty;
use CG\Generator\PhpClass;
/**
* Generator for creating lazy-initializing instances.
*
* This generator enhances concrete classes to allow for them to be lazily
* initialized upon first access.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class LazyInitializerGenerator implements GeneratorInterface
{
private $writer;
private $prefix = '__CG__';
private $markerInterface;
public function __construct()
{
$this->writer = new Writer();
}
/**
* @param string $prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
/**
* Sets the marker interface which should be implemented by the
* generated classes.
*
* @param string $interface The FQCN of the interface
*/
public function setMarkerInterface($interface)
{
$this->markerInterface = $interface;
}
/**
* Generates the necessary methods in the class.
*
* @param \ReflectionClass $originalClass
* @param PhpClass $class
* @return void
*/
public function generate(\ReflectionClass $originalClass, PhpClass $class)
{
$methods = ReflectionUtils::getOverrideableMethods($originalClass, true);
// no public, non final methods
if (empty($methods)) {
return;
}
if (null !== $this->markerInterface) {
$class->setImplementedInterfaces(array_merge(
$class->getImplementedInterfaces(),
array($this->markerInterface)
));
}
$initializer = new PhpProperty();
$initializer->setName($this->prefix.'lazyInitializer');
$initializer->setVisibility(PhpProperty::VISIBILITY_PRIVATE);
$class->setProperty($initializer);
$initialized = new PhpProperty();
$initialized->setName($this->prefix.'initialized');
$initialized->setDefaultValue(false);
$initialized->setVisibility(PhpProperty::VISIBILITY_PRIVATE);
$class->setProperty($initialized);
$initializerSetter = new PhpMethod();
$initializerSetter->setName($this->prefix.'setLazyInitializer');
$initializerSetter->setBody('$this->'.$this->prefix.'lazyInitializer = $initializer;');
$parameter = new PhpParameter();
$parameter->setName('initializer');
$parameter->setType('\CG\Proxy\LazyInitializerInterface');
$initializerSetter->addParameter($parameter);
$class->setMethod($initializerSetter);
$this->addMethods($class, $methods);
$initializingMethod = new PhpMethod();
$initializingMethod->setName($this->prefix.'initialize');
$initializingMethod->setVisibility(PhpMethod::VISIBILITY_PRIVATE);
$initializingMethod->setBody(
$this->writer
->reset()
->writeln('if (null === $this->'.$this->prefix.'lazyInitializer) {')
->indent()
->writeln('throw new \RuntimeException("'.$this->prefix.'setLazyInitializer() must be called prior to any other public method on this object.");')
->outdent()
->write("}\n\n")
->writeln('$this->'.$this->prefix.'lazyInitializer->initializeObject($this);')
->writeln('$this->'.$this->prefix.'initialized = true;')
->getContent()
);
$class->setMethod($initializingMethod);
}
private function addMethods(PhpClass $class, array $methods)
{
foreach ($methods as $method) {
$initializingCode = 'if (false === $this->'.$this->prefix.'initialized) {'."\n"
.' $this->'.$this->prefix.'initialize();'."\n"
.'}';
if ($class->hasMethod($method->name)) {
$genMethod = $class->getMethod($method->name);
$genMethod->setBody(
$initializingCode."\n"
.$genMethod->getBody()
);
continue;
}
$genMethod = PhpMethod::fromReflection($method);
$genMethod->setBody(
$initializingCode."\n\n"
.'return '.GeneratorUtils::callMethod($method).';'
);
$class->setMethod($genMethod);
}
}
}
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
/**
* Lazy Initializer.
*
* Implementations of this interface are responsible for lazily initializing
* object instances.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface LazyInitializerInterface
{
/**
* Initializes the passed object.
*
* @param object $object
* @return void
*/
public function initializeObject($object);
}
@@ -0,0 +1,42 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
/**
* Interface for Method Interceptors.
*
* Implementations of this interface can execute custom code before, and after the
* invocation of the actual method. In addition, they can also catch, or throw
* exceptions, modify the return value, or modify the arguments.
*
* This is also known as around advice in AOP terminology.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
interface MethodInterceptorInterface
{
/**
* Called when intercepting a method call.
*
* @param MethodInvocation $invocation
* @return mixed the return value for the method invocation
* @throws \Exception may throw any exception
*/
public function intercept(MethodInvocation $invocation);
}
+98
View File
@@ -0,0 +1,98 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
/**
* Represents a method invocation.
*
* This object contains information for the method invocation, such as the object
* on which the method is invoked, and the arguments that are passed to the method.
*
* Before the actual method is called, first all the interceptors must call the
* proceed() method on this class.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class MethodInvocation
{
public $reflection;
public $object;
public $arguments;
private $interceptors;
private $pointer;
public function __construct(\ReflectionMethod $reflection, $object, array $arguments, array $interceptors)
{
$this->reflection = $reflection;
$this->object = $object;
$this->arguments = $arguments;
$this->interceptors = $interceptors;
$this->pointer = 0;
}
public function getNamedArgument($name)
{
foreach ($this->reflection->getParameters() as $i => $param) {
if ($param->name !== $name) {
continue;
}
if ( ! array_key_exists($i, $this->arguments)) {
if ($param->isDefaultValueAvailable()) {
return $param->getDefaultValue();
}
throw new \RuntimeException(sprintf('There was no value given for parameter "%s".', $param->name));
}
return $this->arguments[$i];
}
throw new \InvalidArgumentException(sprintf('The parameter "%s" does not exist.', $name));
}
/**
* Proceeds down the call-chain and eventually calls the original method.
*
* @return mixed
*/
public function proceed()
{
if (isset($this->interceptors[$this->pointer])) {
return $this->interceptors[$this->pointer++]->intercept($this);
}
$this->reflection->setAccessible(true);
return $this->reflection->invokeArgs($this->object, $this->arguments);
}
/**
* Returns a string representation of the method.
*
* This is intended for debugging purposes only.
*
* @return string
*/
public function __toString()
{
return sprintf('%s::%s', $this->reflection->class, $this->reflection->name);
}
}
@@ -0,0 +1,48 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace CG\Proxy;
class RegexInterceptionLoader implements InterceptorLoaderInterface
{
private $interceptors;
public function __construct(array $interceptors = array())
{
$this->interceptors = $interceptors;
}
public function loadInterceptors(\ReflectionMethod $method)
{
$signature = $method->class.'::'.$method->name;
$matchingInterceptors = array();
foreach ($this->interceptors as $pattern => $interceptor) {
if (preg_match('#'.$pattern.'#', $signature)) {
$matchingInterceptors[] = $this->initializeInterceptor($interceptor);
}
}
return $matchingInterceptors;
}
protected function initializeInterceptor($interceptor)
{
return $interceptor;
}
}
+8
View File
@@ -0,0 +1,8 @@
<?php
namespace CG;
class Version
{
const VERSION = '1.1.0-DEV';
}
@@ -0,0 +1,14 @@
<?php
namespace CG\Tests\Core;
use CG\Core\ClassUtils;
class ClassUtilsTest extends \PHPUnit_Framework_TestCase
{
public function testGetUserClassName()
{
$this->assertEquals('Foo', ClassUtils::getUserClass('Foo'));
$this->assertEquals('Bar', ClassUtils::getUserClass('FOO\__CG__\Bar'));
}
}
@@ -0,0 +1,71 @@
<?php
namespace CG\Tests\Core;
use CG\Core\DefaultGeneratorStrategy;
use CG\Generator\PhpProperty;
use CG\Generator\PhpMethod;
use CG\Generator\PhpClass;
class DefaultGeneratorStrategyTest extends \PHPUnit_Framework_TestCase
{
public function testGenerate()
{
$strategy = new DefaultGeneratorStrategy();
$strategy->setConstantSortFunc(function($a, $b) {
return strcasecmp($a, $b);
});
$strategy->setMethodSortFunc($func = function($a, $b) {
return strcasecmp($a->getName(), $b->getName());
});
$strategy->setPropertySortFunc($func);
$this->assertEquals(
$this->getContent('GenerationTestClass_A.php'),
$strategy->generate($this->getClass())
);
}
public function testGenerateChangedConstantOrder()
{
$strategy = new DefaultGeneratorStrategy();
$strategy->setConstantSortFunc(function($a, $b) {
return -1 * strcasecmp($a, $b);
});
$strategy->setMethodSortFunc($func = function($a, $b) {
return strcasecmp($a->getName(), $b->getName());
});
$strategy->setPropertySortFunc($func);
$this->assertEquals(
$this->getContent('GenerationTestClass_B.php'),
$strategy->generate($this->getClass())
);
}
/**
* @param string $file
*/
private function getContent($file)
{
return file_get_contents(__DIR__.'/generated/'.$file);
}
/**
* @return PhpClass
*/
private function getClass()
{
$class = PhpClass::create()
->setName('GenerationTestClass')
->setMethod(PhpMethod::create('a'))
->setMethod(PhpMethod::create('b'))
->setProperty(PhpProperty::create('a'))
->setProperty(PhpProperty::create('b'))
->setConstant('a', 'foo')
->setConstant('b', 'bar')
;
return $class;
}
}
@@ -0,0 +1,48 @@
<?php
namespace CG\Tests\Core;
use CG\Generator\Writer;
use CG\Core\ReflectionUtils;
class ReflectionUtilsTest extends \PHPUnit_Framework_TestCase
{
public function testGetOverridableMethods()
{
$ref = new \ReflectionClass('CG\Tests\Core\OverridableReflectionTest');
$methods = ReflectionUtils::getOverrideableMethods($ref);
$this->assertEquals(4, count($methods));
$methods = array_map(function($v) { return $v->name; }, $methods);
sort($methods);
$this->assertEquals(array('a', 'd', 'e', 'h'), $methods);
}
public function testGetUnindentedDocComment()
{
$writer = new Writer();
$comment = $writer
->writeln('/**')
->indent()
->writeln(' * Foo.')
->write(' */')
->getContent()
;
$this->assertEquals("/**\n * Foo.\n */", ReflectionUtils::getUnindentedDocComment($comment));
}
}
abstract class OverridableReflectionTest
{
public function a() { }
final public function b() { }
public static function c() { }
abstract public function d();
protected function e() { }
final protected function f() {}
protected static function g() { }
abstract protected function h();
private function i() { }
}
@@ -0,0 +1,16 @@
class GenerationTestClass
{
const a = 'foo';
const b = 'bar';
public $a;
public $b;
public function a()
{
}
public function b()
{
}
}
@@ -0,0 +1,16 @@
class GenerationTestClass
{
const b = 'bar';
const a = 'foo';
public $a;
public $b;
public function a()
{
}
public function b()
{
}
}
@@ -0,0 +1,58 @@
<?php
namespace CG\Tests\Generator;
class AbstractPhpMemberTest extends \PHPUnit_Framework_TestCase
{
public function testSetGetStatic()
{
$member = $this->getMember();
$this->assertFalse($member->isStatic());
$this->assertSame($member, $member->setStatic(true));
$this->assertTrue($member->isStatic());
$this->assertSame($member, $member->setStatic(false));
$this->assertFalse($member->isStatic());
}
public function testSetGetVisibility()
{
$member = $this->getMember();
$this->assertEquals('public', $member->getVisibility());
$this->assertSame($member, $member->setVisibility('private'));
$this->assertEquals('private', $member->getVisibility());
}
/**
* @expectedException \InvalidArgumentException
*/
public function testSetVisibilityThrowsExOnInvalidValue()
{
$member = $this->getMember();
$member->setVisibility('foo');
}
public function testSetGetName()
{
$member = $this->getMember();
$this->assertNull($member->getName());
$this->assertSame($member, $member->setName('foo'));
$this->assertEquals('foo', $member->getName());
}
public function testSetGetDocblock()
{
$member = $this->getMember();
$this->assertNull($member->getDocblock());
$this->assertSame($member, $member->setDocblock('foo'));
$this->assertEquals('foo', $member->getDocblock());
}
private function getMember()
{
return $this->getMockForAbstractClass('CG\Generator\AbstractPhpMember');
}
}
@@ -0,0 +1,133 @@
<?php
namespace CG\Tests\Generator;
use CG\Core\DefaultGeneratorStrategy;
use CG\Generator\DefaultVisitor;
use CG\Generator\PhpMethod;
use CG\Generator\PhpParameter;
use CG\Generator\PhpClass;
use CG\Generator\Writer;
use CG\Generator\PhpFunction;
class DefaultVisitorTest extends \PHPUnit_Framework_TestCase
{
public function testVisitFunction()
{
$writer = new Writer();
$function = new PhpFunction();
$function
->setName('foo')
->addParameter(PhpParameter::create('a'))
->addParameter(PhpParameter::create('b'))
->setBody(
$writer
->writeln('if ($a === $b) {')
->indent()
->writeln('throw new \InvalidArgumentException(\'$a is not allowed to be the same as $b.\');')
->outdent()
->write("}\n\n")
->write('return $b;')
->getContent()
)
;
$visitor = new DefaultVisitor();
$visitor->visitFunction($function);
$this->assertEquals($this->getContent('a_b_function.php'), $visitor->getContent());
}
public function testVisitMethod()
{
$method = new PhpMethod();
$visitor = new DefaultVisitor();
$method
->setName('foo')
->setReferenceReturned(true);
$visitor->visitMethod($method);
$this->assertEquals($this->getContent('reference_returned_method.php'), $visitor->getContent());
}
public function testVisitMethodWithCallable()
{
if (PHP_VERSION_ID < 50400) {
$this->markTestSkipped('`callable` is only supported in PHP >=5.4.0');
}
$method = new PhpMethod();
$parameter = new PhpParameter('bar');
$parameter->setType('callable');
$method
->setName('foo')
->addParameter($parameter);
$visitor = new DefaultVisitor();
$visitor->visitMethod($method);
$this->assertEquals($this->getContent('callable_parameter.php'), $visitor->getContent());
}
public function testVisitClassWithPhp7Features()
{
if (PHP_VERSION_ID < 70000) {
$this->markTestSkipped('Test only valid for PHP >=7.0');
}
$ref = new \ReflectionClass('CG\Tests\Generator\Fixture\EntityPhp7');
$class = PhpClass::fromReflection($ref);
$generator = new DefaultGeneratorStrategy();
$content = $generator->generate($class);
$this->assertEquals($this->getContent('php7_class.php'), $content);
}
/**
* @dataProvider visitFunctionWithPhp7FeaturesDataProvider
*/
public function testVisitFunctionWithPhp7Features($filename, $function)
{
if (PHP_VERSION_ID < 70000) {
$this->markTestSkipped('Test only valid for PHP >=7.0');
}
$visitor = new DefaultVisitor();
$visitor->visitFunction($function);
$this->assertEquals($this->getContent($filename.'.php'), $visitor->getContent());
}
public function visitFunctionWithPhp7FeaturesDataProvider()
{
$builtinReturn = PhpFunction::create('foo')
->setReturnType('bool');
$nonbuiltinReturn = PhpFunction::create('foo')
->setReturnType('\Foo');
return array(
array('php7_builtin_return', $builtinReturn),
array('php7_func_nonbuiltin_return', $nonbuiltinReturn),
);
}
/**
* @param string $filename
*/
private function getContent($filename)
{
if (!is_file($path = __DIR__.'/Fixture/generated/'.$filename)) {
throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $path));
}
return file_get_contents($path);
}
}
@@ -0,0 +1,35 @@
<?php
namespace CG\Tests\Generator\Fixture;
/**
* Doc Comment.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class Entity
{
/**
* @var integer
*/
private $id;
private $enabled = false;
/**
* Another doc comment.
*
* @param unknown_type $a
* @param array $b
* @param \stdClass $c
* @param string $d
*/
final public function __construct($a, array &$b, \stdClass $c, $d = 'foo')
{
}
abstract protected function foo();
private static function bar()
{
}
}
@@ -0,0 +1,71 @@
<?php
namespace CG\Tests\Generator\Fixture;
use \DateTime;
use CG\Tests\Generator\Fixture\SubFixture\Foo;
use CG\Tests\Generator\Fixture\SubFixture as Sub;
/**
* Doc Comment.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class EntityPhp7
{
/**
* @var integer
*/
private $id = 0;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
* @return EntityPhp7
*/
public function setId(int $id = null): self
{
$this->id = $id;
return $this;
}
public function getTime(): DateTime
{
}
public function getTimeZone(): \DateTimeZone
{
}
public function setTime(DateTime $time)
{
}
public function setTimeZone(\DateTimeZone $timezone)
{
}
public function setArray(array &$array = null): array
{
}
public function getFoo(): Foo
{
}
public function getBar(): Sub\Bar
{
}
public function getBaz(): \CG\Tests\Generator\Fixture\SubFixture\Baz
{
}
}
@@ -0,0 +1,5 @@
<?php
namespace CG\Tests\Generator\Fixture\SubFixture;
class Bar {}
@@ -0,0 +1,5 @@
<?php
namespace CG\Tests\Generator\Fixture\SubFixture;
class Baz {}

Some files were not shown because too many files have changed in this diff Show More