[fw-general] Having trouble writing a basic application after making first steps into ZF2

2013-11-14 Thread dennis-fedco
I am having some trouble creating a beginning ZF2 application. My trouble stems from still learning ZF2, and from a LOT of options available when it comes to development, and a lot of modules available, and from not being crystal clear on how to deal with such modules. Here is what I want to

[fw-general] Re: Having trouble writing a basic application after making first steps into ZF2

2013-11-15 Thread dennis-fedco
Thank you I think my difficulty is that of choices and not knowing the best practices when it comes to developing ZF2 application. There are several modules paths that I can take to help me get started to provide User Object, Email sign up verification, and ACL: ZfcBase - ZfcUser -

[fw-general] What is Module.php and why some packages have two of them?

2013-11-26 Thread dennis-fedco
*Question 1* I see a file called Module.php in a lot of PHP packages. What is it, what does it do, and why is it there? Who calls it, and how and why does it work? Are there any hidden magic PHP methods or other packages that call it and how? Doing short yet reasonable Googling I could not find a

[fw-general] What are the benefits of OO vs procedural programming for the web

2013-12-05 Thread dennis-fedco
I've been reading Stack Overflow on whats-the-benefit-of-object-oriented-programming-over-procedural-programming http://programmers.stackexchange.com/questions/120019/whats-the-benefit-of-object-oriented-programming-over-procedural-programming It is a good (although not the best) overview of

[fw-general] Removing require_once() from PHPUnit Tests

2013-12-11 Thread dennis-fedco
I want to write a PHPUnit test for my Controller. I have a class MachinistControllerTest.php https://gist.github.com/dennis-fedco/7917132 where my concern is on line 6. If I remove that line, it causes my test to not work. I get this error: Debug Error: /.../Controller

[fw-general] How to PHPUnit-test a Controller under BjyAuthorize?

2013-12-12 Thread dennis-fedco
I have a Controller https://gist.github.com/dennis-fedco/7936645 , that does nothing so far, but display a view page. Well, it also check if the user has identity set up, but that's not as important right now. The thing that is happening behind the scenes is that I am using BjyAuthorize

[fw-general] Re: How to PHPUnit-test a Controller under BjyAuthorize?

2013-12-12 Thread dennis-fedco
To clarify: * my concern is that Controller is not aware of its access model under BjyAuthorize. Is that they way it was intended to be? Is that a good practice to leave it be this way? * Can I test this Controller with various roles under BjyAuthorize, to see which roles are allowed, and

[fw-general] Re: How to PHPUnit-test a Controller under BjyAuthorize?

2013-12-13 Thread dennis-fedco
Thanks. Are there any examples on how I can test my Controller to see how it responds to different roles through BjyAuthorize? I have written this Controller Test https://gist.github.com/dennis-fedco/7950074 (and it works woo hoo!), but do not pass. So my questions are: * how do I

[fw-general] invokable/factory controller keys

