<?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: Morteza Poussaneh</title>
    <description>The latest articles on DEV Community by Morteza Poussaneh (@mortezapoussaneh).</description>
    <link>https://dev.to/mortezapoussaneh</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%2F1022220%2F60f575cb-b8ef-4b10-a5af-e4f1730a9397.jpeg</url>
      <title>DEV Community: Morteza Poussaneh</title>
      <link>https://dev.to/mortezapoussaneh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mortezapoussaneh"/>
    <language>en</language>
    <item>
      <title>PHPKG: The Package Manager Supporting OOP and Functional Development</title>
      <dc:creator>Morteza Poussaneh</dc:creator>
      <pubDate>Sat, 18 Feb 2023 09:33:19 +0000</pubDate>
      <link>https://dev.to/mortezapoussaneh/phpkg-the-package-manager-supporting-oop-and-functional-development-1b1e</link>
      <guid>https://dev.to/mortezapoussaneh/phpkg-the-package-manager-supporting-oop-and-functional-development-1b1e</guid>
      <description>&lt;p&gt;&lt;strong&gt;PHPKG&lt;/strong&gt; is a new package manager designed for PHP developers who want to combine both object-oriented programming (OOP) and functional programming styles in their projects. It provides a flexible and customizable build process that allows developers to define how their namespaces are mapped to their code directories, making it easy to add new classes and functions to their projects.&lt;/p&gt;

&lt;p&gt;One of the key advantages of PHPKG is its support for both OOP and functional development styles. While OOP provides a powerful and flexible way to organize and structure code, functional programming is often a more efficient way to perform certain tasks. PHPKG's build process supports both styles, allowing developers to use either or both as they see fit.&lt;/p&gt;

&lt;p&gt;The build process is another area where PHPKG stands out from other package managers. When a project is built with PHPKG, it reads the source code and uses the defined map to transpile an executable code that contains the required "require" statements for namespaced functions and required registration for defining classes. The transpiling process is fully customizable, and developers can define how they want their namespaces to be mapped to their code directories in the phpkg.config.json file.&lt;/p&gt;

&lt;p&gt;For example, if a developer has a map defined as "Application": "src", this means that for any namespace starting with "Application", PHPKG will search in the "src" directory. If a file with a namespace of "Application\Controllers\HomeController" is located in "src/Controllers/HomeController.php", PHPKG will add a path to the entry points of the project, which also must be defined by the developer in the config file. PHPKG will then use PHP's &lt;em&gt;spl_autoload_register&lt;/em&gt; function to register the class at the defined path, making it available for use in the project.&lt;/p&gt;

&lt;p&gt;For namespaced functions, developers can add a &lt;em&gt;require_once&lt;/em&gt; statement to the client files that use them. PHPKG will automatically add the statement when building the project if the function is used in any code. The build process is highly flexible, and developers can define multiple mappings in their &lt;em&gt;phpkg.config.json&lt;/em&gt; file to structure their project as they see fit.&lt;/p&gt;

&lt;p&gt;PHPKG's build process is not just flexible, it also has several advantages. One of the most significant benefits is that it makes it easy to add new classes and functions to a project without worrying about dependencies. PHPKG's transpiling process reads the source code and adds the necessary &lt;em&gt;require_once&lt;/em&gt; statements automatically. This makes it easier to write maintainable and scalable code, as it reduces the risk of dependency errors.&lt;/p&gt;

&lt;p&gt;Another advantage of PHPKG's build process is that it's fast and efficient. By using &lt;em&gt;spl_autoload_register&lt;/em&gt; to register classes and &lt;em&gt;require_once&lt;/em&gt; statements for functions, PHPKG reduces the need for expensive file I/O operations. This makes PHPKG ideal for large-scale projects that require fast build times and efficient code execution.&lt;/p&gt;

&lt;p&gt;PHPKG also provides a variety of other features, such as the &lt;strong&gt;run&lt;/strong&gt; command, which allows developers to quickly download a repository into their OS's temp directory, install the required dependencies, and build and execute the first entry point defined in the project's config file. The run command makes it easy to test and debug projects, without having to worry about setting up a local environment.&lt;/p&gt;

&lt;p&gt;In summary, PHPKG is an innovative package manager that provides support for both OOP and functional development styles. Its customizable and flexible build process makes it easy to structure large-scale projects and add new classes and functions without worrying about dependencies. With its fast and efficient build process, PHPKG is a great choice for PHP developers who want to build maintainable, scalable, and efficient code.&lt;br&gt;
For more information please read &lt;a href="https://phpkg.com/documentations/getting-started" rel="noopener noreferrer"&gt;its documentations&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>fintech</category>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>PHPKG Package Manager in PHP</title>
      <dc:creator>Morteza Poussaneh</dc:creator>
      <pubDate>Tue, 07 Feb 2023 08:25:57 +0000</pubDate>
      <link>https://dev.to/mortezapoussaneh/package-managers-in-php-3kno</link>
      <guid>https://dev.to/mortezapoussaneh/package-managers-in-php-3kno</guid>
      <description>&lt;p&gt;Composer is a popular tool for managing dependencies in PHP projects. It is often referred to as a package manager, but its capabilities extend beyond just managing packages.&lt;/p&gt;

&lt;p&gt;Composer allows you to easily include external libraries in your projects and manage their updates. Once you have added a library to your project using Composer, it will automatically load the classes from that library using its autoloader. This means that you don't have to manually include the required files for used classes every time you want to use them in your code.&lt;/p&gt;

&lt;p&gt;However, Composer is limited in that it only supports autoloading classes. It does not support functional programming in PHP, which is a significant limitation for many developers. Additionally, while you can write functions within namespaces, you cannot use functions in the same way you would with pure PHP.&lt;/p&gt;

&lt;p&gt;This is where &lt;a href="https://phpkg.com" rel="noopener noreferrer"&gt;phpkg&lt;/a&gt; comes in. Unlike Composer, phpkg is not just a simple autoloader, but a full-fledged package manager for PHP. With phpkg, you have the ability to manage your dependencies, add new packages, update packages to newer versions, and remove packages from your project.&lt;/p&gt;

&lt;p&gt;The most exciting feature of phpkg is its ability to support a wide range of programming styles in PHP. You can write your code using classes and functions, and phpkg will automatically transpile your code into production-ready code by adding the required "&lt;em&gt;include&lt;/em&gt;" statements. This means that you are not limited to writing code using classes, and can instead use a mix of classes and functions as needed.&lt;/p&gt;

&lt;p&gt;Additionally, phpkg allows you to use PHP in ways you may never have thought possible before. You can write a PHP script that performs a specific task for you, such as processing data or generating reports, and then easily run it from anywhere at any time. All you need to do is push your code to a Git repository, and then run &lt;code&gt;phpkg run your-repository-url&lt;/code&gt;. phpkg will download the repository, install it, and then run your code. This opens up a whole new world of possibilities for PHP developers.&lt;/p&gt;

&lt;p&gt;In conclusion, while Composer is a useful tool for managing dependencies and autoloading classes, phpkg takes this a step further by offering a full-fledged package manager that supports a wide range of programming styles and use cases. Whether you're a seasoned PHP developer or just starting out, phpkg is worth considering as a tool to enhance your PHP development workflow.&lt;/p&gt;

</description>
      <category>devto</category>
      <category>offers</category>
      <category>announcement</category>
    </item>
  </channel>
</rss>
