Skip to content

Organize and rename PHP example directories #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 76 commits into
base: main
Choose a base branch
from

Conversation

mesilov
Copy link
Collaborator

@mesilov mesilov commented Jan 18, 2025

Reorganized PHP simple examples by moving them from php/quick-start/simple/ to a cleaner php/simple/ structure. Updated README.md to include the new structure and added descriptions for the examples. This change improves clarity and maintainability of the directory layout.

Reorganized PHP simple examples by moving them from `php/quick-start/simple/` to a cleaner `php/simple/` structure. Updated `README.md` to include the new structure and added descriptions for the examples. This change improves clarity and maintainability of the directory layout.
@mesilov mesilov self-assigned this Jan 18, 2025
@mesilov mesilov linked an issue Jan 18, 2025 that may be closed by this pull request
Introduce a new project skeleton for a Bitrix24 PHP SDK local app. Includes a `docker-compose.yaml` file, a `Dockerfile` for PHP CLI, a `composer.json` with required dependencies, Makefile scripts for setup and development tasks, and licensing information. Streamlines local app development using Docker and Composer.
Introduce a local application skeleton for CLI-based Bitrix24 apps. Features include a Dockerized setup, Symfony Console integration, Tailwind for assets, and logging via Monolog. Added Makefile commands for streamlined operations and PHPStan for static analysis.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
@mesilov mesilov marked this pull request as draft February 12, 2025 20:43
Introduce `Bitrix24ServiceBuilderFactory` for handling service builder creation using request data or stored tokens. Add supporting factories (`EventDispatcherFactory`, `AuthRepositoryFactory`) and listeners to manage authentication events and token storage. These additions enhance modularity and ease of service initialization.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Renamed factory methods to `create` for better consistency across the codebase. Added `InstallController` to handle application installation and event processing for Bitrix24 integration, improving modularity and functionality of the application.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Replaced the `getLog()` method with `create()` for registering `TestCommand` in the console application. This improves clarity and aligns the usage with updated logger factory conventions.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This update transforms the application skeleton into a complete example with a user interface, token storage, and additional features like Tailwind CSS integration, new templates (header and footer), and installation scripts. It introduces enhanced functionality with Bitrix24 integration, updated documentation, and configuration changes to support both CLI and web-based interactions.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated `install.php` to use a dedicated `InstallController` for cleaner and more structured request handling. Added better error management with meaningful logs and responses. Enhanced the documentation and adjusted related files for improved clarity and consistency.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Renamed the method `createFromRequest` to `createFromPlacementRequest` for better clarity and intent. Additionally, adjusted comments for consistency and readability while loading the application profile.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Reordered application installation steps for clarity and maintainability, ensuring admin auth tokens are saved earlier. Enhanced logging for event handler registration and replaced inline HTML with a cleaner conditional structure in `install.php`. Updated `.gitignore` to reflect new config file naming convention and expanded README with additional details about the installation process.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduced Bitrix24 event handler logic via a new controller and updated the factory to support incoming events. Expanded the Makefile with clearer structure and additional commands for streamlined development processes.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Change "download containers" to "download images" for clarity and accuracy in the docker-pull command description. This ensures the terminology aligns with Docker's standard usage.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated the directory traversal logic to properly resolve the path to 'auth.json.local'. This ensures the file path is correctly calculated from two levels up, preventing potential issues with file accessibility.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This commit introduces the PlacementController to handle Bitrix24 placement requests, along with corresponding changes to LoggerFactory and Bitrix24ServiceBuilderFactory to support configurable logger names. Additionally, the main entry point (`index.php`) has been added to handle incoming requests and facilitate controller processing.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Convert multiple classes to readonly for immutability and improve safety. Integrate Bitrix24 API to fetch and display user profile details in TestCommand. Update console setup to include Bitrix24ServiceBuilder for API interactions."

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This commit introduces the foundation for the "01-empty-template" example, including a simple PHP script, Docker configuration, Makefile, and environment variables. It removes unnecessary files and components, streamlining the setup for a minimal example.

