<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yaroslav</title>
    <description>The latest articles on DEV Community by Yaroslav (@yaroslavche).</description>
    <link>https://dev.to/yaroslavche</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F749963%2Fcafa4c16-0356-4dc3-b0aa-381816884826.jpeg</url>
      <title>DEV Community: Yaroslav</title>
      <link>https://dev.to/yaroslavche</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yaroslavche"/>
    <language>en</language>
    <item>
      <title>PHP Extension written with C++. Build and check with GitHub Actions.</title>
      <dc:creator>Yaroslav</dc:creator>
      <pubDate>Wed, 10 Nov 2021 20:27:45 +0000</pubDate>
      <link>https://dev.to/yaroslavche/php-extension-written-with-c-build-and-check-with-github-actions-4hda</link>
      <guid>https://dev.to/yaroslavche/php-extension-written-with-c-build-and-check-with-github-actions-4hda</guid>
      <description>&lt;h5&gt;
  
  
  My Workflow
&lt;/h5&gt;

&lt;p&gt;Small description about repository: &lt;a href="https://github.com/yaroslavche/phptdlib"&gt;phptdlib&lt;/a&gt; is a PHP extension for the &lt;a href="https://core.telegram.org/tdlib"&gt;Telegram Database library&lt;/a&gt;, which allows to create Telegram clients. This is a CMake based C++ project with dependencies (&lt;a href="https://github.com/td/tdlib"&gt;tdlib/td&lt;/a&gt;, &lt;a href="https://github.com/CopernicaMarketingSoftware/PHP-CPP"&gt;CopernicaMarketingSoftware/PHP-CPP&lt;/a&gt; and &lt;a href="https://github.com/nlohmann/json"&gt;nlohmann/json&lt;/a&gt;), which produces a PHP extension.&lt;/p&gt;

&lt;p&gt;First of all, need to prepare environment for building CMake project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.config.name }}&lt;/span&gt;
        &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.config.os }}&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# custom ENV variables&lt;/span&gt;
            &lt;span class="na"&gt;CONFIG&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gcc&lt;/span&gt;
            &lt;span class="na"&gt;CC&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gcc&lt;/span&gt;
            &lt;span class="na"&gt;CXX&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;g++&lt;/span&gt;
        &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;fail-fast&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
            &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;
                        &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ubuntu&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Latest&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;GCC&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;(Release)"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                        &lt;span class="nv"&gt;os&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;ubuntu-latest&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                        &lt;span class="nv"&gt;build_type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Release"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                        &lt;span class="nv"&gt;cc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gcc"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                        &lt;span class="nv"&gt;cxx&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;g++"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt;
                        &lt;span class="nv"&gt;generators&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ninja"&lt;/span&gt;
                    &lt;span class="pi"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And in steps right after repo checkout need to add PHP headers and capability for running PHP code. Thanks to &lt;a href="https://github.com/shivammathur/setup-php"&gt;shivammathur/setup-php@v2&lt;/a&gt; it's pretty easy to achieve:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;        &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup PHP 7.4 with PECL extension&lt;/span&gt;
                &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;shivammathur/setup-php@v2&lt;/span&gt;
                &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="na"&gt;php-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;7.4'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After that we're ready to install development tools and check their versions:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install main dependencies (Ubuntu)&lt;/span&gt;
                &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;startsWith(matrix.config.name, 'Ubuntu Latest GCC')&lt;/span&gt;
                &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                    &lt;span class="s"&gt;sudo apt-get update&lt;/span&gt;
                    &lt;span class="s"&gt;sudo apt-get install ninja-build cmake gperf build-essential zlib1g-dev&lt;/span&gt;
                    &lt;span class="s"&gt;ninja --version&lt;/span&gt;
                    &lt;span class="s"&gt;cmake --version&lt;/span&gt;
                    &lt;span class="s"&gt;gcc --version&lt;/span&gt;
                    &lt;span class="s"&gt;php --version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here you can note that we're able to extend the matrix and configure for each environment its own workflow.&lt;/p&gt;

&lt;p&gt;In the build process there is one huge disadvantage - it takes a lot of resources and plenty of time. It's bad to occupy resources, when they aren't needed. That's why it's worth it to cache compiled object files.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Cache extension dependencies&lt;/span&gt;
                &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cahce-ext-deps&lt;/span&gt;
                &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/cache@v2&lt;/span&gt;
                &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;~/cached_builds&lt;/span&gt;
                    &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ runner.os }}-ext-deps&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;But, honestly, I think this config isn't really correctly configured for my case. The idea was in caching compiled object files and later just use that directory and linker would use that object files (in the install script from the next step). But looks like it doesn't work as I've expected and the compiler compiles object files even when no changes are made in dependencies. I'll be very appreciated for an advice.&lt;/p&gt;

&lt;p&gt;I've created an &lt;a href="https://github.com/yaroslavche/phptdlib/blob/master/scripts/install.sh"&gt;install script&lt;/a&gt; for updating dependencies for shared lib builds. It takes the build path as the first argument, pulls the latest code from &lt;code&gt;tdlib/td&lt;/code&gt;, &lt;code&gt;CopernicaMarketingSoftware/PHP-CPP&lt;/code&gt; and &lt;code&gt;nlohmann/json&lt;/code&gt; repositories and builds separately as shared libraries.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install extension dependencies&lt;/span&gt;
                &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
                &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                    &lt;span class="s"&gt;./scripts/install.sh ~/cached_builds&lt;/span&gt;
                    &lt;span class="s"&gt;cd ~/cached_builds&lt;/span&gt;
                    &lt;span class="s"&gt;sudo ldconfig&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This process takes around 10 minutes.&lt;/p&gt;

