@@ -133,14 +133,14 @@ |
||
133 | 133 | $work_table = explode("'", $work_str); |
134 | 134 | |
135 | 135 | if (count($work_table) == 0) |
136 | - return ''; |
|
136 | + return ''; |
|
137 | 137 | |
138 | 138 | // if we start with a ', let's remove the first text |
139 | 139 | if (strstr($work_str,"'") === 0) |
140 | - array_shift($work_table); |
|
140 | + array_shift($work_table); |
|
141 | 141 | |
142 | 142 | if (count($work_table) == 0) |
143 | - return ''; |
|
143 | + return ''; |
|
144 | 144 | |
145 | 145 | // Now, let's take only the stuff outside the quotes. |
146 | 146 | $work_str2 = ''; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | private function getAllPossiblePaths() { |
48 | - return AmbiguityException::getAllPossiblePathsRec($this->paths); |
|
48 | + return AmbiguityException::getAllPossiblePathsRec($this->paths); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | private static function getAllPossiblePathsRec($sub_table_paths) |
@@ -65,9 +65,9 @@ |
||
65 | 65 | * @param string $func_name |
66 | 66 | * @param $values |
67 | 67 | * @return array|void |
68 | - * @throws TDBMException |
|
68 | + * @throws TDBMException |
|
69 | 69 | */ |
70 | - public function __call($func_name, $values) { |
|
70 | + public function __call($func_name, $values) { |
|
71 | 71 | |
72 | 72 | if (strpos($func_name,"getarray_") === 0) { |
73 | 73 | $column = substr($func_name, 9); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @param string $tableName |
100 | 100 | * @param string $columnName |
101 | - * @param string $value1 |
|
102 | - * @param string $value2 |
|
101 | + * @param string $value1 |
|
102 | + * @param string $value2 |
|
103 | 103 | */ |
104 | 104 | public function __construct($tableName=null, $columnName=null, $value1=null, $value2=null) { |
105 | 105 | $this->tableName = $tableName; |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @param ConnectionInterface $dbConnection |
115 | 115 | * @return string |
116 | - * @throws \Mouf\Database\TDBM\TDBMException |
|
116 | + * @throws \Mouf\Database\TDBM\TDBMException |
|
117 | 117 | */ |
118 | - public function toSql(ConnectionInterface $dbConnection) { |
|
118 | + public function toSql(ConnectionInterface $dbConnection) { |
|
119 | 119 | if ($this->enableCondition != null && !$this->enableCondition->isOk()) { |
120 | 120 | return ""; |
121 | 121 | } |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param ConnectionInterface $dbConnection |
70 | 70 | * @return string |
71 | - * @throws TDBMException |
|
71 | + * @throws TDBMException |
|
72 | 72 | */ |
73 | - public function toSql(ConnectionInterface $dbConnection) { |
|
73 | + public function toSql(ConnectionInterface $dbConnection) { |
|
74 | 74 | if ($this->enableCondition != null && !$this->enableCondition->isOk()) { |
75 | 75 | return ""; |
76 | 76 | } |
@@ -102,22 +102,22 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return array<string> |
104 | 104 | */ |
105 | - public function getUsedTables() { |
|
106 | - if ($this->enableCondition != null && !$this->enableCondition->isOk()) { |
|
107 | - return array(); |
|
108 | - } |
|
109 | - |
|
110 | - $tables = array(); |
|
111 | - foreach ($this->filters as $filter) { |
|
112 | - |
|
113 | - if (!$filter instanceof FilterInterface) { |
|
114 | - throw new TDBMException("Error in OrFilter: One of the parameters is not a filter."); |
|
115 | - } |
|
116 | - |
|
117 | - $tables = array_merge($tables,$filter->getUsedTables()); |
|
118 | - } |
|
119 | - // Remove tables in double. |
|
120 | - $tables = array_flip(array_flip($tables)); |
|
121 | - return $tables; |
|
122 | - } |
|
105 | + public function getUsedTables() { |
|
106 | + if ($this->enableCondition != null && !$this->enableCondition->isOk()) { |
|
107 | + return array(); |
|
108 | + } |
|
109 | + |
|
110 | + $tables = array(); |
|
111 | + foreach ($this->filters as $filter) { |
|
112 | + |
|
113 | + if (!$filter instanceof FilterInterface) { |
|
114 | + throw new TDBMException("Error in OrFilter: One of the parameters is not a filter."); |
|
115 | + } |
|
116 | + |
|
117 | + $tables = array_merge($tables,$filter->getUsedTables()); |
|
118 | + } |
|
119 | + // Remove tables in double. |
|
120 | + $tables = array_flip(array_flip($tables)); |
|
121 | + return $tables; |
|
122 | + } |
|
123 | 123 | } |
@@ -170,26 +170,26 @@ discard block |
||
170 | 170 | $this->TDBMObject_state = $state; |
171 | 171 | } |
172 | 172 | |
173 | - /** |
|
174 | - * Internal TDBM method, you should not use this. |
|
175 | - * Loads the db_row property of the object from the $row array. |
|
176 | - * Any row having a key starting with 'tdbm_reserved_col_' is ignored. |
|
177 | - * |
|
178 | - * @param array $row |
|
179 | - * @param array|null $colsArray A big optimization to avoid calling strpos to many times. This array should |
|
180 | - * contain as keys the list of interesting columns. If null, this list will be initialized. |
|
181 | - */ |
|
173 | + /** |
|
174 | + * Internal TDBM method, you should not use this. |
|
175 | + * Loads the db_row property of the object from the $row array. |
|
176 | + * Any row having a key starting with 'tdbm_reserved_col_' is ignored. |
|
177 | + * |
|
178 | + * @param array $row |
|
179 | + * @param array|null $colsArray A big optimization to avoid calling strpos to many times. This array should |
|
180 | + * contain as keys the list of interesting columns. If null, this list will be initialized. |
|
181 | + */ |
|
182 | 182 | public function loadFromRow($row, &$colsArray) { |
183 | - if ($colsArray === null) { |
|
184 | - foreach ($row as $key=>$value) { |
|
185 | - if (strpos($key, 'tdbm_reserved_col_')!==0) { |
|
186 | - $colsArray[$key] = true; |
|
187 | - } |
|
188 | - } |
|
189 | - } |
|
190 | - |
|
191 | - $this->db_row = array_intersect_key($row, $colsArray); |
|
192 | - $this->TDBMObject_state = "loaded"; |
|
183 | + if ($colsArray === null) { |
|
184 | + foreach ($row as $key=>$value) { |
|
185 | + if (strpos($key, 'tdbm_reserved_col_')!==0) { |
|
186 | + $colsArray[$key] = true; |
|
187 | + } |
|
188 | + } |
|
189 | + } |
|
190 | + |
|
191 | + $this->db_row = array_intersect_key($row, $colsArray); |
|
192 | + $this->TDBMObject_state = "loaded"; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -507,10 +507,10 @@ discard block |
||
507 | 507 | * |
508 | 508 | * @param string $func_name |
509 | 509 | * @param $values |
510 | - * @return TDBMObjectArray A TDBMObjectArray containing the resulting objects of the query. |
|
511 | - * @throws TDBMException |
|
510 | + * @return TDBMObjectArray A TDBMObjectArray containing the resulting objects of the query. |
|
511 | + * @throws TDBMException |
|
512 | 512 | */ |
513 | - public function __call($func_name, $values) { |
|
513 | + public function __call($func_name, $values) { |
|
514 | 514 | |
515 | 515 | if (strpos($func_name,"get_") === 0) { |
516 | 516 | $table = substr($func_name,4); |
@@ -545,48 +545,48 @@ discard block |
||
545 | 545 | } |
546 | 546 | |
547 | 547 | /** |
548 | - * Implements array behaviour for our object. |
|
549 | - * |
|
550 | - * @param string $offset |
|
551 | - * @param string $value |
|
552 | - */ |
|
548 | + * Implements array behaviour for our object. |
|
549 | + * |
|
550 | + * @param string $offset |
|
551 | + * @param string $value |
|
552 | + */ |
|
553 | 553 | public function offsetSet($offset, $value) { |
554 | 554 | $this->__set($offset, $value); |
555 | - } |
|
555 | + } |
|
556 | 556 | /** |
557 | 557 | * Implements array behaviour for our object. |
558 | 558 | * |
559 | 559 | * @param string $offset |
560 | - * @return bool |
|
560 | + * @return bool |
|
561 | 561 | */ |
562 | - public function offsetExists($offset) { |
|
563 | - $this->_dbLoadIfNotLoaded(); |
|
564 | - return isset($this->db_row[$offset]); |
|
565 | - } |
|
562 | + public function offsetExists($offset) { |
|
563 | + $this->_dbLoadIfNotLoaded(); |
|
564 | + return isset($this->db_row[$offset]); |
|
565 | + } |
|
566 | 566 | /** |
567 | 567 | * Implements array behaviour for our object. |
568 | 568 | * |
569 | 569 | * @param string $offset |
570 | 570 | */ |
571 | - public function offsetUnset($offset) { |
|
571 | + public function offsetUnset($offset) { |
|
572 | 572 | $this->__set($offset, null); |
573 | - } |
|
573 | + } |
|
574 | 574 | /** |
575 | 575 | * Implements array behaviour for our object. |
576 | 576 | * |
577 | 577 | * @param string $offset |
578 | - * @return mixed|null |
|
578 | + * @return mixed|null |
|
579 | 579 | */ |
580 | - public function offsetGet($offset) { |
|
581 | - return $this->__get($offset); |
|
582 | - } |
|
580 | + public function offsetGet($offset) { |
|
581 | + return $this->__get($offset); |
|
582 | + } |
|
583 | 583 | |
584 | 584 | private $_validIterator = false; |
585 | 585 | /** |
586 | 586 | * Implements iterator behaviour for our object (so we can each column). |
587 | 587 | */ |
588 | 588 | public function rewind() { |
589 | - $this->_dbLoadIfNotLoaded(); |
|
589 | + $this->_dbLoadIfNotLoaded(); |
|
590 | 590 | if (count($this->db_row)>0) { |
591 | 591 | $this->_validIterator = true; |
592 | 592 | } else { |
@@ -674,21 +674,21 @@ discard block |
||
674 | 674 | return $sql_where; |
675 | 675 | } |
676 | 676 | |
677 | - /** |
|
678 | - * Override the native php clone function for TDBMObjects |
|
679 | - */ |
|
680 | - public function __clone(){ |
|
681 | - $this->_dbLoadIfNotLoaded(); |
|
682 | - //First lets set the status to new (to enter the save function) |
|
683 | - $this->TDBMObject_state = "new"; |
|
684 | - |
|
685 | - // Add the current TDBMObject to the save object list |
|
686 | - $this->tdbmService->_addToToSaveObjectList($this); |
|
687 | - |
|
688 | - //Now unset the PK from the row |
|
689 | - $pk_array = $this->getPrimaryKey(); |
|
690 | - foreach ($pk_array as $pk) { |
|
691 | - $this->db_row[$pk] = null; |
|
692 | - } |
|
693 | - } |
|
677 | + /** |
|
678 | + * Override the native php clone function for TDBMObjects |
|
679 | + */ |
|
680 | + public function __clone(){ |
|
681 | + $this->_dbLoadIfNotLoaded(); |
|
682 | + //First lets set the status to new (to enter the save function) |
|
683 | + $this->TDBMObject_state = "new"; |
|
684 | + |
|
685 | + // Add the current TDBMObject to the save object list |
|
686 | + $this->tdbmService->_addToToSaveObjectList($this); |
|
687 | + |
|
688 | + //Now unset the PK from the row |
|
689 | + $pk_array = $this->getPrimaryKey(); |
|
690 | + foreach ($pk_array as $pk) { |
|
691 | + $this->db_row[$pk] = null; |
|
692 | + } |
|
693 | + } |
|
694 | 694 | } |
695 | 695 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected $current = false; |
57 | 57 | |
58 | - private $colsArray = null; |
|
58 | + private $colsArray = null; |
|
59 | 59 | |
60 | 60 | public function __construct(\PDOStatement $pdoStatement, ConnectionInterface $dbConnection, $primary_keys, $table_name, $objectStorage, $className, TDBMService $tdbmService, $sql) |
61 | 61 | { |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | * Casts a document to a new instance specified in the $recordClass |
74 | 74 | * @param array $fullCaseRow |
75 | 75 | * @return Record_Abstract|false |
76 | - * @throws TDBMException |
|
76 | + * @throws TDBMException |
|
77 | 77 | */ |
78 | - protected function cast($fullCaseRow) |
|
78 | + protected function cast($fullCaseRow) |
|
79 | 79 | { |
80 | 80 | if (!is_array($fullCaseRow)) { |
81 | 81 | return false; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function generateAllDaosAndBeans($daoFactoryClassName, $daonamespace, $beannamespace, $support, $storeInUtc) { |
67 | 67 | // TODO: migrate $this->daoNamespace to $daonamespace that is passed in parameter! |
68 | 68 | |
69 | - $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json'); |
|
69 | + $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json'); |
|
70 | 70 | |
71 | 71 | $this->daoNamespace = $daonamespace; |
72 | 72 | $this->beanNamespace = $beannamespace; |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | $beanName = $this->getBeanNameFromTableName($tableName); |
99 | 99 | $baseBeanName = $this->getBaseBeanNameFromTableName($tableName); |
100 | 100 | |
101 | - $connection = $this->dbConnection; |
|
102 | - if ($connection instanceof CachedConnection){ |
|
103 | - $connection->cacheService->purgeAll(); |
|
104 | - } |
|
101 | + $connection = $this->dbConnection; |
|
102 | + if ($connection instanceof CachedConnection){ |
|
103 | + $connection->cacheService->purgeAll(); |
|
104 | + } |
|
105 | 105 | |
106 | 106 | $this->generateBean($beanName, $baseBeanName, $tableName, $beannamespace, $classNameMapper); |
107 | 107 | $this->generateDao($daoName, $daoName."Base", $beanName, $tableName, $classNameMapper); |
@@ -137,16 +137,16 @@ discard block |
||
137 | 137 | return TDBMDaoGenerator::toSingular(TDBMDaoGenerator::toCamelCase($tableName))."BaseBean"; |
138 | 138 | } |
139 | 139 | |
140 | - /** |
|
141 | - * Writes the PHP bean file with all getters and setters from the table passed in parameter. |
|
142 | - * |
|
143 | - * @param string $className The name of the class |
|
144 | - * @param string $baseClassName The name of the base class which will be extended (name only, no directory) |
|
145 | - * @param string $tableName The name of the table |
|
146 | - * @param string $beannamespace The namespace of the bean |
|
147 | - * @param ClassNameMapper $classNameMapper |
|
148 | - * @throws TDBMException |
|
149 | - */ |
|
140 | + /** |
|
141 | + * Writes the PHP bean file with all getters and setters from the table passed in parameter. |
|
142 | + * |
|
143 | + * @param string $className The name of the class |
|
144 | + * @param string $baseClassName The name of the base class which will be extended (name only, no directory) |
|
145 | + * @param string $tableName The name of the table |
|
146 | + * @param string $beannamespace The namespace of the bean |
|
147 | + * @param ClassNameMapper $classNameMapper |
|
148 | + * @throws TDBMException |
|
149 | + */ |
|
150 | 150 | public function generateBean($className, $baseClassName, $tableName, $beannamespace, ClassNameMapper $classNameMapper) { |
151 | 151 | $table = $this->dbConnection->getTableFromDbModel($tableName); |
152 | 152 | |
@@ -361,25 +361,25 @@ discard block |
||
361 | 361 | $str .= "} |
362 | 362 | ?>"; |
363 | 363 | |
364 | - $possibleBaseFileNames = $classNameMapper->getPossibleFileNames($beannamespace."\\".$baseClassName); |
|
365 | - if (!$possibleBaseFileNames) { |
|
366 | - throw new TDBMException('Sorry, autoload namespace issue. The class "'.$beannamespace."\\".$baseClassName.'" is not autoloadable.'); |
|
367 | - } |
|
368 | - $possibleBaseFileName = __DIR__.'/../../../../../../../../'.$possibleBaseFileNames[0]; |
|
364 | + $possibleBaseFileNames = $classNameMapper->getPossibleFileNames($beannamespace."\\".$baseClassName); |
|
365 | + if (!$possibleBaseFileNames) { |
|
366 | + throw new TDBMException('Sorry, autoload namespace issue. The class "'.$beannamespace."\\".$baseClassName.'" is not autoloadable.'); |
|
367 | + } |
|
368 | + $possibleBaseFileName = __DIR__.'/../../../../../../../../'.$possibleBaseFileNames[0]; |
|
369 | 369 | |
370 | - $this->ensureDirectoryExist($possibleBaseFileName); |
|
370 | + $this->ensureDirectoryExist($possibleBaseFileName); |
|
371 | 371 | file_put_contents($possibleBaseFileName, $str); |
372 | 372 | @chmod($possibleBaseFileName, 0664); |
373 | 373 | |
374 | 374 | |
375 | 375 | |
376 | - $possibleFileNames = $classNameMapper->getPossibleFileNames($beannamespace."\\".$className); |
|
377 | - if (!$possibleFileNames) { |
|
378 | - throw new TDBMException('Sorry, autoload namespace issue. The class "'.$beannamespace."\\".$className.'" is not autoloadable.'); |
|
379 | - } |
|
380 | - $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
376 | + $possibleFileNames = $classNameMapper->getPossibleFileNames($beannamespace."\\".$className); |
|
377 | + if (!$possibleFileNames) { |
|
378 | + throw new TDBMException('Sorry, autoload namespace issue. The class "'.$beannamespace."\\".$className.'" is not autoloadable.'); |
|
379 | + } |
|
380 | + $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
381 | 381 | |
382 | - if (!file_exists($possibleFileName)) { |
|
382 | + if (!file_exists($possibleFileName)) { |
|
383 | 383 | $str = "<?php |
384 | 384 | /* |
385 | 385 | * This file has been automatically generated by TDBM. |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | { |
398 | 398 | |
399 | 399 | }"; |
400 | - $this->ensureDirectoryExist($possibleFileName); |
|
400 | + $this->ensureDirectoryExist($possibleFileName); |
|
401 | 401 | file_put_contents($possibleFileName ,$str); |
402 | 402 | @chmod($possibleFileName, 0664); |
403 | 403 | } |
@@ -653,21 +653,21 @@ discard block |
||
653 | 653 | } |
654 | 654 | ?>"; |
655 | 655 | |
656 | - $possibleBaseFileNames = $classNameMapper->getPossibleFileNames($this->daoNamespace."\\".$baseClassName); |
|
657 | - if (!$possibleBaseFileNames) { |
|
658 | - throw new TDBMException('Sorry, autoload namespace issue. The class "'.$baseClassName.'" is not autoloadable.'); |
|
659 | - } |
|
660 | - $possibleBaseFileName = __DIR__.'/../../../../../../../../'.$possibleBaseFileNames[0]; |
|
656 | + $possibleBaseFileNames = $classNameMapper->getPossibleFileNames($this->daoNamespace."\\".$baseClassName); |
|
657 | + if (!$possibleBaseFileNames) { |
|
658 | + throw new TDBMException('Sorry, autoload namespace issue. The class "'.$baseClassName.'" is not autoloadable.'); |
|
659 | + } |
|
660 | + $possibleBaseFileName = __DIR__.'/../../../../../../../../'.$possibleBaseFileNames[0]; |
|
661 | 661 | |
662 | - $this->ensureDirectoryExist($possibleBaseFileName); |
|
662 | + $this->ensureDirectoryExist($possibleBaseFileName); |
|
663 | 663 | file_put_contents($possibleBaseFileName ,$str); |
664 | 664 | @chmod($possibleBaseFileName, 0664); |
665 | 665 | |
666 | - $possibleFileNames = $classNameMapper->getPossibleFileNames($this->daoNamespace."\\".$className); |
|
667 | - if (!$possibleFileNames) { |
|
668 | - throw new TDBMException('Sorry, autoload namespace issue. The class "'.$className.'" is not autoloadable.'); |
|
669 | - } |
|
670 | - $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
666 | + $possibleFileNames = $classNameMapper->getPossibleFileNames($this->daoNamespace."\\".$className); |
|
667 | + if (!$possibleFileNames) { |
|
668 | + throw new TDBMException('Sorry, autoload namespace issue. The class "'.$className.'" is not autoloadable.'); |
|
669 | + } |
|
670 | + $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
671 | 671 | |
672 | 672 | // Now, let's generate the "editable" class |
673 | 673 | if (!file_exists($possibleFileName)) { |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | { |
688 | 688 | |
689 | 689 | }"; |
690 | - $this->ensureDirectoryExist($possibleFileName); |
|
690 | + $this->ensureDirectoryExist($possibleFileName); |
|
691 | 691 | file_put_contents($possibleFileName ,$str); |
692 | 692 | @chmod($possibleFileName, 0664); |
693 | 693 | } |
@@ -754,13 +754,13 @@ discard block |
||
754 | 754 | } |
755 | 755 | ?>'; |
756 | 756 | |
757 | - $possibleFileNames = $classNameMapper->getPossibleFileNames($daoNamespace."\\".$daoFactoryClassName); |
|
758 | - if (!$possibleFileNames) { |
|
759 | - throw new TDBMException('Sorry, autoload namespace issue. The class "'.$daoNamespace."\\".$daoFactoryClassName.'" is not autoloadable.'); |
|
760 | - } |
|
761 | - $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
757 | + $possibleFileNames = $classNameMapper->getPossibleFileNames($daoNamespace."\\".$daoFactoryClassName); |
|
758 | + if (!$possibleFileNames) { |
|
759 | + throw new TDBMException('Sorry, autoload namespace issue. The class "'.$daoNamespace."\\".$daoFactoryClassName.'" is not autoloadable.'); |
|
760 | + } |
|
761 | + $possibleFileName = __DIR__.'/../../../../../../../../'.$possibleFileNames[0]; |
|
762 | 762 | |
763 | - $this->ensureDirectoryExist($possibleFileName); |
|
763 | + $this->ensureDirectoryExist($possibleFileName); |
|
764 | 764 | file_put_contents($possibleFileName ,$str); |
765 | 765 | } |
766 | 766 | |
@@ -876,20 +876,20 @@ discard block |
||
876 | 876 | return strtolower(substr($str, 0, 1)).substr($str, 1); |
877 | 877 | } |
878 | 878 | |
879 | - /** |
|
880 | - * Ensures the file passed in parameter can be written in its directory. |
|
881 | - * @param string $fileName |
|
882 | - */ |
|
883 | - private function ensureDirectoryExist($fileName) { |
|
884 | - $dirName = dirname($fileName); |
|
885 | - if (!file_exists($dirName)) { |
|
886 | - $old = umask(0); |
|
887 | - $result = mkdir($dirName, 0775, true); |
|
888 | - umask($old); |
|
889 | - if ($result == false) { |
|
890 | - echo "Unable to create directory: ".$dirName."."; |
|
891 | - exit; |
|
892 | - } |
|
893 | - } |
|
894 | - } |
|
879 | + /** |
|
880 | + * Ensures the file passed in parameter can be written in its directory. |
|
881 | + * @param string $fileName |
|
882 | + */ |
|
883 | + private function ensureDirectoryExist($fileName) { |
|
884 | + $dirName = dirname($fileName); |
|
885 | + if (!file_exists($dirName)) { |
|
886 | + $old = umask(0); |
|
887 | + $result = mkdir($dirName, 0775, true); |
|
888 | + umask($old); |
|
889 | + if ($result == false) { |
|
890 | + echo "Unable to create directory: ".$dirName."."; |
|
891 | + exit; |
|
892 | + } |
|
893 | + } |
|
894 | + } |
|
895 | 895 | } |
896 | 896 | \ No newline at end of file |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($this->daoNamespace == null && $this->beanNamespace == null) { |
65 | - $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json'); |
|
65 | + $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json'); |
|
66 | 66 | |
67 | 67 | $autoloadNamespaces = $classNameMapper->getManagedNamespaces(); |
68 | - if ($autoloadNamespaces) { |
|
68 | + if ($autoloadNamespaces) { |
|
69 | 69 | $this->autoloadDetected = true; |
70 | 70 | $rootNamespace = $autoloadNamespaces[0]; |
71 | 71 | $this->daoNamespace = $rootNamespace."Dao"; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $tdbmService = new InstanceProxy($name); |
137 | 137 | /* @var $tdbmService TDBMService */ |
138 | - $tables = $tdbmService->generateAllDaosAndBeans($daofactoryclassname, $daonamespace, $beannamespace, $keepSupport, $storeInUtc); |
|
138 | + $tables = $tdbmService->generateAllDaosAndBeans($daofactoryclassname, $daonamespace, $beannamespace, $keepSupport, $storeInUtc); |
|
139 | 139 | |
140 | 140 | |
141 | 141 | $moufManager->declareComponent($daofactoryinstancename, $daonamespace."\\".$daofactoryclassname, false, MoufManager::DECLARE_ON_EXIST_KEEP_INCOMING_LINKS); |