Signed-off-by: mesilov <mesilov@mesilov-mbp.local>
Reorganized the project structure to include Docker support with a `php-cli` container for running examples. Added a `README.md` detailing the folder structure, architecture, and usage instructions. Updated necessary configuration files such as `.env`, `Makefile`, and `docker-compose.yaml` for the new setup.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduced a structured setup with Docker, Makefile, and environment configuration for running a PHP example to call Bitrix24 REST API using cURL. This includes a Dockerfile, docker-compose configuration, and updated README instructions for setup and usage. Added `.env` support for managing webhook URLs securely.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Deleted the `.gitignore` and `README.md` files as they are no longer required. This cleanup streamlines the repository by removing redundant content.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduce a new example showcasing how to work with the Bitrix24 PHP SDK using incoming webhooks. Includes a Dockerized PHP CLI container, updated dependencies, example code, and documentation for better development and reproducibility.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Renamed the folder and files for clarity and updated the README with instructions on using the webhook cURL call example. Introduced a `.env.local` file for local overrides and adjusted related configurations to support the changes.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
The directory name was updated from "02-webhook-curl-call-without-sdk" to "02-webhook-curl" for better readability and brevity. All associated files were adjusted to reflect the new path structure. This change improves clarity and consistency across the project.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduced a complete example demonstrating how to use Bitrix24 PHP SDK to interact with REST APIs via an incoming webhook. Includes source code, Docker setup, Makefile commands, and detailed instructions in the README for environment configuration and usage.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Deleted files related to the Bitrix24 PHP SDK webhook example, including Docker configuration, source code, environment file, dependency configuration, and ignored files. This cleanup removes outdated or unnecessary codebase components.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated "help" section formatting in Makefiles for better clarity. Added `composer.lock` to lock dependencies for the new webhook SDK example, ensuring consistent builds and dependency management.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduce logging with Monolog for better application insights and add Docker setup for streamlined development. Updated documentation, Makefile, and dependencies to enhance usability and clarify usage steps.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
mesilov added 30 commits May 27, 2025 00:56
Added instructions in README for running examples with Docker Compose and included key documentation references. Fixed a typo in Makefile comments for better clarity.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
The composer.lock file has been deleted to prevent locking dependency versions in the repository. This change allows external users and environments to resolve dependencies dynamically when installing the project.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This locks the PHP project dependencies to specific versions, ensuring consistent builds across environments. The `composer.lock` file includes libraries like `monolog`, `nesbot/carbon`, and `bitrix24/b24phpsdk` with their respective versions and metadata.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Added environment variables for log level and max file count, integrated structured logging, and improved error handling in the application. Updated README and `.env` with relevant documentation, along with refinements to logging for better maintainability.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
The README file now mentions `example.php` under the `src` directory, clarifying its purpose as an example application. This enhances the documentation's usefulness for developers exploring the project structure.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Replaced detailed string formatting with concise log message keys (`app.configuration.problem` and `app.failure`) for better consistency and easier log filtering. Retained exception details in the context to preserve debugging information.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Enhances the logger configuration comments by specifying available handlers and processors, including RotatingFileHandler and MemoryUsageProcessor. This improves clarity for developers integrating Monolog into their applications.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Deleted the entire directory for the "05-local-application-with-ui" example, including its PHP, CSS, and JavaScript assets, configuration files (composer.json, package.json), documentation, and related resources. This cleanup reduces redundancy or prepares the codebase for new changes.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated the example script to include a comment mentioning the default formatter

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Added references to tail, grep, and lnav tools in the README for better debugging guidance. Adjusted logger method in example.php to fix inconsistent formatting.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Upgraded various dependencies in the `composer.lock` file to their latest development versions, including Symfony, PSR, and third-party libraries. This ensures compatibility with the most recent changes and prepares the project for upcoming enhancements and fixes.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Commented out `Apache-2.0` license, introduced a function demonstrating PHPStan checks, and included a faulty type example in the code. Updated README to list new tools for license checking, code analysis, and static code fixing.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
The Apache-2.0 license was uncommented to include it in the list of allowed licenses. This ensures compatibility with dependencies or packages using this license.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This target helps identify unused, shadow, and misplaced composer dependencies, improving dependency management. It provides a useful tool for cleaning and optimizing the project's composer setup.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Commented out unused function `testPhpStan` and adjusted example code to clarify usage. Made minor formatting adjustments in the `.allowed-licenses.php` file for improved readability.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…t handling

