Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Making giix directory location independent #5

Open
wants to merge 3 commits into from

3 participants

@schmunk42

Hi Rodrigo,

I tried to include giix in another location than 'ext.giix' and stumbled upon a few path issues.
I fixed them by defining a custom "dynamic" alias, when it's needed.

Should not affect existing setups.
Let me know if you've questions.

Best regards,
schmunk

@iJackUA

Thanks, @schmunk42
That fix seems to work (even with my multi app configuration)

@rcoelho
Owner

@schmunk42, @iJackUA thanks! I'm very busy right now, but I'll review this later.

@rcoelho rcoelho was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
5 generators/giixCrud/GiixCrudGenerator.php
@@ -15,9 +15,12 @@
* @author Rodrigo Coelho <rodrigo@giix.org>
* @package giix.generators.giixCrud
*/
+
+Yii::setPathOfAlias("giixCrud", dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'giixCrud');
+
class GiixCrudGenerator extends CCodeGenerator {
- public $codeModel = 'ext.giix.generators.giixCrud.GiixCrudCode';
+ public $codeModel = 'giixCrud.GiixCrudCode';
/**
* Returns the model names in an array.
View
5 generators/giixCrud/templates/default/controller.php
@@ -9,8 +9,9 @@
class <?php echo $this->controllerClass; ?> extends <?php echo $this->baseControllerClass; ?> {
-<?php
- $authpath = 'ext.giix.generators.giixCrud.templates.default.auth.';
+<?php
+ Yii::setPathOfAlias("templates-default", dirname(__FILE__));
+ $authpath = 'templates-default.auth.';
Yii::app()->controller->renderPartial($authpath . $this->authtype);
?>
View
5 generators/giixModel/GiixModelGenerator.php
@@ -15,9 +15,12 @@
* @author Rodrigo Coelho <rodrigo@giix.org>
* @package giix.generators.giixModel
*/
+
+Yii::setPathOfAlias('giixModel', dirname(__FILE__));
+
class GiixModelGenerator extends CCodeGenerator {
- public $codeModel = 'ext.giix.generators.giixModel.GiixModelCode';
+ public $codeModel = 'giixModel.GiixModelCode';
/**
* Returns the table names in an array.
Something went wrong with that request. Please try again.