&lt;p&gt;When dependencies are built and installed, we're ready to install extension itself:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and install&lt;/span&gt;
                &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
                &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                    &lt;span class="s"&gt;mkdir build&lt;/span&gt;
                    &lt;span class="s"&gt;cd build&lt;/span&gt;
                    &lt;span class="s"&gt;cmake -D USE_SHARED_TD:BOOL=ON -D USE_SHARED_JSON:BOOL=ON -D USE_SHARED_PHPCPP:BOOL=ON ..&lt;/span&gt;
                    &lt;span class="s"&gt;make&lt;/span&gt;
                    &lt;span class="s"&gt;sudo make install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And if all above steps are fine, then we can check if it is installed and works. Need to check installed modules and try to run example scripts.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;            &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Test&lt;/span&gt;
                &lt;span class="na"&gt;shell&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;bash&lt;/span&gt;
                &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
                    &lt;span class="s"&gt;pwd&lt;/span&gt;
                    &lt;span class="s"&gt;php -m | grep tdlib&lt;/span&gt;
                    &lt;span class="s"&gt;php php_examples/func.php&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And need to specify when it is needed to trigger actions. In my case I also want to configure scheduled runs more often (twice in a month) because build fails would notify me that need to update dependencies.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt;   &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;1,15&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Before I used travis, but it accidentally stopped working for me at some point, and I've decided to migrate to GitHub Actions. Right now it's not ideal and uses just one config and one entry in the matrix, but it's doing its job and can be configured better in future.&lt;br&gt;
Thanks for reading =)&lt;/p&gt;
&lt;h5&gt;
  
  
  Submission Category:
&lt;/h5&gt;

&lt;p&gt;Wacky Wildcards&lt;/p&gt;
&lt;h5&gt;
  
  
  Yaml File or Link to Code
&lt;/h5&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/yaroslavche"&gt;
        yaroslavche
      &lt;/a&gt; / &lt;a href="https://github.com/yaroslavche/phptdlib"&gt;
        phptdlib
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      PHP Extension for tdlib/td written with PHP-CPP
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/yaroslavche/phptdlib/actions/workflows/cmake.yml/badge.svg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HTuVbL6O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/yaroslavche/phptdlib/actions/workflows/cmake.yml/badge.svg" alt="Cmake workflow"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The PHP extension &lt;code&gt;tdlib&lt;/code&gt; allows you to work with the &lt;a href="https://core.telegram.org/tdlib" rel="nofollow"&gt;Telegram database library&lt;/a&gt;
If simple, this is the usual &lt;a href="https://github.com/yaroslavche/phptdlibinclude/td_json_client_func.hpp"&gt;functions wrapper&lt;/a&gt; for working with the &lt;code&gt;tdlib/td&lt;/code&gt; json client. You can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create a JSON client &lt;code&gt;$client = td_json_client_create()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;execute the synchronous request &lt;code&gt;$result = td_json_client_execute($client, $json);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;perform an asynchronous request &lt;code&gt;td_json_client_send($client, $json);&lt;/code&gt; *&lt;/li&gt;
&lt;li&gt;get all the responses at the moment &lt;code&gt;$response = td_json_client_receive($client, $timeout);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;and destroy client &lt;code&gt;td_json_client_destroy($client);&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;*&lt;/code&gt; you must use &lt;code&gt;td_json_client_receive&lt;/code&gt; to get a response from an asynchronous request.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://core.telegram.org/tdlib/getting-started" rel="nofollow"&gt;Getting started with TDLib&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html" rel="nofollow"&gt;td_json_client.h File Reference&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=gtQOjSVlvlI" rel="nofollow"&gt;Video tutorial how to install and simple usage&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://yaroslavche.github.io/phptdlib/" rel="nofollow"&gt;phptdlib Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Example&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/tdlib/td/blob/master/example/cpp/tdjson_example.cpp"&gt;https://github.com/tdlib/td/blob/master/example/cpp/tdjson_example.cpp&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight highlight-text-html-php position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-ent"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;client&lt;/span&gt; = &lt;span class="pl-en"&gt;td_json_client_create&lt;/span&gt;()
&lt;span class="pl-en"&gt;td_json_client_execute&lt;/span&gt;(&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;client&lt;/span&gt;, &lt;span class="pl-en"&gt;json_encode&lt;/span&gt;([&lt;span class="pl-s"&gt;'@type'&lt;/span&gt; =&amp;gt; &lt;span class="pl-s"&gt;'setLogVerbosityLevel'&lt;/span&gt;, &lt;span class="pl-s"&gt;'new_verbosity_level'&lt;/span&gt; =&amp;gt; &lt;span class="pl-s"&gt;'0'&lt;/span&gt;]));
&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;waitTimeout&lt;/span&gt; = &lt;span class="pl-c1"&gt;10&lt;/span&gt;;
&lt;span class="pl-k"&gt;while&lt;/span&gt;(&lt;span class="pl-c1"&gt;true&lt;/span&gt;)
{
    &lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;result&lt;/span&gt; = &lt;span class="pl-en"&gt;td_json_client_receive&lt;/span&gt;(&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;client&lt;/span&gt;, &lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;waitTimeout&lt;/span&gt;);
    &lt;span class="pl-k"&gt;if&lt;/span&gt;(!&lt;span class="pl-en"&gt;empty&lt;/span&gt;(&lt;span class="pl-s1"&gt;&lt;span class="pl-c1"&gt;$&lt;/span&gt;result&lt;/span&gt;)) {
        &lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/yaroslavche/phptdlib"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>actionshackathon21</category>
    </item>
  </channel>
</rss>
