Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 0 additions & 173 deletions .github/workflows/branch-validations.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/release-drafter.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/validate-branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Validate branch

on:
push:
tags-ignore:
- '**'
branches:
- master
pull_request:
types:
- synchronize
- opened

jobs:
validate:
uses: croct-tech/shared-public-configs/.github/workflows/php-validations.yml@master
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Croct.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
104 changes: 44 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,71 @@
<p align="center">
<a href="https://croct.com">
<img src="https://cdn.croct.io/brand/logo/repo-icon-green.svg" alt="Croct" height="80"/>
</a>
<br />
<strong>PHP Project Title</strong>
<br />
A brief description about the project.
<a href="https://croct.com" target="_blank">
<picture>
<source media="(min-width: 769px) and (prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/croct-tech/plug-php/master/.github/assets/header-light.svg">
<source media="(min-width: 769px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/croct-tech/plug-php/master/.github/assets/header-dark.svg">
<source media="(max-width: 768px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/croct-tech/plug-php/master/.github/assets/header-dark-mobile.svg">
<source media="(max-width: 768px) and (prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/croct-tech/plug-php/master/.github/assets/header-light-mobile.svg">
<img src="https://raw.githubusercontent.com/croct-tech/plug-php/master/.github/assets/header-light-mobile.svg" alt="Croct Drupal Module" title="Croct Drupal Module" width="100%">
</picture>
</a>
<br/>
<strong>Plug Drupal</strong><br/>
Bring dynamic, personalized content natively into your Drupal applications.
</p>
<div align="center">
<strong>📘 <a href="https://docs.croct.com/reference/sdk/drupal/integration">Quick start &rarr;</a></strong>
</div>
<br/>
<p align="center">
<img alt="Language" src="https://img.shields.io/badge/language-PHP-blue" />
<img alt="Build" src="https://img.shields.io/badge/build-passing-green" />
<img alt="License" src="https://img.shields.io/badge/license-proprietary-lightgrey" />
<br />
<br />
<a href="https://github.com/croct-tech/repository-template-php/releases">📦 Releases</a>
·
<a href="https://github.com/croct-tech/repository-template-php/issues">🐞 Report Bug</a>
·
<a href="https://github.com/croct-tech/repository-template-php/issues">✨ Request Feature</a>
<a href="https://packagist.org/packages/croct/plug-drupal"><img alt="Version" src="https://img.shields.io/packagist/v/croct/plug-drupal"/></a>
<a href="https://github.com/croct-tech/plug-drupal/actions/workflows/validate-branch.yaml"><img alt="Build" src="https://github.com/croct-tech/plug-drupal/actions/workflows/validate-branch.yaml/badge.svg"/></a>
</p>

# Instructions
## Introduction

Follow the steps below to create a new repository:
Croct is a headless CMS that helps you manage content, run AB tests, and personalize experiences without the hassle of complex integrations.

1. Customize the repository
1. Click on the _Use this template_ button at the top of this page
2. Clone the repository locally
3. Update the `README.md` and `composer.json` with the new package information
2. Setup Code Climate
1. Add the project to [Croct's code climate organization](https://codeclimate.com/accounts/5e714648faaa9c00fb000081/dashboard)
2. Go to **Repo Settings > Badges** and copy the maintainability and coverage badges to the `README.md`
3. Go to **Repo Settings > Test coverage** and copy the "_TEST REPORTER ID_"
4. On the Github repository page, go to **Settings > Secrets** and add a secret with name `CODECLIMATE_TESTREPORTER_ID` and the ID from the previous step as value
3. Setup Repman
1. If you are a Repman admin, you need to generate a token for each member. Go to [**Organizations > Croct > Tokens > New Token**](https://app.repman.io/organization/croct/token/new) and click on Generate New Token button.
2. If you are a member, you need to configure global authentication to access this organization's packages. With the token in hand, you can authorize Composer with the following command (replace `TOKEN_VALUE` with the actual token):

```sh
composer config --global --auth http-basic.croct.repo.repman.io token TOKEN_VALUE
```
This module provides seamless integration between Croct and Drupal, automatically bootstrapping the client-side SDK, syncing the identity from the current user, and resolving the locale from Drupal's language negotiation so you can deliver personalized content with no glue code.

## Installation

We recommend using the package manager [Composer](https://getcomposer.org) to install the package:
Run this command to install the module:

```sh
composer require croct/project-php
composer require croct/plug-drupal
```

## Basic usage

```php
use Croct\Project\Example;
Then enable the module with Drush:

$example = new Example();
$example->displayBasicUsage();
```sh
drush en croct
```

## Contributing
Finally, set your credentials in `settings.php`:

Contributions to the package are always welcome!
```php
$settings['croct.app_id'] = '<APP_ID>';
$settings['croct.api_key'] = '<API_KEY>';
```

- Report any bugs or issues on the [issue tracker](https://github.com/croct-tech/project-php/issues).
- For major changes, please [open an issue](https://github.com/croct-tech/project-php/issues) first to discuss what you would like to change.
- Please make sure to update tests as appropriate.
See our [quick start guide](https://docs.croct.com/reference/sdk/drupal/integration) for more details.

## Testing
## Documentation

Before running the test suites, the development dependencies must be installed:
Visit our [official documentation](https://docs.croct.com/reference/sdk/drupal/integration).

```sh
composer install
```
## Support

Then, to run all tests:
Join our official [Slack channel](https://croct.link/community) to get help from the Croct team and other developers.

```sh
composer test
```
## Contribution

Contributions are always welcome!

## Copyright Notice
- Report any bugs or issues on the [issue tracker](https://github.com/croct-tech/plug-drupal/issues).
- For major changes, please [open an issue](https://github.com/croct-tech/plug-drupal/issues) first to discuss what you would like to change.
- Please make sure to update tests as appropriate. Run tests with `composer test`.

Copyright © 2015-2020 Croct Limited, All Rights Reserved.
## License

All information contained herein is, and remains the property of Croct Limited. The intellectual, design and technical concepts contained herein are proprietary to Croct Limited s and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden unless prior written permission is obtained from Croct Limited.
This library is licensed under the [MIT license](LICENSE).
Loading
Loading