jordanandree/resumator-api

Jazz (Resumator) API PHP 包装器

0.4.0 2015-11-10 00:07 UTC

This package is not auto-updated.

Last update: 2024-09-24 03:23:25 UTC


README

Build Status

PHP API 包装器,用于Jazz API

用法

查看示例以了解示例工作列表实现。

最小示例

require "jazz-api/lib/jazz.php";

// setup with your API Key
$jazz = new Jazz("YOUR_API_KEY");

// return all Jobs
$jobs = $jazz->getJobs();

// return all Jobs without caching
$jobs = $resumator->getJobs();

// get a single Job
$job = $jazz->getJob($jobs[0]->id);

// create a job
$job_fields = array(
  "title"          => "New Job",
  "hiring_lead_id" => "YOUR_ID",
  "description"    => "Join us!",
  "job_status"     => 2 // draft status
);
$new_job = $jazz->postJob($job_fields);

缓存

在发出任何API调用之前,可以配置和切换缓存机制的开或关。按照设计,缓存仅适用于GET API调用。

示例

require "jazz-api/lib/jazz.php";

// setup with your API Key
$jazz = new Jazz("YOUR_API_KEY");

// set the default caching cache file expiration time (in seconds)
$jazz->cache['EXPIRES'] = 604800; // 1 week

// set the cache file save path
$jazz->cache['PATH'] = __DIR__ . DIRECTORY_SEPARATOR . "cache" . DIRECTORY_SEPARATOR;

// disable caching
$jazz->cache['ENABLED'] = false;

// enable caching
$jazz->cache['ENABLED'] = true;

Composer

  • jordanandree/jazz-api: @stable添加到composer.json的require部分。
  • 运行composer install
  • 示例将看起来像这样
if (($loader = require_once __DIR__ . '/vendor/autoload.php') == null)  {
  die('Vendor directory not found, Please run composer install.');
}

$jazz = new Jazz("YOUR_API_KEY");

测试

测试仍在进行中,覆盖率可以更好。

您可以像这样运行测试

phpunit tests/tests.php

贡献

  1. 将其分叉( http://github.com/jordanandree/jazz-api-php/fork
  2. 创建您的功能分支(git checkout -b my-new-feature
  3. 提交您的更改(git commit -am 'Add some feature'
  4. 推送到分支(git push origin my-new-feature
  5. 创建新的Pull Request