Introduced a new example for working with local application robots in Bitrix24. This example includes robots for weather and discount handling, logger initialization, event listening (auth token renewal), and an InstallController for managing app installation workflows. Added Dockerfile for PHP CLI setup and other supporting files.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Introduced the `RobotHandlerMetadata` class for defining robot metadata. Enhanced the Weather robot example by refining robot responses, adding result metadata via the `Result` class, and improving handling methods with additional parameters and default values for flexibility.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…ndlers

Integrated Symfony DI and services.yaml for dependency injection configuration. Added implementations for handling robots, including `Discount` handler and demo `crm-robot-handler` entry points. Upgraded composer dependencies to latest versions for improved compatibility.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated services.yaml to configure LoggerFactory with a factory method and set public visibility for new service classes. Adjusted DI implementation to add exception handling. Replaced direct logger initialization with DI in crm-robot-handler.php for consistency and cleaner dependency management.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…ging

Introduced a new example demonstrating webhook integration with Symfony DI and PSR-3 compatible logging. Added services configuration, example classes (Alpha, Beta, Gamma), and an example.php script showcasing DI usage and logging. Enhanced project structure with Docker support, linters, and updated Makefile for streamlined development.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Added new dependencies required for the "06-webhook-sdk-di" example, focusing on Bitrix24 REST API integration, dependency injection, and PSR-based logging. Ensures compatibility with the latest package versions.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
… example

Improved object initialization in `example.php`, ensuring cleaner usage of dependency injection. Enhanced README structure with additional sections, links, and commands for better clarity and guidance.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Updated `README.md` and `Makefile` to reflect the inclusion of a dependency injection (DI) container. Improved folder structure descriptions and included new references to DI-related configurations and services.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…s and DI improvements

Introduced enhancements to the local application robots example, including new `Discount` robot, integration with DI for `EventDispatcher`, and improved robot metadata handling. Added `InstallController` and `Bitrix24EventController` for streamlined installation and event management workflows. Expanded configurations with updates to `services.yaml`, Docker setup, and logging.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…dlers and DI configuration

Introduced a new example for local applications showcasing Weather activity handling with improved dependency injection. Added Docker support, handler interfaces, metadata classes, and Symfony service definitions. Updated README and included supporting files such as `.env`, `.php-cs-fixer.php`, and `.gitignore`.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Deleted the example showcasing local application robots, including custom handlers and event handling, to streamline project structure. Removed related PHP CLI setup, logger initialization, and supporting files.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…nd Monolog integration

Introduced a new example showcasing webhook integration with Sentry logging and Symfony Dependency Injection. Added Docker configuration, Makefile commands, centralized LoggerFactory with rotating file handler setup, and `.env` configuration for enhanced flexibility. Updated composer dependencies to support new features.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…and Bitrix24 integration

Introduced a comprehensive example demonstrating local application workflows with Bitrix24 SDK integration. Added CLI command (`TestCommand`), controller classes for handling events, placements, and installations, as well as centralized logging with `LoggerFactory`. Configured dependency injection through `services.yaml` and implemented a repository factory for auth handling. Included Docker support, bootstrap setup, and enhanced code structure for flexibility and modularity.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Enhanced the example with Sentry support, showcasing advanced logging and error monitoring. Configured Sentry DSN, release, and environment in `.env`, added Sentry handlers in `LoggerFactory`, and demonstrated usage in `example.php`. Introduced new service classes (`Alpha`, `Beta`, `Gamma`) to illustrate structured error handling and trace collection. Updated documentation and dependencies accordingly.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…ture and added Sentry link

Enhanced documentation with additional sections, formatting fixes, and a link to Sentry resources. Improved readability and guidance for setup and usage.

Signed-off-by: mesilov <mesilov.maxim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

05 — local application skeleton - mono repository
1 participant