Yii : how to install yii-user - php

I need to install yii-user.
I am currently referring this page: http://www.yiiframework.com/extension/yii-user/.
But I don't understand some parts, like when they "Change your config main" I don't know which file. As well as "Change your config console:". And I don't know where to run this command yiic migrate --migrationPath=user.migrations.
Could anybody help me with detailed installation steps?
Thank you

For installing the extension yii-user, download it and copy it under the protected folder.
Steps to follow :
Generate a new application using the command in your terminal:
sudo ./yiic webapp /var/www/html/yiisite
Download the extension yii-user and copy it to protected folder of
the generated site.
Make the changes in the yiisite/protected/config/main.php
Replace yiisite with your generated application directory name.
Some recommendations :
Whenever you are about to use a framework or new technology always refer the documentation, it contains a whole lot of information to help you get started. In case you are learning Yii framework, check the documentation here
For ex : If you are using linux. Go to your yii framework directory and type the following . As I use ubuntu so to create a new application I would type :
sudo ./yiic webapp /var/www/html/yiisite
This command would generate a new application for you. And regarding your doubt for the config settings. It will be the file "Your generated site/protected/config/main.php".
For Ex : In my case it is yiisite/protected/config/main.php
My suggestion would be to spend some time reading the documentation to understand how things work in Yii or watch the video tutorials Yii Tuts
Hope this helps you.

Related

PhpDocumentor for Laravel 5.7/6.x

