<?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>Forem: emre.red</title>
    <description>The latest articles on Forem by emre.red (@emrered).</description>
    <link>https://forem.com/emrered</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%2F684092%2F766c93ca-9ddf-4378-b043-103415f17458.jpg</url>
      <title>Forem: emre.red</title>
      <link>https://forem.com/emrered</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/emrered"/>
    <language>en</language>
    <item>
      <title>Finding Where A Function Is Defined With PHP!</title>
      <dc:creator>emre.red</dc:creator>
      <pubDate>Thu, 19 Aug 2021 07:23:46 +0000</pubDate>
      <link>https://forem.com/emrered/finding-where-a-function-is-defined-with-php-1929</link>
      <guid>https://forem.com/emrered/finding-where-a-function-is-defined-with-php-1929</guid>
      <description>&lt;h3&gt;
  
  
  There is a function or class in PHP and you want to find out which line of the file it is defined in? I have a solution for you!
&lt;/h3&gt;

&lt;p&gt;This is the biggest problem for us as programmers. There is a function and maybe we waste our days trying to find where it is defined but we can't find it. Sometimes we wrote this function, and sometimes the 'ex-programmer' put it in such places on the work we were working on that he hid that function as if he were hiding it in a golden chest. But don't worry, take a breath, we will find your functions in 5 minutes, line by line. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdifuflnnz9ip0f3im4d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpdifuflnnz9ip0f3im4d.png" alt="Alt Text" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ReflectionFunction
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;my_func&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// For example, we want to find this function. &lt;/span&gt;

&lt;span class="nv"&gt;$refFunc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;\ReflectionFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'my_func'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Here we have defined ReflectionFunction to get its details. &lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="nv"&gt;$refFunc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getFileName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;':'&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$refFunc&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getStartLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// Here, we have printed the file name and the line where our function is located on the screen.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Other things you can do with ReflectionFunction:
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;getDocComment&lt;/code&gt;: Returns in-function comments.&lt;br&gt;
&lt;code&gt;getEndLine&lt;/code&gt; Returns the end line of the function.&lt;br&gt;
&lt;code&gt;getExtensionName&lt;/code&gt; Returns the extension where the function is located.&lt;br&gt;
&lt;code&gt;getFileName&lt;/code&gt; Returns the file containing the function.&lt;br&gt;
&lt;code&gt;getName&lt;/code&gt; returns the function name.&lt;br&gt;
&lt;code&gt;getNamespaceName&lt;/code&gt; Returns the field name of the function.&lt;br&gt;
&lt;code&gt;getNumberOfParameters&lt;/code&gt; Returns the number of variables.&lt;br&gt;
&lt;code&gt;getNumberOfRequiredParameters&lt;/code&gt; Returns the number of required variables for the function.&lt;br&gt;
&lt;code&gt;getParameters&lt;/code&gt; Returns variables.&lt;br&gt;
&lt;code&gt;getReturnType&lt;/code&gt; Returns the result type of the function.&lt;br&gt;
&lt;code&gt;getShortName&lt;/code&gt; Returns the short name of the function.&lt;br&gt;
&lt;code&gt;getStartLine&lt;/code&gt; Returns the start line of the function.&lt;br&gt;
&lt;code&gt;getStaticVariables&lt;/code&gt; Returns constant variables.&lt;br&gt;
&lt;code&gt;hasReturnType&lt;/code&gt; Checks whether the function returns a response. isClosure: Checks if it's an anonymous function.&lt;br&gt;
&lt;code&gt;isDeprecated&lt;/code&gt; Checks if its use is not recommended.&lt;br&gt;
&lt;code&gt;isUserDefined&lt;/code&gt; Checks if the function is a user-defined function.&lt;br&gt;
&lt;code&gt;returnsReference&lt;/code&gt; Checks if the function return value is referenced.&lt;/p&gt;

&lt;p&gt;You can also use these functions as we used above. For example, when we write &lt;code&gt;getEndLine()&lt;/code&gt; where we write &lt;code&gt;getStartLine()&lt;/code&gt; in the code, it will return us the end line of the function. &lt;/p&gt;

