-
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
Version upgrades #59
Changes from 9 commits
ff89696
97dc7f7
5d0b0ed
4289618
c34f354
8d9301d
9bbb8d1
2b945bc
8482b4e
c2912a1
6296251
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
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=dev-master | ||
|
||
|
||
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=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_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 | ||
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} | ||
- COMPOSER_ROOT_VERSION=dev-master composer update $COMPOSER_FLAGS --prefer-source --no-interaction | ||
- vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh | ||
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. I prefer to use things the correct way: 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: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh 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. honestly I just wanted the PR to be rebased and the install part to work .. |
||
|
||
script: phpunit --coverage-text | ||
|
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') | ||
; | ||
} | ||
} |
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.
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?