Yii PHP Framework - implementation

I was just wondering if Yii should be compiled in PHP or not. Is it possible to use Yii by simply copying the Framework into a folder on the server and then including something (something like one of the yii files - I'm not sure how this works) in the scripts for which I want to use the framework?

(Noob when it comes to frameworks and usage)

Thanks Josh

+3
source share
3 answers

I will go with the line

Is it possible to use Yii only by copying the Framework to a folder on the server, and then turn on something

and answer yes: p Although you just need to follow the creation of the webapp via yiic webapplike like this:

  • yii (yii-someversion.tar.gz ),
  • - (, /opt/yii * nix C:/web/yii windows.)
  • ($PATH in * nix %PATH% windows),
  • /, webserver document root yiic webapp <app folder name>

, index.php, , - :

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run();

: p

+5

Yii - PHP, . - -. .

+2

, , , , , yii.php index.php , yii, "protected", index.php "/protected/framework/yii.php"

0
source

Source: https://habr.com/ru/post/1742509/


All Articles