Recently I've been working on Symfony project using a git repo. My problem is that when I try to clear the symfony's cache using php symfony cc or php symfony cache:clear i get message like:
Task "cc" is not defined.
Also, when I list all the possible actions using php symfony I can't find anything connected with clearing cache.
What's weird is that my friend using the same repo can clear his cache.
I'm using Fedora 16, Symfony's version is 1.4.17-DEV.
Tom
Look in your .../symfony/lib/cache/ directory, may be empty, if so, recopy symfony files
Good luck
Related
I am trying to create a symfony2 project, with the symfony2.8 version. However whenever I create a symfony project in netbeans I cannot find where to specify the version of symfony and it always creates a symfony3 project. Is there any way to tell netbeans to use the symfony2 version instead of 3?
I'd save yourself the headache and time of trying to figure that out, and instead use the Symfony recommended way.
php -r "readfile('https://symfony.com/installer');" > symfony
# for example, if WAMP is used ...
">c:\> move symfony c:\wamp\bin\php
# ... then, execute the command as:
">c:\> symfony
# moving it to your projects folder ...
">c:\> move symfony c:\projects
# ... then, execute the command as
">c:\> cd projects
">c:\projects\> php symfony
https://symfony.com/doc/current/setup.html
Net-beans will still recognise your project as a Symfony project along with all the added benefits, but also with the ease of setting up new Symfony projects with one command from the CLI.
If you really want to stick to the Net-beans way, simply allow Net-beans to install it, however it chooses. Once it's installed change the version number within the composer.json file. The biggest issue you'll have for this is you'll have to check all your version numbers are compatible.
I wonder if someone can help me. I've been handed in a Cake PHP app that I need to 1) add minor changes 2) deploy. I've never really worked with Cake before and was wondering whether do I need to anything in order for it to work?
For instance, With a Node app, you need to install modules npm install. With a Rails app you'll likely need to install the gems bundle install.
Is there something similar with Cake? I've set the localhost server, but when I try to access the url I get all sort of errors. Some I've fixed (missing environment settings which I just override the Redis host and port). The latest one is:
{
"exception":{
"class":"MissingControllerException",
"code":404,
"message":"Controller class Controller could not be found.",
"file":"\/Library\/WebServer\/Documents\/php\/oompbe\/vendors\/cakephp\/lib\/Cake\/Routing\/Dispatcher.php",
"line":154,
"trace":[
"#0 \.../app\/webroot\/index.php(109): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))",
"#1 {main}"
]
}
}
PS: What's up with all the crazy \/\/?
PPS: Can I find out the version Cake I'm running?
CakePHP is just php. As most properly done php apps these days it comes with composer. I recommend you to read at least the basics of it's manual. Composer is an awesome tool.
git clone <repo>
cd <reponame>
composer install
If you start a new Cake application the official documentation tells you how to this as well:
composer create-project --prefer-dist cakephp/app [app_name]
If you want to automate things further composer provides you callback scripts. They'll allow you to automate tasks, basically trigger commands, after different actions. This is pretty useful to build assets after a composer update for example. I recommend you to not put lots of commands into that section but instead have dedicated script files you trigger by the callbacks.
Can I find out the version Cake I'm running?
If installed via composer it is usually in vendor/cakephp/cakephp/version.txt. Check the content of that file.
I am trying to update my project written in Symfony 2.0 into Symfony 2.2.
Moving source codes into 2.2 project ended with config.yml and security.yml incompatibiliy.
Is there way how to properly migrate Symfony 2.0 project into Symfony 2.2?
It better to wait until Symfony 2.3 before migrating. It will be released somewhere in May. It's the first LTS (Long Time Support) release, meaning that it's maintained for three years. So: You don't have to worry about BC breaks for 3 years!
For the migrating of Symfony 2.0 to 2.3: There is nothing you can do. Read the UPGRADE-*.md files (which are stored in the root of the symfony/symfony package) and fix anything that is in their in your code. Every BC break that's important for normal users will be put in those UPGRADE files.
If you can't solve it after the fixing everything in the UPGRADE files, you should take a look at the CHANGELOG.md files in the root of the package (e.g. the symfony/security package). Try to find something that is changed and cause your code to break.
Finally, if you don't get your script working, there are a lot of active Symfony2 users who are waiting to help you. Take a look at the community page and find your place to ask questions.
I'm trying to run a Symfony project that I cloned from a GitHub. I've never used Symfony before but I'd like to run the project.
I read you needed to run frontend_dev.php so I ran that in to my browser:
C:\Users\Computer\Desktop\Project\WebInterface\web\frontend_dev.php
But just got a blank page with some PHP on it. I believe I may have to set up a web server but I'm not sure and figured I'd ask here first.
If I wanted to run the project from my computer, would I just download an Apache server and drop it in the root directory? What variables and files would I need to change to get it working properly? Do I need to forward any ports?
Symfony 1.x branch is not supported anymore. Use Symfony 2.
Anyway, concerning your question: here is the doc for 1.4: Day 1: Starting up the Project
I'm trying to create my first page in Symfony2 according to this tutorial: http://symfony.com/doc/2.0/book/page_creation.html. Can anyone please tell how should I run this command:
php app/console init:bundle "Acme\StudyBundle" src
I'm new to symfony and I have no idea what this means...
php app/console init:bundle "Acme\StudyBundle" src
is a shell command you're meant to run at the command line of the machine you've installed Symfony on. You change into the directory where you installed symfony, and run it -- how you do that is obviously operating system- and installation-dependent.
The command itself invokes the command-line version of your PHP interpreter (php) to run Symfony's console script (app/console) to initialise a new Symfony bundle (init:bundle) called StudyBundle, from the (pretend!) company Acme (Acme\StudyBundle) in the directory src.
For me, running it would look a bit like this (from Terminal, on a Mac):
Matt-Gibsons-iMac:~ matt$ cd Sites/Symfony
Matt-Gibsons-iMac:Symfony matt$ php app/console init:bundle "Acme\StudyBundle" src
Summary of actions
- The bundle "AcmeStudyBundle" was created at "src/Acme/StudyBundle" and is using the namespace "Acme\StudyBundle".
...
A word of warning, though: Symfony 2 is still very new -- not yet even officially released -- and while what documentation there is is okay, the docs are nothing like as complete or helpful to the beginner as the excellent, mature documentation for Symfony 1.4. Also, Symfony 2 best practices have yet to be established.
So, if you're a complete Symfony novice you might find Symfony 1.4 easier going, especially following the Jobeet tutorial. Even though Symfony 2 is quite a big change from Symfony 1, learning Symfony 1 will introduce you to a lot of concepts that remain familiar in Symfony 2, such as generating new code modules from the command line, like you're trying to do here.