简体   繁体   English

安装Restler问题

[英]Install Restler problems

Hi everyone i just have tried to understand how to install Restler to create a PHP web service but i can't did it. 大家好,我只是想了解如何安装Restler创建PHP Web服务,但我做不到。 I don't understand the manual( https://github.com/Luracast/Restler ), i just have install the composer and now i don't know what i having to do. 我不理解手册( https://github.com/Luracast/Restler ),我只是安装了作曲家,现在我不知道该做什么。 I think i have to run in command some thing but i don't know and where i have to put the files that i have downloaded? 我认为我必须在命令中运行某些内容,但我不知道该将我下载的文件放在哪里? In project folder or xampp folder? 在项目文件夹还是xampp文件夹中? If anyone can help me i will appreciate. 如果有人可以帮助我,我将不胜感激。

Best regards. 最好的祝福。

Install Composer Globally 全局安装Composer

  1. install composer.phar into the PHP folder (where php.exe lives) 将composer.phar安装到PHP文件夹(php.exe所在的位置)
  2. set the PHP folder on Environment path 在环境路径上设置PHP文件夹
  3. execute on the windows command line: php composer.phar 在Windows命令行上执行: php composer.phar
    • composer should show up and now you know its available 作曲家应该会出现,现在您知道它可用了
    • what you now have is a " composer global installation on windows" 您现在拥有的是“在Windows上进行Composer全局安装

Setup application and define it's dependencies (manually) 设置应用程序并定义其依赖项(手动)

  1. create application folder, for your upcoming application which uses restler 为您即将使用Restler的应用程序创建应用程序文件夹
  2. add a composer.json file, this file describes all the packages your application uses 添加一个composer.json文件,该文件描述您的应用程序使用的所有软件包
    • one of these packages is RESTLER, add it in the require setion 这些软件包之一是RESTLER,将其添加到require组中
  3. now execute php composer.phar install to install these dependencies 现在执行php composer.phar install来安装这些依赖项
  4. then inspect the folder /vendor to find restler 然后检查文件夹/vendor以找到restler
  5. to use it in your application, simply require the composer autoloader 要在您的应用程序中使用它,只需要composer autoloader
    • require APP_DIR . '/vendor/autoload.php';

Basic composer.json 基本的composer.json

{ "name":"developer/application", "require": { "luracast/restler": "*" } }

This is the easiest way to install it: 这是安装它的最简单方法:

php.exe composer.phar create-project luacrest/restler targetFolder
  1. Install composer 安装作曲家
  2. Move composer.phar to (xampp path)htdocs 将composer.phar移至(xampp路径)htdocs
  3. You can follow tutorial to install restler 您可以按照教程安装Restler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM