Ладно, но если у вас есть composer, то установить достаточно просто.
дополнительно -> консоль
для использования под прокси нужно сначала прописать
set http_proxy=http://proxy.ru:port/
set https_proxy=http://proxy.ru:port/
где proxy.ru - название вашего прокси, port - числовое значение порта
Привожу список команд из консоли openserver
Microsoft Windows [Version 6.1.7601]
(c) Корпорация Майкрософт (Microsoft Corp.), 2009. Все права защищены.
f:\openserver>cd F:\OpenServer\domains\localhost
F:\OpenServer\domains\localhost>composer init
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self
-update" to get the latest version.
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [Des/localhost]:
Description []:
Author:
Invalid author string. Must be in the format: John Smith <john@example.com>
Author: des des <d@m.ru>
Minimum Stability []:
License []:
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]? no
Would you like to define your dev dependencies (require-dev) interactively [yes]
? no
{
"name": "Des/localhost",
"authors": [
{
"name": "des des",
"email": "d@m.ru"
}
],
"require": {}
}
Do you confirm generation [yes]?
F:\OpenServer\domains\localhost>cd composer
F:\OpenServer\domains\localhost\composer>composer instal
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self
-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies (including require-dev)
Nothing to install or update
Generating autoload files
F:\OpenServer\domains\localhost\composer>composer global require "fxp/composer-a
sset-plugin:~1.0.0"
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self
-update" to get the latest version.
Changed current directory to C:/Users/Des/AppData/Roaming/Composer
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self
-update" to get the latest version.
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (v1.0.2)
Downloading: 100%
Writing lock file
Generating autoload files
F:\OpenServer\domains\localhost\composer>composer create-project --prefer-dist y
iisoft/yii2-app-basic basic
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self
-update" to get the latest version.
Installing yiisoft/yii2-app-basic (2.0.4)
- Installing yiisoft/yii2-app-basic (2.0.4)
Downloading: 100%
Created project in basic
Loading composer repositories with package information
Installing dependencies (including require-dev)
Reading bower.json of bower-asset/jquery.inputmask (3.1.56)
Could not fetch https://api.github.com/repos/RobinHerbots/jquery.inputmask/conte
nts/bower.json?ref=4551607fef63fd4bcd675479a8c347b668b915eb, enter your GitHub c
redentials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in C:/Users/Des/AppDat
a/Roaming/Composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applica
tions
Username: des1roer
Password:
Token successfully created
Could not fetch https://api.github.com/authorizations, enter your GitHub credent
ials to go over the API rate limit
The credentials will be swapped for an OAuth token stored in C:/Users/Des/AppDat
a/Roaming/Composer/auth.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applica
tions
Username: des1roer
Password:
An existing OAuth token for Composer is present and will be reused
- Installing yiisoft/yii2-composer (2.0.3)
Downloading: 100%
- Installing ezyang/htmlpurifier (v4.6.0)
Downloading: 100%
- Installing cebe/markdown (1.1.0)
Downloading: 100%
- Installing bower-asset/jquery (2.1.4)
Downloading: 100%
- Installing bower-asset/jquery.inputmask (3.1.63)
Downloading: 100%
- Installing bower-asset/punycode (v1.3.2)
Downloading: 100%
- Installing bower-asset/yii2-pjax (v2.0.4)
Downloading: 100%
- Installing yiisoft/yii2 (2.0.4)
Downloading: 100%
- Installing swiftmailer/swiftmailer (v5.4.1)
Downloading: 100%
- Installing yiisoft/yii2-swiftmailer (2.0.4)
Downloading: 100%
- Installing yiisoft/yii2-codeception (2.0.4)
Downloading: 100%
- Installing bower-asset/bootstrap (v3.3.5)
Downloading: 100%
- Installing yiisoft/yii2-bootstrap (2.0.4)
Downloading: 100%
- Installing yiisoft/yii2-debug (2.0.4)
Downloading: 100%
- Installing bower-asset/typeahead.js (v0.10.5)
Downloading: 100%
- Installing phpspec/php-diff (v1.0.2)
Downloading: 100%
- Installing yiisoft/yii2-gii (2.0.4)
Downloading: 100%
- Installing fzaninotto/faker (v1.5.0)
Downloading: 100%
- Installing yiisoft/yii2-faker (2.0.3)
Downloading: 100%
fzaninotto/faker suggests installing ext-intl (*)
Writing lock file
Generating autoload files
chmod('runtime', 0777)...done.
chmod('web/assets', 0777)...done.
chmod('yii', 0755)...done.
F:\OpenServer\domains\localhost\composer>composer create-project --prefer-dist y
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "f:\openserver\modul
[InvalidArgumentException]
Could not find package y with stability stable.
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugirsion]
F:\OpenServer\domains\localhost\composer>composer create-project --prefer-dist yiisoft/yii2-app-advanced advanced
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "f:\openserver\modules\php\PHP-5.4\composer.phar self-update" to get the latest version.
Installing yiisoft/yii2-app-advanced (2.0.4)
- Installing yiisoft/yii2-app-advanced (2.0.4)
Downloading: 100%
Created project in advanced
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing yiisoft/yii2-composer (2.0.3)
Loading from cache
- Installing ezyang/htmlpurifier (v4.6.0)
Loading from cache
- Installing cebe/markdown (1.1.0)
Loading from cache
- Installing bower-asset/jquery (2.1.4)
Loading from cache
- Installing bower-asset/jquery.inputmask (3.1.63)
Loading from cache
- Installing bower-asset/punycode (v1.3.2)
Loading from cache
- Installing bower-asset/yii2-pjax (v2.0.4)
Loading from cache
- Installing yiisoft/yii2 (2.0.4)
Loading from cache
- Installing swiftmailer/swiftmailer (v5.4.1)
Loading from cache
- Installing yiisoft/yii2-swiftmailer (2.0.4)
Loading from cache
- Installing yiisoft/yii2-codeception (2.0.4)
Loading from cache
- Installing bower-asset/bootstrap (v3.3.5)
Loading from cache
- Installing yiisoft/yii2-bootstrap (2.0.4)
Loading from cache
- Installing yiisoft/yii2-debug (2.0.4)
Loading from cache
- Installing bower-asset/typeahead.js (v0.10.5)
Loading from cache
- Installing phpspec/php-diff (v1.0.2)
Loading from cache
- Installing yiisoft/yii2-gii (2.0.4)
Loading from cache
- Installing fzaninotto/faker (v1.5.0)
Loading from cache
- Installing yiisoft/yii2-faker (2.0.3)
Loading from cache
fzaninotto/faker suggests installing ext-intl (*)
Writing lock file
Generating autoload files
F:\OpenServer\domains\localhost\composer>cd F:\OpenServer\domains\localhost\composer\advanced
F:\OpenServer\domains\localhost\composer\advanced>php init
Yii Application Initialization Tool v1.0
Which environment do you want the application to be initialized in?
[0] Development
[1] Production
Your choice [0-1, or "q" to quit] 0
Initialize the application under 'Development' environment? [yes|no] yes
Start initialization ...
generate backend/config/main-local.php
generate backend/config/params-local.php
generate backend/web/index-test.php
generate backend/web/index.php
generate common/config/main-local.php
generate common/config/params-local.php
generate console/config/main-local.php
generate console/config/params-local.php
generate frontend/config/main-local.php
generate frontend/config/params-local.php
generate frontend/web/index-test.php
generate frontend/web/index.php
generate yii
generate cookie validation key in backend/config/main-local.php
generate cookie validation key in frontend/config/main-local.php
chmod 0777 backend/runtime
chmod 0777 backend/web/assets
chmod 0777 frontend/runtime
chmod 0777 frontend/web/assets
chmod 0755 yii
chmod 0755 tests/codeception/bin/yii
... initialization completed.
F:\OpenServer\domains\localhost\composer\advanced>composer self-update
Updating to version 74e7c5fe22dc456336a2b20c7b12a9a83fc4af09.
Downloading: 100%
Use composer self-update --rollback to return to version 37ec0bde9dd6826591308e7a1ad55cb5e38ef117
F:\OpenServer\domains\localhost\composer\advanced>
Видите - все достаточно просто как и описано здесь (при переходе Ctrl+F и ищите Composer)
Сначала создаем json для composer
D:\webmaster\OpenServer\domains\composer>composer init
Warning: This development build of composer is over 30 days old. It is recommen
ed to update it by running "d:\webmaster\openserver\modules\php\PHP-5.4\compose
.phar self-update" to get the latest version.
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [zuev_np/composer]: des/des
Description []:
Author:
Invalid author string. Must be in the format: John Smith <john@example.com>
Author: des des <d@m.ru>
Minimum Stability []:
License []:
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]? no
Would you like to define your dev dependencies (require-dev) interactively [yes
? no
{
"name": "des/des",
"authors": [
{
"name": "des des",
"email": "d@m.ru"
}
],
"require": {}
}
Do you confirm generation [yes]?
D:\webmaster\OpenServer\domains\composer>
и получаем в D:\webmaster\OpenServer\domains\composer\composer.json
Пишем логи на C# (.NET). Легкий способ. При написании небольших служб на C# бывает необходимость писать логи работы программы. В этой статье я опишу быстрый и удобный способ логирования ошибок и исключений в программе не C#. Постановка задачи Нужен класс (Log) с одним статическим методом (Write), в который передается объект класса Exception. Метод Write должен записать в файл с логом строчку со следующей информацией: Дата/Время Полное имя метода, в котором возникло исключение Свойство Message объекта исключения Первое найти не проблема: DateTime.Now Полное имя метода можно получить из свойства объекта исключения TargetSite: string className = ex.TargetSite.DeclaringType; string methodName = ex.TargetSite.Name; Теперь сводим все вместе с один класс: using System; using System.IO; using System.Text; using System.Diagnostics; using System.Reflection; namespace LogHelper { public class Log { private static object sync = new object(); public static voi
1 урок Создание сайта с использованием Yii 2.x В данном учебнике описывается процесс создания сайта. Каждый шаг разработки описан максимально подробно и может быть применён при создании других приложений. В дополнение к полному руководству и API , данное пособие показывает, вместо полного и подробного описания, пример практического применения фреймворка Yii. Для того, чтобы выполнять упражнения из учебника понадобятся инструменты composer и git . Не отчаивайтесь, если вам не известны эти инструменты, нужно будет лишь выполнить несколько команд, которые будут описаны. Разработчики данного интерактивного курса: Евгений Ткаченко ( et.coder@gmail.com ) Сообщество Yii Форум GitHub Facebook Twitter LinkedIn Начальная установка Установим стартовый шаблон приложения [Yii 2 Advanced Project Template] . Для этого необходимо выполнить команды, из корневой директории учебника(yii2-tutorial): composer global require "fxp/composer-asset-plugin:1.0.
Комментарии
Отправить комментарий