This post has NOT been accepted by the mailing list yet.
Hello everyone
ok let's go strait to the point so i want to customize my ZF2 instalation but i couldn't find any kind of documentaion so let me tell you first what i did
i installed the ZendSkeletonApplication correctly and everything was good i was able to view the index page from my browser so i wanted to change the zf2 library location and i changed it to /usr/ZF2 after that i changed my httpd.conf by adding SetEnv ZF2_PATH /usr/ZF2 and of course also my include_path in php.ini and i again i was able to view the index page so i said i should now remove vendor directory which i wanted in the first place one i did that nothing seem to work i opened the init_autoloader.php and guess what the probleme is in this 2 lines
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
} ==> it was autoloading
i copied back my vendor directory so that i can study where do autoloading need this vendor directory and it seems that it does need it heir
the probleme is whenever i try to change the array so that it will pont to my new library location the zf2 breakdown but when i channged back everything work
So now the questions ?
1-can someone plz explain to me why this is happening
2-can you plz tell me how to get ride of this vendor directory
On 22 February 2014 21:32, Mr User [via Zend Framework Community] <[hidden email]> wrote:
Hello everyone
ok let's go strait to the point so i want to customize my ZF2 instalation but i couldn't find any kind of documentaion so let me tell you first what i did
What exactly do you mean by "customize my ZF2 instalation"? What is being changed?
i installed the ZendSkeletonApplication correctly and everything was good i was able to view the index page from my browser so i wanted to change the zf2 library location and i changed it to /usr/ZF2
You are not supposed to do that anymore. Global library installations is a bad idea in most cases - ZF2 allows you to do that, but you must have strong reasoning to actually apply that.
after that i changed my httpd.conf by adding SetEnv ZF2_PATH /usr/ZF2 and of course also my include_path in php.ini and i again i was able to view the index page so i said i should now remove vendor directory which i wanted in the first place one i did that nothing seem to work i opened the init_autoloader.php and guess what the probleme is in this 2 lines
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
} ==> it was autoloading
i copied back my vendor directory so that i can study where do autoloading need this vendor directory and it seems that it does need it heir
the probleme is whenever i try to change the array so that it will pont to my new library location the zf2 breakdown but when i channged back everything work
That is normal, composer is not designed for global includes
So now the questions ?
1-can someone plz explain to me why this is happening
Composer installs dependencies per-project.
2-can you plz tell me how to get ride of this vendor directory
You shouldn't. I would help you on that only if I had an exact reasoning on why you are trying to do that.
well as i said before there is actually no raison at all it's just i wont it to be like that i don't even think that there will be some kind of security application because let's be honest to move a directoryto /usr only mean that you are the root of the system so i don't know what's are you trying to say but any way if you don't wont replay just say it no one will tell why ?
it's by fighting the freamwork that you will learn more
On 23 February 2014 23:18, Mr User [via Zend Framework Community] <[hidden email]> wrote:
well as i said before there is actually no raison at all it's just i wont it to be like that
That's how we used to code with PEAR dependencies, which were system-wide. It works, but it will bite you back.
i don't even think that there will be some kind of security application
The security implication is that multiple apps share the same codebase from `/usr`, and you may not be able to upgrade without upgrading all apps that reference it. If you have a security issue you should be able to upgrade ASAP ;-)
because let's be honest to move a directoryto /usr only mean that you are the root of the system
Yes, the problem is sharing the codebase across multiple installations.
so i don't know what's are you trying to say but any way if you don't wont replay just say it no one will tell why ?
it's by fighting the freamwork that you will learn more
Agreed on that, I hope I made my point clear.
You can put ZF2 wherever you want as long as you export the "ZF2_PATH" var environment setting correctly - it just is almost never needed, if not harmful.
first of all thank you for the info but any way even if you have a website you will not upgrade it each time it will be some how time consuming
well i tried what you saied but it dosn't work in fact i changed the autoload_namespaces.php so that i will point to the zend library but for some reason it dosn't work
On 24 February 2014 18:19, Mr User [via Zend Framework Community] <[hidden email]> wrote:
first of all thank you for the info but any way even if you have a website you will not upgrade it each time it will be some how time consuming
Yes, but we can't run away from that - parch releases are designed to handle that.
well i tried what you saied but it dosn't work in fact i changed the `autoload_namespaces.php` so that i will point to the zend library but for some reason it dosn't work
Well, if you use composer's autoloader, that one is going to be dictating that ZF2 comes from somewhere inside `vendor`. You can't really edit ANYTHING without `vendor`, since that's composer's domain (no touching!).
Instead, customize your `autoload_namespaces.php` by registering your own autoloader manually. You can just edit that file, no problems.
i loose everything even if the ZF2_PATH is registred in my path to the zend library i don't understand why ? i have read the source code of the files but i can't seem to know why the composer autoloader failed to charge the freamwork when i do change the zend library path
i loose everything even if the ZF2_PATH is registred in my path to the zend library i don't understand why ? i have read the source code of the files but i can't seem to know why the composer autoloader failed to charge the freamwork when i do change the zend library path
If you reply to this email, your message will be added to the discussion below:
no i don't want to rename vendor directory i want to remove it entirely and inside the composer directory it will only contain those files because here is how i see it first of all i downloaded the zf2 library from website then when i was doing the SkeletonApplication example i noticed that the vendor directory contain also the zf2 library at this point i had to remove one either the one that i alredy download or the one that the composer download it and because i wan't things different i choosed to remove the one included in the vendor directory and eventually all the directory
again i repeat i just wan't to do it you may think it's clean but i don't see it that way it's soooo messy for me