D2 workflows #407

Closed
wants to merge 2,573 commits into
from

Conversation

Projects
None yet
10 participants
@paustian
Contributor

paustian commented May 11, 2012

My attempt at updating workflows to Doctrine 2.

Drak and others added some commits Apr 13, 2012

Drak
Merge remote-tracking branch 'origin/release-1.3'
Resolved conflicts with:
	src/util/ModUtil.php
	web/system/Admin/Api/AdminApi.php
	web/system/Search/Controller/UserController.php
Drak
Switch database initialisation to DoctrineBundle.
Please note the service has changed from $container->get('doctrine.entitymanager')
to $container->get('doctrine')->getEntityManager();

I don't understand why we need to add all these namespaces to the annotations driver
because our own DoctrineListener doesn't need it.  For another day though...
Drak
Merge pull request #302 from matheo/plugin_img
Update the plugin img to support the new core elements
added simple implementation of a module system
Modules == Symfony bundles
Custom kernel loads active modules from DB. This custom kernel add bundles to the bundle list *before* symfony's bundle loading starts.
A custom routing loader automatically add modules routes (controllers of modules have to use annotations).
switch to new bundle loading approach
Zikula kernel loads all bundles (modules and themes) every time.
A custom event dispatcher skipps service listeners of inactive modules.
A custom controller resolver skipps controllers of inactive modules.
A container builder sandbox forbidds taggs other than 'kernel.event_listener'.
Drak
Coding standards.
Removed whitespace
Fixed braces
Fixed line-spacing
Class naming standards
Drak
Merge pull request #346 from nmpetkov/Ticket_346
Function to clears all view cache for a module

Drak and others added some commits Apr 29, 2012

Drak
Merge pull request #391 from phaidon/fix2
Deactivate file based shorturls during upgrade, closes #248.
Drak
Fixed upgrade path.
Since the Blocks module API was refactored to Doctrine 2 this
API returns Doctrine 2 entities and not an array for use with DBUtil.
Added the changes as I see them for workflow. I need to get 1.4 up an…
…d running and then be able to debug the code to make sure it does what it is supposed to.
Updated the install directions adding information for using MAMP.
There is a Working version of Util.php with the Doctrine Code now.
Code is added to Workflow to use Doctrine 2. Testing of adding workflows still needed, but the code has been tested to actually delete things form the database.
I also added a few files to ignore including .DS_Storeto .gitignore. I work on a mac system
Updated the install directions adding information for using MAMP.
There is a Working version of Util.php with the Doctrine Code now.
Code is added to Workflow to use Doctrine 2. Testing of adding workflows still needed, but the code has been tested to actually delete things form the database.
I also added a few files to ignore including .DS_Store. I work on a mac system
@ghost

View changes

README.md
+ - Install vendors with `php composer.phar install`
+ If you are using MAMP on a mac, you will need the full path to php
+ /Applications/MAMP/bin/php/php5.3.6/bin/php install-composer.php
+ /Applications/MAMP/bin/php/php5.3.6/bin/php composer.phar install

This comment has been minimized.

@ghost

ghost May 11, 2012

This is too version specific. /path/to/php would be better.

@ghost

ghost May 11, 2012

This is too version specific. /path/to/php would be better.

This comment has been minimized.

@paustian

paustian May 11, 2012

Contributor

I made it more general.

@paustian

paustian May 11, 2012

Contributor

I made it more general.

+/app/config/database.yml
+/app/console
+/web/.htaccess
+.DS_Store

This comment has been minimized.

@ghost

ghost May 11, 2012

These additions are not OK. The additions of the netbeans ignores and DS_Store should be added to your local git settings global ignore - see http://help.github.com/ignore-files/

@ghost

ghost May 11, 2012

These additions are not OK. The additions of the netbeans ignores and DS_Store should be added to your local git settings global ignore - see http://help.github.com/ignore-files/

This comment has been minimized.

