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
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 -
*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
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
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
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
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
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
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(
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
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
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
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
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
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
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
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:
спасибо. 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:
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:
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 --
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:
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
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
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
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
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
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
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
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
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:
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
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
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:
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
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:
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
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
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
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
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
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
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,
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
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
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
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
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
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,
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
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:
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
51 matches
Mail list logo