2013-12-30 Thread dennis-fedco
When generating controller configuration, Zend Studio 10.5 by default creates something like this: 'controllers' = array( 'invokables' = array( 'Module\Controller\Index' = 'Module\Controller\IndexController', ), ), and 'defaults' = array(

[fw-general] BjyAuthorize RuleProvider from Doctrine (help requested)

2014-01-10 Thread dennis-fedco
I've been entangling myself in code, while trying to implement a RuleProvider to work with BjyAuthorize ZF2 module. I need a bit of help. I put my code here for reference https://github.com/dennis-fedco/BjyRuleProvider . I am looking for help in some specific areas. Some problems I am

[fw-general] Re: BjyAuthorize RuleProvider from Doctrine (help requested)

2014-01-14 Thread dennis-fedco
My Doctrine Rule Provider pulls information from the database, and returns an array of rules, but those rules do not seem to register with BjyAuthorize. I do not know why. So, I did some refactoring, and pushed the rules into BjyAuthorize\Guard\Controller() class, and now something is

[fw-general] Re: BjyAuthorize RuleProvider from Doctrine (help requested)

2014-01-14 Thread dennis-fedco
all in all, it can't be that complicated. I am finding myself tracing code levels deep into BjyAuthorize code, to find why my rules are not being loaded, and I shouldn't have to do that. I must be doing something wrong. I am learning bits and pieces about how BjyAuthorize works, but also I

[fw-general] Re: BjyAuthorize RuleProvider from Doctrine (help requested)

2014-01-15 Thread dennis-fedco
I overrode 'BjyAuthorize\Guard\Controller': 'BjyAuthorize\Guard\Controller' = 'FedcoUser\Factory\ObjectRepositoryRuleProviderFactory', It seems that my Guard is now being loaded from Doctrine, as I wanted, but there are weird errors, like some rules are loading twice, and some not at

[fw-general] Re: BjyAuthorize RuleProvider from Doctrine (help requested)

2014-01-15 Thread dennis-fedco
Investigated why my rules were loading twice, and found that it was because there is code that allows them to be loaded twice: Authorize.php#L188 https://github.com/bjyoungblood/BjyAuthorize/blob/1.4.0/src/BjyAuthorize/Service/Authorize.php#L188 and Authorize.php#L381

[fw-general] Re: invokable/factory controller keys

2014-01-17 Thread dennis-fedco
Thanks. There are some corner cases, especially when working with 3rd party modules. Example: in module.config.php say we have 'my_service' = 'path/to/MyServiceFactory' MyServiceFactory (which may call MyServiceClass, as a supplement), but ultimately returns ThirdPartyModuleClass instance

[fw-general] Questions on Naming

2014-01-17 Thread dennis-fedco
I've noticed that ZF2 has names like \Zend\Debug\Debug, and while there is some duplication here, it makes some sense. For example, working with BjyAuthorize I see some names that break up this structure. For example, BjyAuthorize\Provider\Role\ObjectRepositoryProvider.php

[fw-general] 2-step verification with Google and ZfcUser/BjyAuthorize

2014-01-27 Thread dennis-fedco
I am looking into 2-step verification using Google https://support.google.com/accounts/answer/180744?hl=en with ZfcUser https://github.com/ZF-Commons/ZfcUser‎ . Has anyone done this before? -- View this message in context:

[fw-general] Re: 2-step verification with Google and ZfcUser

2014-01-27 Thread dennis-fedco
спасибо. A где ваш форум? also I understand that this provides just authentication. Inside Google you can enable 2-step authentication, but it is not a part of the module. -- View this message in context:

[fw-general] Favorite Commit on GitHub

2014-01-30 Thread dennis-fedco
I interrupt the general flow of the discussion by presenting you this little gem: My favorite commit on GitHub https://github.com/coogle/OAuth2/commit/75e727fff5fb4a513c8cc862a34a6d6ccba94e25#commitcomment-5218204 . -- View this message in context:

[fw-general] Authenticate and authorize API with Apigility to implement Google Auth?

2014-01-30 Thread dennis-fedco
I saw this webinar on Authenticate and authorize API with Apigility http://www.zend.com/en/webinar/Framework/7017000cIvc-apigility-authentication-15012014.flv (needs Zend account to view). this is something new to me. I do not know how to use it. I don't know how to think about it --

[fw-general] Re: Favorite Commit on GitHub

2014-01-30 Thread dennis-fedco
and by the way I hope this module turns into something. I am looking for ways to authorize my app through Google, and this module may just be lightweight enough to do this one job. -- View this message in context:

[fw-general] Best Practices on incorporating non-OO non-ZF2 code into ZF2 app

2014-02-04 Thread dennis-fedco
In exploring various options for sign in I found this: https://github.com/googleplus/gplus-quickstart-php In particular, signin.php https://github.com/googleplus/gplus-quickstart-php/blob/master/signin.php script is not object oriented (aka not a class itself), but actually creates and runs a

[fw-general] Re: Best Practices on incorporating non-OO non-ZF2 code into ZF2 app

2014-02-05 Thread dennis-fedco
Thank you! I just wanted to note that it is interesting how ZF2 can go from procedural to OO, and back. index.php uses procedural functions, before starting up the main OO application, back to the possibility of calling procedural scripts from within the object-oriented code. For some reason it

[fw-general] I have a challenge for ZF2

2014-02-11 Thread dennis-fedco
I have this existing application with existing feature for product X. You select product options from menu options and it generates a PDF. Code that runs this spans throughout a 6000-line technology soup PHP file collection. It is a complex intertwined procedural/oo aplication (600K lines) that

[fw-general] Re: I have a challenge for ZF2

2014-02-11 Thread dennis-fedco
hmmm .. looking at the situation .. the lifetime of the project is ongoing and more features will be requested well into the foreseeable future. It might just be the case of It works... put up with it. I think it is possible to do some minor incremental rewrites, cleanups and adding some unit

[fw-general] Re: I have a challenge for ZF2

2014-02-13 Thread dennis-fedco
How about this? I will be doing rewriting, and refactoring. I will be going towards *some kind of framework*. *But ... Hey ! I *might as well* go towards ZF2*. HOW exactly I will do that is unclear right now. I know that ZF2 can be used as not-a-framework (aka classes used separately), and

[fw-general] Re: I have a challenge for ZF2

2014-02-13 Thread dennis-fedco
I gotta give it up for projects that put everything together with no separation. it is all right there! You want to change CSS? It's right there in the file! HTML? Sure it's right there where you are editing it! SQL? It's right here dude! jQuery? Same thing! All in one file! You can have

[fw-general] Re: I have a challenge for ZF2

2014-02-14 Thread dennis-fedco
Matt why did you decide to go towards ZF1 then? Why not a homegrown framework, or whatever framework the code happens to fall into as I refactor? And how is that project doing now? Tests, yeah. I am not there yet but I have been thinking about how to test that code. I do not have much

[fw-general] Where to place template files in ZF2?

2014-02-19 Thread dennis-fedco
Say I have a module that uses existing PDF files to produce new PDF files. Existing PDF files are therefore templates I can use to draw new stuff on. Where do I put those template PDF files in the ZF2/module's folder structure? I thought of putting them into ./data, but then they will go into

[fw-general] Was Zend PDF Deprecated?

2014-02-24 Thread dennis-fedco
I do not see Zend PDF library in ZF2. Most links lead me towards ZF1 in my searches. Was PDF library removed from ZF2, for some reason? Are there any plans of reinstating it? Are alternative solutions recommended? -- View this message in context:

[fw-general] Was Zend Measure deprecated?

2014-02-25 Thread dennis-fedco
Similar yet different question. I figure a different thread is in order not to muddle this into my previous one with a slightly different subject. Was Zend Measure deprecated? http://framework.zend.com/manual/1.12/en/zend.measure.edit.html I need some kind of a way to convert Imperial units

[fw-general] Refactoring towards ZF2 (subfolders)

2014-03-04 Thread dennis-fedco
I have an application where all its classes are in folder called ./class. So, for example, I would have ./class/Device.php to host my class, because: 1) class folder holds my application's classes. It is good to separate my classes from everything else 2) name of my class is there to