@paustian

paustian May 11, 2012

Contributor

.gitignore deleted and global ignore created.

@paustian

paustian May 11, 2012

Contributor

.gitignore deleted and global ignore created.

@ghost

View changes

src/legacy/Zikula/Workflow/Util.php
@@ -367,6 +380,7 @@ public static function getWorkflowForObject(&$obj, $dbTable, $idcolumn = 'id', $
}
// attach workflow to object
+ //I should be able to dump this since I am using doctrine

This comment has been minimized.

@ghost

ghost May 11, 2012

Please remove personal comments/notes.

@ghost

ghost May 11, 2012

Please remove personal comments/notes.

@ghost

View changes

src/legacy/Zikula/Workflow/Util.php
@@ -349,14 +355,21 @@ public static function getWorkflowForObject(&$obj, $dbTable, $idcolumn = 'id', $
if (!empty($obj[$idcolumn])) {
// get workflow data from DB
- $dbtables = DBUtil::getTables();
+ $dbtables = ServiceUtil::getManager()->getParameter('dbtables');

This comment has been minimized.

@ghost

ghost May 11, 2012

This lookup should be removed as it relates to tables.php which is being removed.

@ghost

ghost May 11, 2012

This lookup should be removed as it relates to tables.php which is being removed.

This comment has been minimized.

@paustian

paustian May 12, 2012

Contributor

Done

@paustian

paustian May 12, 2012

Contributor

Done

This comment has been minimized.

@ghost

ghost May 12, 2012

Did you push the changes yet?

@ghost

ghost May 12, 2012

Did you push the changes yet?

@tfotis

View changes

README.md
- The username and password are `admin` / `zikula1`
+ - Install the database manually from `docs/installation.sql`.
+ If you are using phpmyadmin, you can copy and paste into an SQL field and just hit go. Make sure you
+ have created the database and you are in the correct database.

This comment has been minimized.

@tfotis

tfotis May 12, 2012

Member

imo, if using phpmyadmin, it's better to use the import function.

@tfotis

tfotis May 12, 2012

Member

imo, if using phpmyadmin, it's better to use the import function.

@tfotis

View changes

src/legacy/Zikula/Workflow/Util.php
+ //This is a static function, so we have to user ServiceUtil to get the entity manager
+ $em = ServiceUtil::getManager()->get('doctrine')->getEntityManager();
+ //crete the dql query.
+ $dql = "DELETE Zikula\Core\Doctrine\Entity\Workflows w WHERE w.module = '$module'";

This comment has been minimized.

@tfotis

tfotis May 12, 2012

Member

some extra spaces here :)

@tfotis

tfotis May 12, 2012

Member

some extra spaces here :)

@paustian

View changes

app/config/core_legacy.yml
@@ -17,7 +17,7 @@ System:
dbcache.cache_result: 0
dbcache.cache_result_ttl: 30
DBInfo:
- databases: { default: { host: localhost, user: root, password: '', dbname: z140, dbdriver: mysql, dbtabletype: myisam, charset: utf8, collate: utf8_general_ci } }
+ databases: { default: { host: localhost, user: root, password: root, dbname: zikula_1_4, dbdriver: mysql, dbtabletype: myisam, charset: utf8, collate: utf8_general_ci } }
Debug:
error_reporting_development: 30719
error_reporting_production: 30709

This comment has been minimized.

@paustian

paustian May 12, 2012

Contributor

Grr. These are in my ignore file. WHY DID THEY GET PUSHED???

@paustian

paustian May 12, 2012

Contributor

Grr. These are in my ignore file. WHY DID THEY GET PUSHED???

@paustian

This comment has been minimized.

Show comment
Hide comment
@paustian

paustian May 13, 2012

Contributor

Ugh, this became a mess. Learning git still

Contributor

paustian commented May 13, 2012

Ugh, this became a mess. Learning git still

@paustian paustian closed this May 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment