[Beeframework-svn] SF.net SVN: beeframework:[43] trunk
Brought to you by:
b_hartmann,
m_plomer
From: <m_p...@us...> - 2013-06-28 17:29:49
|
Revision: 43 http://sourceforge.net/p/beeframework/code/43 Author: m_plomer Date: 2013-06-28 17:29:46 +0000 (Fri, 28 Jun 2013) Log Message: ----------- - removed proprietary parts from SF Removed Paths: ------------- trunk/examples/bootstrap.php trunk/examples/classes/Persistence/ trunk/examples/classes/Treetest/ trunk/examples/cli-config.php trunk/examples/composer.json trunk/examples/conf/ trunk/examples/index.php trunk/examples/index2.php trunk/framework/Bee/Persistence/Behaviors/ trunk/framework/Bee/Persistence/Doctrine/Behaviors/ trunk/framework/Bee/Persistence/Doctrine2/Behaviors/ trunk/framework/Bee/Persistence/Pdo/Behaviors/ trunk/tests/Bee/Persistence/Behaviors/ Deleted: trunk/examples/bootstrap.php =================================================================== --- trunk/examples/bootstrap.php 2013-06-28 14:49:43 UTC (rev 42) +++ trunk/examples/bootstrap.php 2013-06-28 17:29:46 UTC (rev 43) @@ -1,49 +0,0 @@ -<?php -/* - * Copyright 2008-2010 the original author or authors. - * - * 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. - */ - -/** - * User: mp - * Date: 21.06.13 - * Time: 14:15 - */ - -unlink('db/examples.sqlite'); - -require_once '../framework/Bee/Framework.php'; -require_once 'vendor/autoload.php'; - -// Verzeichnis mit Applikations-Klassen zum Classpath hinzufügen -Bee_Framework::addApplicationIncludePath('classes'); - -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/helpers'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/pattern'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/layouts'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/appenders'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/configurators'); -Bee_Framework::addApplicationIncludePath('../libs/apache-log4php-2.3.0/renderers'); - -Logger::configure('conf/log4php.xml'); - -$ctx = new Bee_Context_Xml('conf/context.xml'); - -$conn = $ctx->getBean('pdoConnection'); - -$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -// obtaining the entity manager -$entityManager = $ctx->getBean('entityManager'); Deleted: trunk/examples/cli-config.php =================================================================== --- trunk/examples/cli-config.php 2013-06-28 14:49:43 UTC (rev 42) +++ trunk/examples/cli-config.php 2013-06-28 17:29:46 UTC (rev 43) @@ -1,26 +0,0 @@ -<?php -/* - * Copyright 2008-2010 the original author or authors. - * - * 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. - */ - -/** - * User: mp - * Date: 21.06.13 - * Time: 14:40 - */ - -require_once "bootstrap.php"; - -$helperSet = $ctx->getBean('cliHelperSet'); Deleted: trunk/examples/composer.json =================================================================== --- trunk/examples/composer.json 2013-06-28 14:49:43 UTC (rev 42) +++ trunk/examples/composer.json 2013-06-28 17:29:46 UTC (rev 43) @@ -1,7 +0,0 @@ -{ - "require": { - "doctrine/orm": "~2.3@stable", - "doctrine/doctrine1": "~1.2@stable" - }, - "minimum-stability": "dev" -} \ No newline at end of file Deleted: trunk/examples/index.php =================================================================== --- trunk/examples/index.php 2013-06-28 14:49:43 UTC (rev 42) +++ trunk/examples/index.php 2013-06-28 17:29:46 UTC (rev 43) @@ -1,161 +0,0 @@ -<?php -/* - * Copyright 2008-2010 the original author or authors. - * - * 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. - */ - -/** - * User: mp - * Date: 07.05.13 - * Time: 12:25 - */ - -require_once('bootstrap.php'); - -use Persistence\Pdo\SimpleHierarchyDao; -use Persistence\Pdo\OrderedColorsDao as OrderedColorsDaoPdo; -use Persistence\Doctrine\OrderedColorsDao as OrderedColorsDaoDoctrine; - -/* - * == EXAMPLE : Ordered Dao (PDO) ============================================= - */ -$dao = $ctx->getBean('orderedColorsDaoPdo'); - -$dao->createTable(); -$dao->deleteAllColors(); - -$redId = $dao->addColor('Red', '#ff0000', 1); -$greenId = $dao->addColor('Green', '#00ff00', 1); -$blueId = $dao->addColor('Blue', '#0000ff', 1); -$dao->addColor('Yellow', '#ffff00', 1); -$purpleId = $dao->addColor('Purple', '#ff00ff', 1); -$cyanId = $dao->addColor('Cyan', '#00ffff', 1); - -$redId2 = $dao->addColor('Red2', '#ff0000', 2); -$greenId2 = $dao->addColor('Green2', '#00ff00', 2); -$blueId2 = $dao->addColor('Blue2', '#0000ff', 2); -$yellowId2 = $dao->addColor('Yellow2', '#ffff00', 2); - -$dao->doInTransaction(function(OrderedColorsDaoPdo $dao, \Logger $log) use ($greenId, $purpleId) { - $dao->getOrderedStrategy()->moveAfter($greenId, $purpleId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoPdo $dao, \Logger $log) use ($redId, $cyanId) { - $dao->getOrderedStrategy()->moveAfter($redId, $cyanId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoPdo $dao, \Logger $log) use ($purpleId, $redId) { - $dao->getOrderedStrategy()->moveBefore($purpleId, $redId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoPdo $dao, \Logger $log) use ($blueId) { - $dao->getOrderedStrategy()->remove($blueId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoPdo $dao, \Logger $log) use ($redId) { - $dao->getOrderedStrategy()->remove($redId); -}); - -/* - * == EXAMPLE : Ordered Dao (Doctrine) ============================================= - */ -$dao = $ctx->getBean('orderedColorsDaoDoctrine'); - -$dao->createTable(); -$dao->deleteAllColors(); - -$redId = $dao->addColor('Red', '#ff0000', 1); -$greenId = $dao->addColor('Green', '#00ff00', 1); -$blueId = $dao->addColor('Blue', '#0000ff', 1); -$dao->addColor('Yellow', '#ffff00', 1); -$purpleId = $dao->addColor('Purple', '#ff00ff', 1); -$cyanId = $dao->addColor('Cyan', '#00ffff', 1); - -$redId2 = $dao->addColor('Red2', '#ff0000', 2); -$greenId2 = $dao->addColor('Green2', '#00ff00', 2); -$blueId2 = $dao->addColor('Blue2', '#0000ff', 2); -$yellowId2 = $dao->addColor('Yellow2', '#ffff00', 2); - -$dao->doInTransaction(function(OrderedColorsDaoDoctrine $dao, \Logger $log) use ($greenId, $purpleId) { - $dao->getOrderedStrategy()->moveAfter($greenId, $purpleId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoDoctrine $dao, \Logger $log) use ($redId, $cyanId) { - $dao->getOrderedStrategy()->moveAfter($redId, $cyanId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoDoctrine $dao, \Logger $log) use ($purpleId, $redId) { - $dao->getOrderedStrategy()->moveBefore($purpleId, $redId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoDoctrine $dao, \Logger $log) use ($blueId) { - $dao->getOrderedStrategy()->remove($blueId); -}); - -$dao->doInTransaction(function(OrderedColorsDaoDoctrine $dao, \Logger $log) use ($redId) { - $dao->getOrderedStrategy()->remove($redId); -}); - -/* - * == EXAMPLE : NestedSet Dao ============================================= - */ -$dao = $ctx->getBean('simpleHierarchyDao'); - -$dao->createTable(); -$dao->deleteAll(); - -$id1 = $dao->addEntry('Entry 1'); -$id2 = $dao->addEntry('Entry 2'); -$id3 = $dao->addEntry('Entry 3'); -$id4 = $dao->addEntry('Entry 4'); -$id5 = $dao->addEntry('Entry 5'); -$id6 = $dao->addEntry('Entry 6'); -$id7 = $dao->addEntry('Entry 7'); -$id8 = $dao->addEntry('Entry 8'); -$id9 = $dao->addEntry('Entry 9'); - - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id9, $id1) { - $dao->getNestedSetStrategy()->moveBefore($id9, $id1); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id5, $id4) { - $dao->getNestedSetStrategy()->moveAsFirstChild($id5, $id4); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id6, $id4) { - $dao->getNestedSetStrategy()->moveAsFirstChild($id6, $id4); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id8, $id6) { - $dao->getNestedSetStrategy()->moveAsLastChild($id8, $id6); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id1, $id8) { - $dao->getNestedSetStrategy()->moveAfter($id1, $id8); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id6) { - $dao->getNestedSetStrategy()->remove($id6); -}); - -$dao->doInTransaction(function(SimpleHierarchyDao $dao, \Logger $log) use ($id6, $id9) { - $dao->getNestedSetStrategy()->moveAsLastChild($id6, $id9); -}); - -/* - * == END OF EXAMPLES ============================================= - */ - -echo 'DONE<hr/>'; Deleted: trunk/examples/index2.php =================================================================== --- trunk/examples/index2.php 2013-06-28 14:49:43 UTC (rev 42) +++ trunk/examples/index2.php 2013-06-28 17:29:46 UTC (rev 43) @@ -1,83 +0,0 @@ -<?php -/* - * Copyright 2008-2010 the original author or authors. - * - * 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. - */ - -/** - * User: mp - * Date: 21.06.13 - * Time: 14:17 - */ - -use Treetest\Node; -use Bee\Persistence\Behaviors\NestedSet\ITreeNode; - -require_once('bootstrap.php'); - -function addChild(ITreeNode $parent, Node $node) { - global $entityManager; - $entityManager->persist($node); - $parent->appendChild($node); -} - -$treeDao = $ctx->getBean('treeDao', 'Treetest\TreeDao'); - -$root = new Node('Root Node', 15); -$entityManager->persist($root); - -addChild($root, new Node('Child 1-1')); -addChild($root, new Node('Child 1-2')); - -$child13 = new Node('Child 1-3'); -addChild($root, $child13); - -addChild($child13, new Node('Child 1-3-1')); -addChild($child13, new Node('Child 1-3-2')); - -$treeDao->getNestedSetStrategy()->saveStructure($root); - -$entityManager->flush(); -$entityManager->close(); - -//exit(); - - -// new EM instance -$entityManager = $ctx->getBean('entityManager'); - -$c12 = $entityManager->getRepository('Treetest\Node')->findOneBy(array('name' => 'Child 1-2')); - -addChild($c12, new Node('Child 1-2-1')); -addChild($c12, new Node('Child 1-2-2')); - -$treeDao->getNestedSetStrategy()->saveStructure($c12); -$entityManager->flush(); -$entityManager->close(); - -//exit(); - -// new EM instance -$entityManager = $ctx->getBean('entityManager'); -//$entityManager = new \Doctrine\ORM\EntityManager(); - -$c12 = $entityManager->getRepository('Treetest\Node')->findOneBy(array('name' => 'Child 1-2')); - -$treeDao->getNestedSetStrategy()->saveStructure($c12); - -$entityManager->flush(); -$entityManager->close(); - -var_dump($treeDao->loadTree($root)); - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |