Download the PHP package chariothy/laravel4-sae without Composer

On this page you can find all versions of the php package chariothy/laravel4-sae. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel4-sae

laravel4-sae v1.1.0

只需手动增加两行代码即可让Laravel4( < 4.2)运行在SAE,而且在本地和在SAE开发无需命令切换,自动判断环境并切换配置。

安装

在SAE安装Laravel

在SAE安装Laravel与本地环境安装稍有区别:

  1. 在SAE的“应用管理”中新建一个没有代码的应用,比如叫projectname;
  2. 用svn将其同步到本地,你会看到本地多出个目录projectname;
  3. 打开在命令行窗口,定位到projectname,创建一个laravel应用,输入

!注意上面命令中的project-version,这应该是个数字,是你还没用过的SAE应用的版本号,对新应用来说从1开始。下文中指的网站根目录是指projectname/project-version,切记。

SAE的php版本为5.3,因此最高只能支持到Laravel4.1.x。(Laravel4.2用到了php5.4的trait特性)

漫长的等待后安装成功,然后cmd窗口中定位到projectname/project-version,用composer加入laravel4-sae,输入:

它会更新网站根项目下的composer.json,并将laravel4-sae安装到vendor目录下。 最后用svn将整个应用上传到SAE,“应用管理”的“代码管理”下就会多出一个版本号,在“服务管理”的“KVDB”中开启KVDB服务

如何使用

好了,要增加的两行代码来了: 打开网站项目根目录下app/config/app.php,找到'providers'设置,在结尾处添加'Chariothy\SaeServiceProvider':

找到'aliases'设置,在结尾处添加'SAE' => 'Chariothy\SaeFacade':

保存之后,打开cmd窗口,定位到你的网站项目根目录下,输入

好了,正常情况下会输出一堆Successfully:

这就是全部。现在你可以用svn上传到SAE(不要忘记先在SAE中开启KVDB服务!), 打开首页将看到熟悉的“You have arrived.”

如何添加静态链接

在laravel中是用{{HTML::stript('js/code.js')}}、{{HTML::style('css/style.js')}}、{{HTML::image('img/image.png')}}这三句来添加。 但前提是在本地部署,同时将root/public设置为根目录。而在SAE上,一般会将图片等资源放在storage中。 这里laravel4-sae在app/config/sae/app.php下添加了几个设置项:

这样你在代码中只要用{{SAE::script('js/code.js')}}、{{SAE::style('css/style.js')}}、{{SAE::image('img/image.png')}}这三句即可。 同时这三句对本地部署同样适用,无需切换。

SaePatch都做了啥?

以下对输出的结果做解释:

--overwrite选项

默认情况下SaePatch会忽略掉已经打过的补丁,不过你可以用--overwrite来覆盖它,可以全部覆盖,也可以选择覆盖。不用担心,都会先备份的。具体参数:

所有选项

可以看到所有选项

使用示例

见HOW-TO.MD

特别注意

在SAE环境下,如需切换memcached、storage、kvdb,则config.cache.drive和config.session.drive均保持file不变,只需在config.sae.app(在config/sae/app.php中)中改变wrapper属性即可。

事实上,SAE的storage至少目前不支持文件append,而memcache又太贵,所以就用默认的kvdb来保存字符挺好的,storage还是适合放些静态图片等等,memcache等着访问量上去了再换也不迟。

另外,可别忘了在SAE的控制面板中打开kvdb等相应的服务哦~

Have fun!

PS: 为了方便那些composer速度太慢的朋友,我用laravel4-sae打包了一个laravel 4.1.27,直接解压出来就可以上传到SAE运行,这里下载

更新日志

v 1.1.0 提供对静态资源在storage的支持,感谢flyboy

v 1.0.0 初始版本 通过sae命令可以对laravel打上sae补丁


All versions of laravel4-sae with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chariothy/laravel4-sae contains the following files

Loading the files please wait ....