Notice (8): file_put_contents(): Write of 270 bytes failed with errno=28 No space left on device [CORE/src/Log/Engine/FileLog.php, line 140]

Notice: file_put_contents() [function.file-put-contents]: Write of 1108 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4079 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2756 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Undefined array key "nsort" [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2072 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2096 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Undefined array key "nsort" [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2072 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2096 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4067 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2486 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
php自定义apk安装包实例 - 站长搜索
首页 > 资讯列表 > 编程/数据库 >>

php自定义apk安装包实例

Warning (2): Undefined array key "nsort" [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]
Notice: file_put_contents() [function.file-put-contents]: Write of 2420 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2444 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
">
Warning (2): Undefined array key "nsort" [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2420 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2444 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
2014-12-09 07:45:04 转载来源: 网络整理/侵权必删

本文为大家讲解了php如何自定义apk安装包的方法,主要通过ZipArchive类来实现这一功能,需要的朋友可以参考下 众所周知,apk格式安装文件是android智能系统的安装文件,下面我们来看一个利用php实现自定义apk安装包实例。 一、需求: 需要实现对产品进行一次推荐好友安装的活动,每个会员下载自己的专属安装包(里面记录会员的相关信息)

本文为大家讲解了php如何自定义apk安装包的方法,主要通过ZipArchive类来实现这一功能,需要的朋友可以参考下

众所周知,apk格式安装文件是android智能系统的安装文件,下面我们来看一个利用php实现自定义apk安装包实例

一、需求:

需要实现对产品进行一次推荐好友安装的活动,每个会员下载自己的专属安装包(里面记录会员的相关信息)。

二、思路:

经过了解,发现apk安装包原来只是zip的一个马甲,使用php的ZipArchive类可以对文件进行操作。

三、实现代码:

// 源文件
$apk    = "gb.apk";
// 生成临时文件
$file   = tempnam("tmp", "zip");
// 复制文件
if(false===file_put_contents($file, file_get_contents($apk))){
    exit('copy faild!');
}
// 打开临时文件
$zip    = new ZipArchive();
$zip->open($file);
// 添加文件
// 由于apk限定只能修改此目录内的文件,否则会报无效apk包
$zip->addFromString('META-INF/extends.json', json_encode(array('author'=>'deeka')));
// 关闭zip
$zip->close();
// 下载文件
header("Content-Type: application/zip");
header("Content-Length: " . filesize($file));
header("Content-Disposition: attachment; filename=\"{$apk}\"");
// 输出二进制流
readfile($file);
// 删除临时文件
unlink($file);

 


标签: php 自定义 apk 安装 包实例 实例


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2025 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持