Skip to main content
Code Review

Return to Question

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

I'm new to PHP and I didn't know I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

deleted 56 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

my auto Auto loading code

I'm new to PHP and I didn't know there is something called coding style standardscoding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, whichwhich is about autoloadingautoloading standards,. I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOPOOP rather than current procedural style.

This is the SF_autoloader.phpthe SF_autoloader.php file that I need your review on. It is in the native habitat (copied from Eclipse and pasted here).


**More Info:**

This is my project files structure.:

  • I'm going to put every class file in the Data\ folder.
  • I'm using aap as the namespacePrefix for every thingeverything in this project
  • I'm also going to have 2 sub-Namesubname spaces which are aap\Acc and aap\KsaMarketResearsher

Now all I need to do to autoload is to include SF_autoloader.php/*SF=side effect*/ in every other phpPHP file, except the class files since the PSR says :

andIt also says:

  1. \contact.php \contact.php

    namespace aap;
    require_once "data\\SF_autoloader.php";
    
  2. \Applications\Accounting-system\stock.php \Applications\Accounting-system\stock.php

    namespace aap;
    require_once "..\\..\\data\\SF_autoloader.php";
    

So, what do you think about my autoloading phpPHP file?

my auto loading code

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards, I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

This is the SF_autoloader.php file that I need your review on. It is in the native habitat (copied from Eclipse and pasted here)


**More Info:**

This is my project files structure.

  • I'm going to put every class file in the Data\ folder.
  • I'm using aap as the namespacePrefix for every thing in this project
  • I'm also going to have 2 sub-Name spaces which are aap\Acc and aap\KsaMarketResearsher

Now all I need to do to autoload is to include SF_autoloader.php/*SF=side effect*/ in every other php file, except the class files since the PSR says

and also says

  1. \contact.php

    namespace aap;
    require_once "data\\SF_autoloader.php";
    
  2. \Applications\Accounting-system\stock.php

    namespace aap;
    require_once "..\\..\\data\\SF_autoloader.php";
    

So, what do you think about my autoloading php file?

Auto loading code

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

This is the SF_autoloader.php file that I need your review on. It is in the native habitat (copied from Eclipse and pasted here).

This is my project files structure:

  • I'm going to put every class file in the Data\ folder
  • I'm using aap as the namespacePrefix for everything in this project
  • I'm also going to have 2 subname spaces which are aap\Acc and aap\KsaMarketResearsher

Now all I need to do to autoload is to include SF_autoloader.php/*SF=side effect*/ in every other PHP file, except the class files since the PSR says :

It also says:

  1. \contact.php

    namespace aap;
    require_once "data\\SF_autoloader.php";
    
  2. \Applications\Accounting-system\stock.php

    namespace aap;
    require_once "..\\..\\data\\SF_autoloader.php";
    

So, what do you think about my autoloading PHP file?

fixed grammar
Source Link
Ext3h
  • 2.8k
  • 13
  • 17

I'm new to phpPHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards, I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOPOOP rather than current procedural style.

"Side effects" include but are not limited to generating output, explicit use of require or includeinclude ...

  1. \contact.php

    namespace aap;\contact.php

    require_once "data\SF_autoloader.php";

    namespace aap;
    require_once "data\\SF_autoloader.php";
    
  2. \Applications\Accounting-system\stock.php

    namespace aap;\Applications\Accounting-system\stock.php

    require_once "..\..\data\SF_autoloader.php";

    namespace aap;
    require_once "..\\..\\data\\SF_autoloader.php";
    

I'm new to php and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards, I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

"Side effects" include but are not limited to generating output, explicit use of require or include ...

  1. \contact.php

    namespace aap;

    require_once "data\SF_autoloader.php";

  2. \Applications\Accounting-system\stock.php

    namespace aap;

    require_once "..\..\data\SF_autoloader.php";

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards, I wanted to change my php project to follow the standard. I'm also trying to change my project to be OOP rather than current procedural style.

"Side effects" include but are not limited to generating output, explicit use of require or include ...

  1. \contact.php

    namespace aap;
    require_once "data\\SF_autoloader.php";
    
  2. \Applications\Accounting-system\stock.php

    namespace aap;
    require_once "..\\..\\data\\SF_autoloader.php";
    
Loading
edited tags
Source Link
200_success
  • 145.5k
  • 22
  • 190
  • 479
Loading
Source Link
Loading
lang-php

AltStyle によって変換されたページ (->オリジナル) /