定制 flancer32/sample_mage2_module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flancer32/sample_mage2_module

Composer 安装命令:

composer require flancer32/sample_mage2_module

包简介

Magento 2 sample module.

README 文档

README

Stub for Magento 2 module with development environment.

Build Status

Environment is deployed using PHP Composer (sources are downloaded from Magento repo), contains simple tests units and CI descriptor to run these tests on Travis-CI.

Installation

Create local configuration

$ cp deploy.cfg.sh.init deploy.cfg.work.sh
$ nano deploy.cfg.work.sh    //edit configuration for deployment

Get credentials to authenticate on 'repo.magento.com'

Go to your Magento Connect account, section (My Account / Connect / Developer / Secure Keys) and generate pair of keys to connect to Magento 2 repository.

Setup environment

System requirements

Run deployment script

$ sh deploy.sh

Clean up application's root folder (/.../sample_mage2_module/work)...

Create M2 CE project in '/.../sample_mage2_module/work' using 'composer install'...
	Authentication required (repo.magento.com):    // NOTE: on the first iteration only if you will save credentials.
	  Username: <Magento pub key>
	  Password: <Magento priv key>
...
Filter original    // NOTE: unset unnecessary nodes and merge Magento's "composer.json" with your own options.
		'/.../sample_DB_NAME_module/work/composer.json' on
		'/.../sample_DB_NAME_module/deploy/composer_unset.json' set and populate with additional options from
		'/.../sample_DB_NAME_module/deploy/composer_opts.json'...
...
Update M2 CE project with additional options...
...
Drop M2 database DB_NAME...
Database "DB_NAME" dropped

(Re)install Magento using database 'DB_NAME' (connecting as 'USER_NAME').
...
Create working folders before permissions will be set.

Switch Magento 2 instance into 'developer' mode.
Enabled developer mode.

Set file system ownership (OWNER:GROUP) and permissions...

Deployment is done.
Go to http://.../ to check your Magento 2 instance.

Tests

$ cd work/vendor
$ php ./bin/phpunit -c flancer32/sample_mage2_module/test/unit/phpunit.dist.xml
$ php ./bin/phpunit -c flancer32/sample_mage2_module/test/functional/phpunit.dist.xml

Travis CI

Last log.

Notes

Install Composer

This is allowed for PHP 5.6:

$ sudo apt-get install composer

Use this method for PHP 7:

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Required PHP exts

You can see error message like this

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for magento/product-community-edition 2.0.2 -> satisfiable by magento/product-community-edition[2.0.2].
    - magento/product-community-edition 2.0.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.

in case of not all required PHP extensions are installed.

Install PHP extensions on Ubuntu:

$ sudo apt-get install php7.0-bcmath php7.0-curl php7.0-gd php7.0-intl php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-xml libapache2-mod-php7.0 php7.0-zip php7.0-json php7.0-opcache

Apache2

$ sudo apt-get install libapache2-mod-php7.0
$ sudo a2enmod rewrite
$ sudo service apache2 restart

Sample of the virtual host config:

<VirtualHost *:80>
        ServerName mage2.localhost
        ServerAdmin webmaster@localhost
        DocumentRoot /.../sample_mage2_module/work
        <Directory "/.../sample_mage2_module/work/">
                AllowOverride All
                Require all granted
        </Directory>
        LogLevel info
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Don't forget about AllowOverride All, otherwise rewrite rules in .htaccess files will not be allowed and public resources will not be generated in the /pub/static/[frontend|adminhtml] folders.

Links

flancer32/sample_mage2_module 适用场景与选型建议

flancer32/sample_mage2_module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 76 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 02 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 flancer32/sample_mage2_module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 flancer32/sample_mage2_module 我们能提供哪些服务?
定制开发 / 二次开发

基于 flancer32/sample_mage2_module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 76
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-16