</description>
      <category>php</category>
      <category>function</category>
      <category>reflectionfunction</category>
    </item>
    <item>
      <title>The Next Generation PHP Framework: CandyPHP</title>
      <dc:creator>emre.red</dc:creator>
      <pubDate>Wed, 18 Aug 2021 08:51:48 +0000</pubDate>
      <link>https://forem.com/emrered/the-next-generation-php-framework-candyphp-52o</link>
      <guid>https://forem.com/emrered/the-next-generation-php-framework-candyphp-52o</guid>
      <description>&lt;p&gt;Nowadays php is like an aging person but frameworks keeps it alive. Today i'm going to tell you about this new generation PHP Framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can do with this framework?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  📅 Ability to Set Scheduled Tasks
&lt;/h3&gt;

&lt;p&gt;I guess there is no framework where you can't use CronJobs, but in CandyPHP you can set CronJobs without any presetting.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗃️ Multiple Database Connections and Simple, Cachable SQL Operations
&lt;/h3&gt;

&lt;p&gt;With CandyPHP, you can easily operate on many databases at the same time. With database caching you can use similar queries from cache without forwarding them to mysql. This is more useful than you think because CandyPHP updates the cache whenever there is a change in the database. &lt;/p&gt;

&lt;h3&gt;
  
  
  🗄️ Automatic Daily Web and SQL Backups (&amp;amp; autoclear)
&lt;/h3&gt;

&lt;p&gt;You can set Candyphp to take daily web and sql backups. &lt;br&gt;
Isn't it going to take up a lot of space on your system to make backups every day..? Of course no.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backups of all days in the last week are kept.&lt;/li&gt;
&lt;li&gt;Backups of the first day of each week in the last 1 month are kept.&lt;/li&gt;
&lt;li&gt;A backup is kept for the first day of each month in the last 1 year.&lt;/li&gt;
&lt;li&gt;In older backups, the backup of the first day of each year is kept. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌐 Multi-Language Web Pages
&lt;/h3&gt;

&lt;p&gt;Again a feature in many frameworks.&lt;br&gt;
But candyphp automatically loads language files according to your visitor. &lt;/p&gt;

&lt;h3&gt;
  
  
  💨 Automatic AJAX Forms and Pages
&lt;/h3&gt;

&lt;p&gt;CandyPHP uses skeletal structure for view designs. thus allowing you to easily upload content with ajax. &lt;br&gt;
Let me give an example; &lt;/p&gt;

&lt;p&gt;&lt;code&gt;candy.loader('a.loader',{content:"#content"});&lt;/code&gt;&lt;br&gt;
When you add this code to your javascript, your content will be loaded with ajax when clicking on links with .loader class. It really is that simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✉️ Sending Mail With Blade Design
&lt;/h3&gt;

&lt;p&gt;It allows you to design with the candyphp blade. Moreover, you can create blade designs for mail. so you can easily design and manage your mail content with your php variables.&lt;br&gt;
Goodbye text mail templates...&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Ability to Use Composer Packages
&lt;/h3&gt;

&lt;p&gt;Composer is not required to use CandyPHP. It is more than enough to just throw the source files to your server. but you can easily integrate composer if you want.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤞 Writing Async Functions
&lt;/h3&gt;

&lt;p&gt;PHP can sometimes really restrict developers. Writing asynchronous functions with CandyPHP is as easy as below. moreover, you don't need to make any presets.&lt;br&gt;
&lt;code&gt;Candy::async(function(){ /* code */ });&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🕘 Ability to Run a Past Version of the Site
&lt;/h3&gt;

&lt;p&gt;You can run a past version of your website you want only for yourself.&lt;br&gt;
For this, system backups must be turned on. &lt;/p&gt;

&lt;h3&gt;
  
  
  🔥 And more...
&lt;/h3&gt;

&lt;p&gt;CandyPHP has a simpler and more useful structure than other frameworks. It has many more unique features.&lt;/p&gt;

&lt;p&gt;If you are interested in CandyPHP, you can check it from the links below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/CandyPack/CandyPHP"&gt;https://github.com/CandyPack/CandyPHP&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>framework</category>
      <category>mvc</category>
      <category>candyphp</category>
    </item>
  </channel>
</rss>
