-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version upgrades #59
Closed
Closed
Version upgrades #59
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ff89696
Version upgrade and adjust to naming conventions. Use standard storag…
97dc7f7
Fix
dantleech 5d0b0ed
Update bundle to current cmf
4289618
cleanup and cs fixer
dbu c34f354
renamed rdf mapping file
lsmith77 8d9301d
tweaked travis setup
lsmith77 9bbb8d1
relax symfony-cmf/testing requirement
lsmith77 2b945bc
allow dev packages
lsmith77 8482b4e
udpated composer and travis
lsmith77 c2912a1
fix assertion order
dbu 6296251
cleanup travis yml
dbu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Tests/Resources/app/cache | ||
Tests/Resources/app/logs | ||
bin/ | ||
composer.lock | ||
vendor | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
|
||
env: | ||
- SYMFONY_VERSION=2.5.* | ||
- SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak | ||
|
||
matrix: | ||
allow_failures: | ||
- env: SYMFONY_VERSION=dev-master | ||
include: | ||
- php: 5.3 | ||
env: SYMFONY_VERSION=2.3.* COMPOSER_FLAGS="--prefer-lowest" | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=2.3.* | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=2.4.* | ||
env: SYMFONY_VERSION=2.6.* | ||
- php: 5.5 | ||
env: SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one is no longer needed as it's the default env |
||
- php: 5.5 | ||
env: SYMFONY_VERSION=dev-master | ||
|
||
env: SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing allowed failures for:
|
||
|
||
before_install: | ||
- composer self-update || true | ||
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;' | ||
- composer require --no-update symfony/symfony:${SYMFONY_VERSION} | ||
|
||
install: COMPOSER_ROOT_VERSION=dev-master composer update $COMPOSER_FLAGS --prefer-source --no-interaction | ||
|
||
before_script: | ||
- composer self-update | ||
- echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
- composer require symfony/symfony:${SYMFONY_VERSION} --prefer-source | ||
- vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh | ||
before_script: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh | ||
|
||
script: phpunit --coverage-text | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,15 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
|
||
namespace Symfony\Cmf\Bundle\BlogBundle\Admin; | ||
|
||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Sonata\AdminBundle\Datagrid\DatagridMapper; | ||
use Sonata\AdminBundle\Validator\ErrorElement; | ||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin; | ||
use Symfony\Cmf\Bundle\BlogBundle\Form\PostType; | ||
use Symfony\Cmf\Bundle\BlogBundle\Routing\BlogRouteManager; | ||
|
||
/** | ||
* Blog Admin | ||
* Blog Admin. | ||
* | ||
* @author Daniel Leech <[email protected]> | ||
*/ | ||
|
@@ -30,33 +26,46 @@ class BlogAdmin extends Admin | |
protected $translationDomain = 'CmfBlogBundle'; | ||
protected $blogRoot; | ||
|
||
protected function configureFormFields(FormMapper $mapper) | ||
{ | ||
$mapper->add('name', 'text'); | ||
$mapper->add('parent', 'doctrine_phpcr_odm_tree', array( | ||
'root_node' => $this->blogRoot, | ||
'choice_list' => array(), | ||
'select_root_node' => true) | ||
); | ||
} | ||
|
||
protected function configureDatagridFilters(DatagridMapper $dm) | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $code | ||
* @param string $class | ||
* @param string $baseControllerName | ||
* @param string $blogRoot | ||
*/ | ||
public function __construct($code, $class, $baseControllerName, $blogRoot) | ||
{ | ||
$dm->add('name', 'doctrine_phpcr_string'); | ||
parent::__construct($code, $class, $baseControllerName); | ||
$this->blogRoot = $blogRoot; | ||
} | ||
|
||
protected function configureListFields(ListMapper $dm) | ||
protected function configureFormFields(FormMapper $formMapper) | ||
{ | ||
$dm->addIdentifier('name'); | ||
$formMapper | ||
->with('dashboard.label_blog') | ||
->add('name', 'text') | ||
->add('description', 'textarea') | ||
->add('parentDocument', 'doctrine_phpcr_odm_tree', array( | ||
'root_node' => $this->blogRoot, | ||
'choice_list' => array(), | ||
'select_root_node' => true, | ||
)) | ||
->end() | ||
; | ||
} | ||
|
||
public function setBlogRoot($blogRoot) | ||
protected function configureDatagridFilters(DatagridMapper $filterMapper) | ||
{ | ||
$this->blogRoot = $blogRoot; | ||
$filterMapper | ||
->add('name', 'doctrine_phpcr_string') | ||
; | ||
} | ||
|
||
public function validate(ErrorElement $ee, $obj) | ||
protected function configureListFields(ListMapper $listMapper) | ||
{ | ||
$ee->with('name')->assertNotBlank()->end(); | ||
$listMapper | ||
->addIdentifier('name') | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,65 +9,67 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
|
||
namespace Symfony\Cmf\Bundle\BlogBundle\Admin; | ||
|
||
use Sonata\AdminBundle\Datagrid\ListMapper; | ||
use Sonata\AdminBundle\Datagrid\DatagridMapper; | ||
use Sonata\AdminBundle\Validator\ErrorElement; | ||
use Sonata\AdminBundle\Form\FormMapper; | ||
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin; | ||
use Symfony\Cmf\Bundle\BlogBundle\Form\PostType; | ||
use Symfony\Cmf\Bundle\BlogBundle\Form\DataTransformer\CsvToArrayTransformer; | ||
|
||
/** | ||
* Post Admin | ||
* Post Admin. | ||
* | ||
* @author Daniel Leech <[email protected]> | ||
*/ | ||
class PostAdmin extends Admin | ||
{ | ||
protected $translationDomain = 'CmfBlogBundle'; | ||
protected $blogClass; | ||
|
||
protected function configureFormFields(FormMapper $mapper) | ||
/** | ||
* Constructor. | ||
* | ||
* @param string $code | ||
* @param string $class | ||
* @param string $baseControllerName | ||
* @param string $blogClass | ||
*/ | ||
public function __construct($code, $class, $baseControllerName, $blogClass) | ||
{ | ||
// @todo: I think this would be better as a service, | ||
// but I don't know how integrate the form | ||
// AND have all the Sonata magic from the | ||
// FormMapper->add method. | ||
|
||
// $csvToArrayTransformer = new CsvToArrayTransformer; | ||
|
||
$mapper->add('title'); | ||
$mapper->add('date', 'datetime', array( | ||
'widget' => 'single_text', | ||
)); | ||
|
||
$mapper->add('body', 'textarea'); | ||
$mapper->add('blog', 'phpcr_document', array( | ||
'class' => 'Symfony\Cmf\Bundle\BlogBundle\Document\Blog', | ||
)); | ||
|
||
//$tags = $mapper->create('tags', 'text') | ||
// ->addModelTransformer($csvToArrayTransformer); | ||
|
||
// $mapper->add($tags); | ||
parent::__construct($code, $class, $baseControllerName); | ||
$this->blogClass = $blogClass; | ||
} | ||
|
||
protected function configureDatagridFilters(DatagridMapper $dm) | ||
protected function configureFormFields(FormMapper $formMapper) | ||
{ | ||
$dm->add('title', 'doctrine_phpcr_string'); | ||
$formMapper | ||
->with('dashboard.label_post') | ||
->add('title') | ||
->add('date', 'datetime', array( | ||
'widget' => 'single_text', | ||
)) | ||
->add('bodyPreview', 'textarea') | ||
->add('body', 'textarea') | ||
->add('blog', 'phpcr_document', array( | ||
'class' => $this->blogClass, | ||
)) | ||
->end() | ||
; | ||
} | ||
|
||
protected function configureListFields(ListMapper $dm) | ||
protected function configureDatagridFilters(DatagridMapper $filterMapper) | ||
{ | ||
$dm->add('blog'); | ||
$dm->add('date', 'datetime'); | ||
$dm->addIdentifier('title'); | ||
$filterMapper | ||
->add('title', 'doctrine_phpcr_string') | ||
; | ||
} | ||
|
||
public function validate(ErrorElement $ee, $obj) | ||
protected function configureListFields(ListMapper $listMapper) | ||
{ | ||
$ee->with('title')->assertNotBlank()->end(); | ||
$listMapper | ||
->addIdentifier('title') | ||
->add('blog') | ||
->add('date', 'datetime') | ||
; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure we removed all deprecated usages from this bundle?