[fw-general] Re: Refactoring towards ZF2 (subfolders)

2014-03-04 Thread dennis-fedco
Thanks, well that's better. I was going by ZF2 Module Structure ( http://framework.zend.com/manual/2.2/en/modules/zend.mvc.intro.html http://framework.zend.com/manual/2.2/en/modules/zend.mvc.intro.html .) Right now, other developers will hate me for having to refer to my class like this:

[fw-general] Re: Refactoring towards ZF2 (subfolders)

2014-03-11 Thread dennis-fedco
hey I got a little lost. * why are there similar but different PSRs concerning paths and namespaces? * what sis a vendor specific prefix? In my case I am writing the app, so there is no 3rd party vendor. * why is your 'Prefix' equals '/src'? I thought a 'Prefix' is a descriptive name for a 3rd

[fw-general] Re: Refactoring towards ZF2 (subfolders)

2014-03-14 Thread dennis-fedco
Ah alright I think I get it a bit more. So just to double-check my *module/Outline/src/Outline/Entity/Device.php* will become *module/Outline/src/Entity/Device.php* in essence, saving me one depth level? -- View this message in context:

[fw-general] test or tests?

2014-03-21 Thread dennis-fedco
https://github.com/ZF-Commons/ZfcBase/tree/master/test, but https://github.com/ZF-Commons/ZfcUser/tree/master/tests Well, which is it ?! :) Dennis -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/test-or-tests-tp4661898.html Sent from the Zend Framework

[fw-general] Re: test or tests?

2014-03-24 Thread dennis-fedco
I hope this does not become like creat without an e http://stackoverflow.com/questions/8390979/why-create-system-call-is-called-creat there are two schools of thoughts on this I guess. One is that test is assumed to be a (single) container for tests, much like ZfcUser is a container for

[fw-general] How to use View Helper - Partial without full ZF2?

2014-04-04 Thread dennis-fedco
Question: how can I (is it possible to) use View Helper - Partial http://framework.zend.com/manual/2.3/en/modules/zend.view.helpers.partial.html without having ZF2 in place? Namely I am slowly refactoring some legacy codebase towards ZF2, and there is no Application just yet. But there are