This might be a very newbie question but, how exactly do you use phpDocumentor to generate your docs through Laravel? In my Laravel project there's no phpdoc in the vendor/bin directory, and trying to install phpDocumentor via composer fails (as suggested on the GitHub page).
I couldn't find any recent resources about it, the only thing I had luck with is running the phpDocumentor.phar file from the terminal, but the newest version fails immediately.
To get this working, downgrade to PHP 7.1. Then download the latest phpDocumentor.phar file from [http://www.phpdoc.org/phpDocumentor.phar]. Place the phpDocumentor.phar into your Laravel 6.x project's /vendor/bin/ directory.
Then use Homebrew to install other needed packages...
brew install intltool
brew install graphviz
Lastly, cd into /vendor/bin and run...
php phpDocumentor.phar -d ../../app/Http/Controllers
Your documentation output should be at /vendor/bin/output.
Adding a more complete solution that worked for me on creating documentation of my Laravel project with the system environment comprising of MacOS Catalina,Laravel 6 and PHP 7.2.
Visit https://docs.phpdoc.org/3.0/guide/getting-started/installing.html. To install the dependencies, recommended to update homebrew as brew update and brew upgrade. After updating the homebrew, execute the following:
brew install graphviz
brew install plantuml
Once the dependencies are installed, download the phpDocumentor.phar from the above link, and make the file executable as follows:
chmod +x phpDocumentor.phar
Then, copy and paste this file to your laravel app under /vendor/bin
I also placed this file under local bin mv phpDocumentor.phar /usr/local/bin/phpDocumentor for easier access (as shown in step 6 below).
For testing purpose, create a simple test.php file under /vendor/bin/docs/test.php directory with the following content as mentioned in https://docs.phpdoc.org/3.0/guide/getting-started/your-first-set-of-documentation.html
<?php
/**
* This is a DocBlock.
*/
function associatedFunction()
{
}
Then execute the phpdoc script from the same /vendor/bin location as:
phpDocumentor.phar -d docs/test.php -t docs/test
This will generate several files.
Open the index.html file generated in your web browser (eg. Chrome) to view the documentation:
open -a "Google Chrome" ./docs/test/index.html
Notably, because we placed the phpDocumentor.phar in /usr/local/bin/phpDocumentor/phpDocumentor.phar, we can easily access phpdoc and easily create the documentation of our whole App as follows ( the documentation will be stored inside the folder DOCS)
phpDocumentor.phar -d app/ -t DOCS/
I have found the problem with most PHP documentation solutions is they require large amounts of code just to get something you can actually use. And that takes a lot of time and trial and error to set up.
I also have issues with the generated documentation. Often it is not even sorted! Also it is hard to navigate and understand the whole class. As a consumer of a class, you are not interested in private or even protected things (unless you are trying to extend it). But often the docs only show you the methods and properties of the current class, and not what it inherits (which is the WHOLE point of OO!).
Anyway, I got sick of the current state of PHP documentation and decided to do it right. I wrote PHPFUI/InstaDoc to address all the issues I had with existing solutions. InstaDoc is the fastest document generator out there because it simply scans the class directory structure and saves it off. This generally only takes a few seconds (for large code bases) each time you generate (on release, or if you add a new class in your dev env). Then it renders the docs for a specific class at runtime, because, hey, who ever looks at the documentation anyway? Just us nerds, and there are not many of us, and we can wait a fraction of a second for the server to generate the docs on the fly. Also you don't need server disk space to store all your docs. They are generated on the fly. And of course if you have a high volume site, InstaDoc can generate static HTML files, but who has a high volume PHP doc site (like nobody).
Anyway, check out a live example at PHPFUI/InstaDoc and see if it fits your needs. It is not a Laravel module or plug in, but you should be able to run it under Laravel easily. Just return the output of the controller in your controller, and it should just work.

Unable To Install Symfony Windows 7

I am trying to install Symfony, but unable to find how can we start with symfony with Xampp. I have already tried on google but there is no proper solution for installation and configuration of Symfony.
As I want to edit a project which is already developed using symfony CMS.
Symfony is not a CMS.
If you need to run a symfony app locally, all you have to do is to copy all files into a project subdirectory inside your Xampp (for example htdocs/symfony).
I assume existing project will have a database, so be sure to import your database locally or use external database. You need to tweak your symfony config file: http://symfony.com/doc/current/configuration.html
I am trying to install Symfony, but unable to find how can we start with >symfony with Xampp. I have already tried on google but there is no proper >solution for installation and configuration of Symfony.
As I want to edit a project which is already developed using symfony CMS.
Hi, for begin Symfony is not a CMS but a framework ^^, it's a little bit (alot) different.
For install Symfony WHY use google O_o ----> http://symfony.com/doc/current/setup.html
After, why Xampp ? for windows use Wamp who do the local server it's more performing :/
And if you want you don't have necessary to install symfony if it's an existing project -> just clone it (if he is on github) ... and just open the complete folder with your IDE or text editor.
You can modify the file without problems, (just you can have a prob for use command php bin/console.
Good luck i hope it's answering all you questions :)

Could not open input file: yii

I'm working with Yii2 and trying to init some migration files. This was working a few months ago, now I'm getting the following error
'yii' is not recognized as an internal or external command
command I'm trying to run is 'yii migrate/create init_my_table
I've been looking around but not exactly sure what the problem is.
Seems like this should be a pretty generic and easy to fix error...
Before i delve into proposing a solution, check if you installed Yii's Basic Template or the Advanced Template.
$ php yii serve
will work for the "basic" template.
Make sure at the Terminal, you have changed to the "basic" directory, then enter the command:
$ php yii serve
OUTPUT
Server started on http://localhost:8080
Document root is "PATH/public_html/yiiproject/basic/web"
Quit the server with CTRL-C or COMMAND-C.
IF you are using the Advanced Template, read this thread and see if the Thread here helps. Read it till the very end:
http://www.yiiframework.com/forum/index.php/topic/68728-php-yii-serve/
Had this same issue but was using the Advanced template.
php yii serve Could not open input file: yii
i tried this command as recommended. It worked:
$ php -S localhost:8000
Hope this helps.
UPDATE FOR ADVANCED TEMPLATE
After installing Composer and Yii, open your Advanced template folder in CLI and run this command:
$ php ./init
This initialization process will setup the project and create necessary files.
Set your document root properly in apache to your /advanced/web/
More Reading to run your project:
http://www.yiiframework.com/wiki/799/yii2-app-advanced-on-single-domain-apache-nginx/
http://www.yiiframework.com/doc-2.0/guide-start-installation.html
Make you that your Environment Variables are set up correctly.
Check out these links:
Similar question
Environment Variables
Relevant parts from links:
To access the environment variables right click the My Computer icon then choose properties. Select the Advanced tab and then click Environment Variables.
window you should see
path :=>...;D:\YOURPATH\xampp\php;D:\YOURPATH\xampp\yii\yiiframework;
Try installing composer globally. I had similar issue but it was resolved after I installed composer via installation file and using my environment variables, I made available globally.

Yii - could not open input file yiic for Yii 2.0

So I downloaded a yii archive then extracted it into my xampp htdocs folder.
I wanted to create a new app but tutorials show to use yiic when creating new webapps. The problem is no yiic is found, and even in the directory, I do not see any yiic file to execute the program.
Should there be a yiic.bat?
I download Yii version 2.0 for the latest framework.
I also tried creating via Yii version 1.6 and the command worked.
The problem is i cant find yiic on 2.0.
Please run init command after installing YII from composer
sudo php init
It will ask for setting the environment, for beginning select "Development"

How do I run/use the Yii command line tool ?

What EXACTLY do I do to run the "Yiic Command line tool"
Open my reg CMD? double click on a certain file?
In the screen cast the tut tells you were going to need to use the Yii command line tool and then the screen instantly cuts to a command line that has some yii related text
My spidey sense is telling me that the answer to this question is going to probably be incredibly obvious and simple , but ive done a decent amount of searching and even if I figure it out I still think this question should be in the books because I know I cant be the only one whos never used a command line tool/was confused about this.
Only started using windows again recently but there should be a yiic.bat located in the framework directory of wherever you extracted yii. You will need to either append this location to your PATH variable or cd into the directory when you want to run yiic. You will also need php installed.
Hope this helps
Some links:
http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app
http://www.php.net/manual/en/install.windows.installer.msi.php
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
Have just had a quick go myself and seems to work, steps were:
downloaded & installed wamp http://sourceforge.net/projects/wampserver/
watched this vid http://www.youtube.com/watch?v=Rra_UKJRagA
downloaded yii http://www.yiiframework.com/download/
created a frameworks dir in wamp root as in vid and extracted yii to it
edited the yiic.bat to point to the php executable in wamp
opened CMD cd'd to the dir containing yiic.bat and typed "yiic webapp foo"
pressed return and got 'correct response from CMD'
shame the video doesn't have sound but thanks xibian for sharing :-)
If you dont like command-line tools, you can use Gii
http://www.yiiframework.com/doc/guide/1.1/en/topics.gii
Starting from version 1.1.2, Yii is equipped with a Web-based code generation tool called Gii. It supercedes the previous yiic shell generation tool which runs on command line. In this section, we will describe how to use Gii and how to extend Gii to increase our development productivity.

Categories