1. #11
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Hi bornsilly,

    I can't recreate your problem. What version of symfony are you using? You may try prepending php to your command: php symfony plugin:install dsExtDirectPlugin

    You may also want to try just checking out via SVN: svn co http://svn.symfony-project.com/plugi...ctPlugin/trunk plugins

    Cheers,
    Dan

  2. #12
    Ext User
    Join Date
    Aug 2009
    Location
    Lugo, Spain
    Posts
    1
    Vote Rating
    0
    joserprieto is on a distinguished road

      0  

    Default Error in symfony extdirect:generate-api

    Error in symfony extdirect:generate-api


    Hi, Daniel:

    First, I want to thank you four your plugin.

    I installed the plugin from commandline:
    PHP Code:
    joserprieto@joserprieto-vaio:$ symfony plugin:install dsExtDirectPlugin
    >> plugin    installing plugin "dsExtDirectPlugin"
    >> sfPearFrontendPlugin downloading dsExtDirectPlugin-1.0.2.tgz ...
    >> 
    sfPearFrontendPlugin Starting to download dsExtDirectPlugin-1.0.2.tgz (10,528
    >> sfPearFrontendPlugin bytes)
    >> 
    sfPearFrontendPlugin .
    >> 
    sfPearFrontendPlugin .
    >> 
    sfPearFrontendPlugin ...done10,528 bytes
    >> sfSymfonyPluginManager Installation successful for plugin "dsExtDirectPlugin" 
    And in my project I have installed the plugins:
    PHP Code:
    joserprieto@joserprieto-vaio:$ symfony plugin:list
    Installed plugins:
     
    symfony                            1.2.8-stable # pear.symfony-project.com (symfony)
     
    dsExtDirectPlugin                  1.0.2-stable # plugins.symfony-project.org (symfony-plugins)
     
    sfDoctrineGuardPlugin              3.0.0-stable # plugins.symfony-project.org (symfony-plugins) 
    I changed the app.yml and the factories.yml files of my application, and enabled the plugin in settings.yml; I enabled an action in one module with the comment * @extdirect-enable, and when I executed the command line extdirect:generate-api task, i got this error:

    PHP Code:
    joserprieto@joserprieto-vaio:$ symfony extdirect:generate-api systemp -e extdirect -d
    >> file-     /home/joserprieto/projects/SysT...pment.systemp/web/extdirect.php
    >> file+     /home/joserprieto/projects/SysT...pment.systemp/web/extdirect.php
    >> tokens    /home/joserprieto/projects/SysT...pment.systemp/web/extdirect.php

    Fatal error
    : Class 'autosfGuardUserActions' not found in /home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/lib/BasesfGuardUserActions.class.php on line 18

    Call Stack
    :
        
    0.0005      65172   1. {main}() /usr/bin/symfony:0
        0.0098     318912   2. 
    include('/home/joserprieto/projects/SysTemp/trunk/development.systemp/lib/vendor/symfony/lib/command/cli.php') /usr/bin/symfony:37
        0.3909    5291840   3. sfSymfonyCommandApplication
    ->run() /home/joserprieto/projects/SysTemp/trunk/development.systemp/lib/vendor/symfony/lib/command/cli.php:20
        0.4095    5459728   4. sfTask
    ->runFromCLI() /home/joserprieto/projects/SysTemp/trunk/development.systemp/lib/vendor/symfony/lib/command/sfSymfonyCommandApplication.class.php:76
        0.4098    5459728   5. sfBaseTask
    ->doRun() /home/joserprieto/projects/SysTemp/trunk/development.systemp/lib/vendor/symfony/lib/task/sfTask.class.php:77
        0.4635    5995620   6. dsExtDirectGenerateApiTask
    ->execute() /home/joserprieto/projects/SysTemp/trunk/development.systemp/lib/vendor/symfony/lib/task/sfBaseTask.class.php:63
        0.5198    6390788   7. dsExtDirectGenerateApiTask
    ->loadModuleClassFile() /home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/dsExtDirectPlugin/lib/task/dsExtDirectGenerateApiTask.class.php:92
        0.5202    6395688   8. 
    require_once('/home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/actions/actions.class.php') /home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/dsExtDirectPlugin/lib/task/dsExtDirectGenerateApiTask.class.php:228
        0.5204    6397980   9. 
    require_once('/home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/lib/BasesfGuardUserActions.class.php') /home/joserprieto/projects/SysTemp/trunk/development.systemp/plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/actions/actions.class.php:
    Any idea?

    Thanks a lot

  3. #13
    Ext User
    Join Date
    Feb 2009
    Location
    Japan
    Posts
    10
    Vote Rating
    0
    r3ap3r is on a distinguished road

      0  

    Default


    I'm getting the same error as joserprieto is. Actually I'm getting it for a different module (not sfGuardUser) but it's the same error.

    Has anyone figured out how to fix this?

  4. #14
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Are you using the latest version from SVN or the pear package? If you installed using symfony plugin:install dsExtDirectPlugin please try checking out from SVN described in my last post. If the error still occurs please let me know and I'll get a fix out asap.

    Thanks for the report,
    Dan

  5. #15
    Ext User
    Join Date
    Feb 2009
    Location
    Japan
    Posts
    10
    Vote Rating
    0
    r3ap3r is on a distinguished road

      0  

    Default


    Quote Originally Posted by dancablam View Post
    Are you using the latest version from SVN or the pear package? If you installed using symfony plugin:install dsExtDirectPlugin please try checking out from SVN described in my last post. If the error still occurs please let me know and I'll get a fix out asap.

    Thanks for the report,
    Dan
    Dan,

    I first tried with the pear version, when that didn't work I tried with the svn version, but I still get the same error.

    Thanks,
    -Chris

  6. #16
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Ok r3ap3r & joserprieto - thanks pointing out this issue. I believe I have fixed the problem and the changes have been posted to SVN. Please verify it works for you now and I'll roll it into the new package.

    What I had to do is add a new config parameter called include_plugins that allows you to list the plugins you wish to have scanned when generating the API. Before, it would scan all plugins some of which (like sfDoctrineGuard) won't work because they include auto generated action classes. Note that from now on if you wish to include plugins in the API generation they must be listed in the include_plugins parameter. I realize this breaks backwards compatibility slightly but this is the only long term solution I could think of in order to prevent frequent headaches.

    Thanks again and please let me know the results of the update.

    Cheers,
    Dan

  7. #17
    Ext User
    Join Date
    Feb 2009
    Location
    Japan
    Posts
    10
    Vote Rating
    0
    r3ap3r is on a distinguished road

      0  

    Default


    Dan,
    That seems to have worked. I say seems to because it no longer throws the error and the task exits out cleanly but my extdirect_api.yml file is coming up simply as:
    Code:
    # DO NOT MODIFY
    # Generated by extdirect:generate-api task
    {  }
    So now I need to track down whether it's actually reading through my plugin or not. If it is, then I must not be properly configuring the action.

    As a side note: I like the option of specifying which plugins you want to use. I was going to suggest that you add that option but I figured you wouldn't like it. By having that option you can avoid any number of future problems with rogue plugins. It breaks backward compatibility, but how hard is it really to list the handful of plugins that the developer may have written to use ExtJS. Of course you may need to field some questions from current users the first time they update, but long term it should work out nice.

    Off topic: I understand the error that your plugin was throwing. It was trying to include a class file that extended an auto*Action class, but since the auto*Action class hadn't already been loaded the require_once() call would fail. I can't seem to find where that auto generated class (the one that was causing the error) is located on my system. If I grep for it I can't find it. Either Symfony is doing some kind of weird voodoo class instantiating or I'm totally missing something. If anyone knows what is happening behind the scenes to load this class, and where it is located I'd love for you to explain it to me.

    Thanks,
    -Chris

  8. #18
    Ext User
    Join Date
    Feb 2009
    Location
    Japan
    Posts
    10
    Vote Rating
    0
    r3ap3r is on a distinguished road

      0  

    Default


    Dan,
    OK. I figured out what happened to cause my empty extdirect_api.yml file. I didn't notice that the app configuration had changed in your readme. In the original readme (at least the one on the Symfony plugin page) for app.yml you had:
    Code:
    extdirect:
      ds_ext_direct_plugin:
            # Optional. Only use this parameter if you intend to create a mod_rewrite our route to a different URL for your extdirect front controller.
            #router_url: /extdirect.php
    
            # Optional. Set the javascript variable name for the js api spec (defaults to 'Ext.app.{YOUR_API_NAME}_API)
            #js_var: Ext.app.EXTDIRECT_API
    
            # Optional. Set a provider_type (defaults to remoting)
            #provider_type: remoting
    But your new readme list:
    Code:
        all:
          ds_ext_direct_plugin:
    		    # Optional. Only use this parameter if you intend to create a mod_rewrite our route to a different URL for your extdirect front controller.
    		    #router_url: /extdirect.php
    		    
    		    # Optional. Namespace for direct actions (ex: myNs.myAction.myMethod();)
        		#action_namespace: myNs
    
    		    # Optional. Set the javascript variable name for the js api spec (defaults to 'Ext.app.{YOUR_API_NAME}_API)
    		    #js_var: Ext.app.EXTDIRECT_API
    
    		    # Optional. Set a provider_type (defaults to remoting)
    		    #provider_type: remoting
        
    		    # Optional. List plugins who's action classes you want included in API generation (defaults to null)
    		    # ex: include_plugins: [sfGuardPlugin]
    		    #include_plugins: ~
    A subtle change that I'm posting here for anyone else who is having problems and didn't catch it.
    The environment has been changed from 'extdirect' to 'all'.
    (Obviously I knew about the include_plugins change, and had already applied that one.)

    So to recap: Your fix seems to work great for me, now I need to finish my ExtJS code so that I can actually test your plugin

    Thanks for the quick response and fix.
    -Chris

  9. #19
    Ext User
    Join Date
    Feb 2009
    Location
    Japan
    Posts
    10
    Vote Rating
    0
    r3ap3r is on a distinguished road

      0  

    Default


    Dan,
    OK, I found a potential bug in your code.

    I have a plugin that I have made where I put all of the code in the Base[module name]Actions class leaving the actual [module name]Actions class empty for the end users of the plugin to modify as necessary. I believe this to be the correct way of creating a plugin, although I could be wrong.

    Anyway, when I put the @extdirect-action MYACTION directive in the class comments (of the base class) they don't get pulled in by your script. It only works if I put them in the actual derivative [module name]Actions class comments.

    I would suggest adding something like the following to fix this (inside dsExtDirectGenerateApiTask.class.php right after the call to $class->getDocComment():
    Code:
    $parent_class_name = 'Base'.$module.'Actions';
    if (class_exists($parent_class_name)) {
      $parent_class = new ReflectionClass($parent_class_name);
      $class_comments .= $parent_class->getDocComment();
    }
    Obviously this may not be the best way of dealing with it since I'm not positive if the majority of action classes have a base class starting with 'Base' (I assume they do, at least for plugins). I don't know much about what the ReflectionClass can do, so there is probably a better way of finding the parent class. This way the @extdirect-action directive can remain in the same file as the actual method that is being used.

    By appending the parent class comments your code will still grab the child class directive even if it has been declared in the parent and overridden in the child.

    As a side note: I would modify your readme to be a little bit more descriptive of the @extdirect-action directive. At first I thought that this directive was supposed to be placed in the method comments along with the @extdirect-enable directive and I couldn't figure out why it wasn't working until I looked through your code to see what it was doing.

    Looking back I realize what you meant by "Action-level doc comment options include:" in the readme, but it wasn't clear enough for me to begin with to know that these comments went with the class, not the method. Being a bit more descriptive of exactly where to put the directive may eliminate support requests from some of the slow people like me.

    Thanks again,
    -Chris

  10. #20
    Ext JS Premium Member dancablam's Avatar
    Join Date
    Apr 2008
    Location
    Dallas, TX
    Posts
    134
    Vote Rating
    0
    dancablam is on a distinguished road

      0  

    Default


    Hi Chris,

    Glad the update seems to have worked for you.

    Regarding the auto*Action classes - you're pretty much right about it being voodoo - It's my understanding the auto classes don't exist until runtime - there's no actual source code generated that references those auto classes.

    I did sneak that little environment change in there from 'extdirect' to 'all' a few commits back since when you generate the API for the first time the extdirect env actually doesn't exist yet so it causes issues.

    I posted clarification in the README regarding action and method level comment options. Thanks for the tip.

    Regarding Base Action classes - I believe prepending Base to an action class is somewhat common practice although I'm not sure exactly how prolific it is. I hadn't given any thought to the possibility of plugins being written that wish to take advantage of dsExtDirect. My concerns are: 1) Are Base Action classes really commonplace enough to justify searching through with Reflection? 2) Will searching through Base Action classes cause problems similar to what we've already encountered with freely meddling around in plugin classes? 3) Do plugin users really want extdirect actions defined for them by default? What if they want to override or disable them?

    Perhaps you're just creating the plugin for yourself but if you are creating a plugin for the public, those type of questions have me concerned. I'm thinking that type of functionality should be employed by writing a custom task that extends the dsExtDirectPlugin task. I'm not sure of the best approach - further thoughts from you would be welcomed. I just want to avoid adding a feature that others will rebuke later because of unforeseen issues it creates.

    Thanks for all of your thoughts and suggestions!

    Cheers,
    Dan

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi