文章目录
1. Mac 搭建Yii开发环境
打开终端
1.开启Apache服务 sudo apachectl start
2.查看Apache服务版本 sudo apachectl -v
3.打开浏览器输入:localhost,显示It works!表示Apache已启动
4.开启php模块 vi /etc/apache2/httpd.conf 去掉#LoadModule php5_module libexec/apache2/libphp5.so前的注释
5.生成php配置文件 cp /etc/php.ini.default /etc/php.ini
6.重启Apache sudo apachectl restart
7.测试是否开启php模块 vi http:///Library/WebServer/Document/test.php test.php写入<?php phpinfo();?>
8.浏览器输入 http://localhost/test.php 如果打印出php相关信息说明安装php成功
9.打开重写模块 vi /etc/apache2/httpd.conf 去掉#LoadModule rewrite_module libexec/apache2/mod_rewrite.so 前的注释
10.可以更改项目文件目录 vi etc/apache2/httpd.conf文件中的DocumentRoot改为自定义目录
11.重启Apache
如果遇到其他问题可以查看日志,在应用中搜Console
2. 创建basic项目
Panda-MBP:PHP panda8z$ composer create-project yiisoft/yii2-app-basic yii
Installing yiisoft/yii2-app-basic (2.0.19)
- Installing yiisoft/yii2-app-basic (2.0.19): Downloading (100%)
Created project in yii
Loading composer repositories with package information
^C
Panda-MBP:PHP panda8z$ composer create-project yiisoft/yii2-app-basic yii-basic
Installing yiisoft/yii2-app-basic (2.0.19)
- Installing yiisoft/yii2-app-basic (2.0.19): Loading from cache
Created project in yii-basic
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 71 installs, 0 updates, 0 removals
- Installing yiisoft/yii2-composer (2.0.7): Downloading (100%)
- Installing phpspec/php-diff (v1.1.0): Downloading (100%)
- Installing bower-asset/jquery (3.4.1): Downloading (100%)
- Installing bower-asset/yii2-pjax (2.0.7.1): Downloading (100%)
- Installing bower-asset/punycode (v1.3.2): Downloading (100%)
- Installing bower-asset/inputmask (3.3.11): Downloading (100%)
- Installing cebe/markdown (1.2.1): Downloading (100%)
- Installing ezyang/htmlpurifier (v4.10.0): Downloading (100%)
- Installing yiisoft/yii2 (2.0.21): Downloading (100%)
- Installing yiisoft/yii2-gii (2.1.0): Downloading (100%)
- Installing codeception/verify (0.4.0): Downloading (100%)
- Installing myclabs/deep-copy (1.9.1): Downloading (100%)
- Installing codeception/specify (0.4.6): Downloading (100%)
- Installing bower-asset/bootstrap (v3.4.1): Downloading (100%)
- Installing yiisoft/yii2-bootstrap (2.0.10): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.11.0): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.11.0): Downloading (100%)
- Installing symfony/polyfill-intl-idn (v1.11.0): Downloading (100%)
- Installing symfony/polyfill-iconv (v1.11.0): Downloading (100%)
- Installing doctrine/lexer (1.0.2): Downloading (100%)
- Installing egulias/email-validator (2.1.9): Downloading (100%)
- Installing swiftmailer/swiftmailer (v6.2.1): Downloading (100%)
- Installing yiisoft/yii2-swiftmailer (2.1.2): Downloading (100%)
- Installing yiisoft/yii2-debug (2.1.5): Downloading (100%)
- Installing fzaninotto/faker (v1.8.0): Downloading (100%)
- Installing yiisoft/yii2-faker (2.0.4): Downloading (100%)
- Installing sebastian/recursion-context (3.0.0): Downloading (100%)
- Installing sebastian/exporter (3.1.0): Downloading (100%)
- Installing doctrine/instantiator (1.2.0): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (5.0.10): Downloading (100%) - Installing codeception/stub (1.0.4): Downloading (100%)
- Installing sebastian/diff (2.0.1): Downloading (100%)
- Installing sebastian/comparator (2.1.3): Downloading (100%)
- Installing behat/gherkin (v4.4.5): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%)
- Installing symfony/dom-crawler (v4.3.1): Downloading (100%)
- Installing symfony/css-selector (v4.3.1): Downloading (100%)
- Installing symfony/browser-kit (v4.2.4): Downloading (100%)
- Installing symfony/yaml (v4.3.1): Downloading (100%)
- Installing symfony/event-dispatcher-contracts (v1.1.5): Downloading (100%) - Installing psr/container (1.0.0): Downloading (100%)
- Installing symfony/event-dispatcher (v4.3.1): Downloading (100%)
- Installing symfony/service-contracts (v1.1.5): Downloading (100%)
- Installing symfony/polyfill-php73 (v1.11.0): Downloading (100%)
- Installing symfony/console (v4.3.1): Downloading (100%)
- Installing symfony/finder (v4.3.1): Downloading (100%)
- Installing ralouphie/getallheaders (2.0.5): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.5.2): Downloading (100%)
- Installing theseer/tokenizer (1.1.3): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/environment (3.1.0): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%) - Installing phpunit/php-token-stream (2.0.2): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
- Installing phpunit/php-code-coverage (5.3.2): Downloading (100%)
- Installing sebastian/resource-operations (1.0.0): Downloading (100%) - Installing sebastian/object-reflector (1.1.1): Downloading (100%)
- Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
- Installing sebastian/global-state (2.0.0): Downloading (100%)
- Installing phpunit/php-timer (1.0.9): Downloading (100%)
- Installing webmozart/assert (1.4.0): Downloading (100%)
- Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%) - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (4.3.1): Downloading (100%) - Installing phpspec/prophecy (1.8.1): Downloading (100%)
- Installing phar-io/version (1.0.1): Downloading (100%)
- Installing phar-io/manifest (1.0.1): Downloading (100%)
- Installing phpunit/phpunit (6.5.14): Downloading (100%)
- Installing codeception/base (2.3.9): Downloading (100%)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
swiftmailer/swiftmailer suggests installing ext-intl (Needed to support internationalized email addresses)
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
symfony/browser-kit suggests installing symfony/process
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
symfony/console suggests installing psr/log (For using the console logger)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
codeception/base suggests installing aws/aws-sdk-php (For using AWS Auth in REST module and Queue module)
codeception/base suggests installing codeception/phpbuiltinserver (Start and stop PHP built-in web server for your tests)
codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
codeception/base suggests installing league/factory-muffin (For DataFactory module)
codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
codeception/base suggests installing stecman/symfony-console-completion (For BASH autocompletion)
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
> yii\composer\Installer::postCreateProject
chmod('runtime', 0777)...done.
chmod('web/assets', 0777)...done.
chmod('yii', 0755)...done.
> yii\composer\Installer::postInstall
Panda-MBP:PHP panda8z$
3. Inkscape 0.92.4 - Mac-Os-X : Macports | Inkscape
4. 《Kotlin核心编程》
kotlinc
进入REPL模式
kotlinc -h
信息如下:
Panda-MBP:~ panda8z$ kotlinc -h
Usage: kotlinc-jvm <options> <source files>
where possible options include:
-classpath (-cp) <path> Paths where to find user class files
-d <directory|jar> Destination for generated class files
-include-runtime Include Kotlin runtime in to resulting .jar
-java-parameters Generate metadata for Java 1.8 reflection on method parameters
-jdk-home <path> Path to JDK home directory to include into classpath, if differs from default JAVA_HOME
-jvm-target <version> Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11 or 12), default is 1.6
-module-name <name> Name of the generated .kotlin_module file
-no-jdk Don't include Java runtime into classpath
-no-reflect Don't include kotlin-reflect.jar into classpath
-no-stdlib Don't include kotlin-stdlib.jar or kotlin-reflect.jar into classpath
-script Evaluate the script file
-script-templates <fully qualified class name[,]>
Script definition template classes
-Werror Report an error if there are any warnings
-api-version <version> Allow to use declarations only from the specified version of bundled libraries
-X Print a synopsis of advanced options
-help (-h) Print a synopsis of standard options
-kotlin-home <path> Path to Kotlin compiler home directory, used for runtime libraries discovery
-language-version <version> Provide source compatibility with specified language version
-P plugin:<pluginId>:<optionName>=<value>
Pass an option to a plugin
-progressive Enable progressive compiler mode.
In this mode, deprecations and bug fixes for unstable code take effect immediately,
instead of going through a graceful migration cycle.
Code written in the progressive mode is backward compatible; however, code written in
non-progressive mode may cause compilation errors in the progressive mode.
-nowarn Generate no warnings
-verbose Enable verbose logging output
-version Display compiler version
@<argfile> Expand compiler arguments from the given file, containing one argument or file path per line
Panda-MBP:~ panda8z$