[fw-general] Re: How to use View Helper - Partial without full ZF2?

2014-04-04 Thread dennis-fedco
I see that on the View Partial Helper there is a class called $this. when I do *?php echo $this-partial(...); ?* $this class has the type of *Zend\View\Renderer\PhpRenderer* Interestingly, there is no function partial() anywhere in ZF2 codebase. The closest I can find is this comment

[fw-general] Re: How to use View Helper - Partial without full ZF2?

2014-04-07 Thread dennis-fedco
I am afraid it's not as simple ... I mean ... I am not using any Framework configuration just yet. The code I am working with is mixed Controller and View and Model code. It most likely will require major cleanup before I can create a real view template to be able to use a View Helper. It

[fw-general] Re: How to use View Helper - Partial without full ZF2?

2014-04-07 Thread dennis-fedco
yay it has been resolved! lt;?phpnamespace someTest;include vendor/autoload.php;use Zend\View\Renderer\PhpRenderer;use Zend\View\Resolver;//create a Template Stack$stack = new Resolver\TemplatePathStack(array('script_paths' = array(__DIR__ . '/module/Module/view/partial')));//create a

[fw-general] Upgrade to 2.3.1 Failed

2014-04-17 Thread dennis-fedco
I have a peculiar issue I did a php composer.phar update and it removed my 2.3.0 version and installed entire zend framework version 2.2.5, when my composer.json has this: repositories:[ { type:composer, url:https://packagist.org/; }, { type:composer,

[fw-general] Incorporating ZF2 into existing non-framework code

2014-05-23 Thread dennis-fedco
What I have now is existing code that I suppose in a way is a framework of sorts in itself. It has some main script files that get called on every request and amount themselves to being configuration of the main application + user login and session maintenance. URL routing is tied to the file

[fw-general] How to render ViewModel immediately (preventing future events)

2014-05-27 Thread dennis-fedco
Can I render View/ViewModel immediately? There was a feature of ZF2 where one could avoid event triggering, or stop any future event triggering or view model rendering and return from that ViewModel() immediately, rendering something to the browser. What was it? I am using ViewModel code of ZF2

[fw-general] Re: How to render ViewModel immediately (preventing future events)

2014-05-28 Thread dennis-fedco
Yes by the way found what I was looking for here as well: http://mateusztymek.pl/blog/using-standalone-zend-view Thanks -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/How-to-render-ViewModel-immediately-preventing-future-events-tp4662096p4662098.html

[fw-general] Is that a good/bad/neutral practice to pass variables to Controller methods?

2014-06-10 Thread dennis-fedco
Generally looking at ZF2 examples, I generally see that methods called xxxAction() contain no parameters. In fact I can't recall an example where there is a parameter passed in such manner. Should one avoid using parameter passing when calling Controller's Action methods, or is it pretty much

[fw-general] Re: Routing configuration problem makes me crazy

2014-06-10 Thread dennis-fedco
sorry that I cannot offer much concrete help, but consider this: 1. Any kind of Configuration in ZF2 drove me crazy as well. When you get into configuring 3rd party modules, that becomes twofold (taming ZF2, taming modules) 2. Go back to step where things worked. Carefully change one unit

[fw-general] on getQuery()

2014-06-12 Thread dennis-fedco
What is the rationale behind using $request-getQuery() vs using $_GET directly? is getQuery() there to provide an Object Oriented way of accessing $_GET, or is there more to it? Because from initial testing ... I do not see much different except the syntax. And the ability to use default value,

[fw-general] How to render PDFs in Zend Framework

2014-07-29 Thread dennis-fedco
I've heard that one can set up a rendering strategy in ZF2, where I prepare my data, send it to a PDF template, and something (rendering engine) renders PDF from my data. How? I need to be able to create PDFs, while doing things: * (essentially using blank PDF as a template) - Ability to

[fw-general] Re: How to render PDFs in Zend Framework

2014-07-30 Thread dennis-fedco
you want to use one pdf as a background Yes and render another PDF on top of it? Not quite. Render things like HTML table, text, and circles on top of it. -- View this message in context:

[fw-general] Pros/Cons of placing "test[s]" folder in your "module" directory

2015-12-17 Thread dennis-fedco
Is there any significant benefit or detriment in placing my "test[s]" folder inside the "module" directory structure rather than at the project level? Example: "module/ModuleName/test/" Some Pros: * Encapsulation. For example, the module and its tests can be moved as a unit from one project