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.
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 autoloading
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.
This is the SF_autoloader.php
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 thingeverything in this project - I'm also going to have 2 sub-Namesubname spaces which are
aap\Acc
andaap\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:
\contact.php
\contact.phpnamespace aap; require_once "data\\SF_autoloader.php";
\Applications\Accounting-system\stock.php
\Applications\Accounting-system\stock.phpnamespace 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
andaap\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
\contact.php
namespace aap; require_once "data\\SF_autoloader.php";
\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
andaap\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:
\contact.php
namespace aap; require_once "data\\SF_autoloader.php";
\Applications\Accounting-system\stock.php
namespace aap; require_once "..\\..\\data\\SF_autoloader.php";
So, what do you think about my autoloading PHP file?
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 OOP
OOP rather than current procedural style.
"Side effects" include but are not limited to generating output, explicit use of
require
or includeinclude
...
\contact.php
namespace aap;
\contact.php
require_once "data\SF_autoloader.php";
namespace aap; require_once "data\\SF_autoloader.php";
\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 ...
\contact.php
namespace aap;
require_once "data\SF_autoloader.php";
\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
orinclude
...
\contact.php
namespace aap; require_once "data\\SF_autoloader.php";
\Applications\Accounting-system\stock.php
namespace aap; require_once "..\\..\\data\\SF_autoloader.php";
- 2.5k
- 7
- 31
- 49