Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    290
    Thanks
    89
    Thanked 2 Times in 2 Posts

    The "3d view" of creating a PHP app / script

    I am using phpStorm and I've heard about Atom (which is free; I will stick to what I have right now). I am wondering about what is the process of creating a php script, something like lets say YouTube.com, facebook.com or wordpress.org (the downloadable one).

    1) Is the process always the same (always the same steps, approach, order)?

    2) Somebody told me to start with a blueprint of a project (what do I want to accomplish / functionalities and so on). Then I would figure out if I need a user or a group with certain permissions to access certain parts of the script. And after I have that I can design a database (which would include these permissions).

    I am basically not seeing still how the process would look in 3D. Lets say I have the phpStorm and the MySQL Workbench open and ready to go. I want to write a script like YouTube.com (or something a lot simpler to use as an example, but something like that). And what are the steps? Are there any places where I can learn about this (I've already seen one book - How to create your own blog, programming, and I will get this) . I've been learning the PHP for almost one year and at this point this would be the most valuable knowledge to have, so I could organizie what I know on this (like a skeleton, and I could put the process of creating anything on this).

    So blueprint -> (permissions) databsee -> do html (as a skeleton) -> add the php to this.

    I would really want to see the whole process in 3d, like building a skycraper lets say - do the foundation, do the skeleton, add the floors, add the windows, do the electrical cabling, put in the furniture and so on.

    Thanks.

  2. #2
    Regular Coder Vege's Avatar
    Join Date
    Jan 2008
    Posts
    988
    Thanks
    22
    Thanked 134 Times in 133 Posts
    Lets take Youtube.
    What it consists of?

    1) Users, groups and permissions
    2) Video processing
    2.5) Video player
    3) Thumbnail creation
    4) Comments
    5) Catching
    7) Search
    8) Template engine
    9) Url routing

    These things are mostly separate and can be made from different parts.
    Moore loosely coupled you make your models more reusable they are.

    Software is just a group of things glued together. If you glue them together good enough the end result might be more than the parts. There is no best glue and it comes down to personal preference. But if you choose/make ****ty parts the glue will not make it better. You need to understand what part you are making and can you yourself make better than preexisting part.

    Ability to make good software is the ability to make the task small enough.
    Youtube at it's core is two database tables and two pages.
    One to upload new videos and other to view the video and give comments.

  3. Users who have thanked Vege for this post:

    joliett89 (Jun 2nd, 2018)

  4. #3
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,297
    Thanks
    122
    Thanked 625 Times in 611 Posts
    As Vege points out, a site can be made of many parts / technologies.

    Look at most email platforms. To you it's just a website but behind the scenes is an incoming mail server, and outgoing mail server (both working as services / daemons not scripts), a database, probably a virus scanner... but it all works together as one product - the email website.

    Youtube and others will all be the same - they'll all have background processes running in different languages doing different things. PHP is great for the website side of things but it isn't used for everything that you see on a website.

  5. Users who have thanked tangoforce for this post:

    joliett89 (Jun 2nd, 2018)

  6. #4
    Regular Coder
    Join Date
    Jul 2011
    Posts
    290
    Thanks
    89
    Thanked 2 Times in 2 Posts
    Thanks a lot for the info. I will go over it again, when I will be coming back to working on this (I am extending my edu break for 7 days - not able to accumulate new knowledge yet).

    Basically I was talking to somebody who was also doing the php programming and he suggested that I have or may have the wrong point of view; I am not understanding things. I went over all these books and training materials (for over 14 months so far) and I am learning how to make a decoration and put that decoration on a Christmas tree but I am not able to put up that Christmas tree by itself which is the "core" thing and the rest would be easier after that. I am going over the pages and examples on the php.net, doing the w3resource.com exercises, learning the phpStorm and regex, reading some good books but this has not taught me the "skeleton" of this yet. It just seems that I would need to have that right point of view (passed from somewhere to me) and everything would become a lot easier after that. I would basically have that Christmas tree standing up and I would be able to work on the decoration as I go (like php.net manual, whatever would be needed).

    I mean, we are building YouTube.com. I am sitting at the desk, I have the phpStorm and MySQL Workbench open (and Xampp). I would used GetBootstrap.com for the css and the html. I now start with the database? As far as this you usually do this or that (like that "varchar" stuff). Other things, dont worry about it, this is more or less it. After you have that, create the html pages so you have that "physical" skeleton of what you are trying to do. Once you have that, you always want to have log in / log out (with what you do here, particularly), sessions, cookies and you basically get it from here (url or urls), or do it this or that way. You also need to make sure that you have A (like users, permissions, or whatever), B (like lets say security aspects), C, and D. Once you have that done, you expand the php coding, from this file through here to that file at the end (lets say). You have arrays and variables, they are accessible from everywhere, lets say, you can use namespaces if you need this or that, and so on.

    I mean, I know all these things, I was reading about all this hundreds of times, but I just dont have that correct point of view, that ability to set up the skeleton and work from there. This is basically the task that I have in mind now, I need to obtain that ability and that move on. I've been learning for 14 months, but I DON'T UNDERSTAND, it seems like.

    People say, download some ready scripts and see how they are done. You can expand them with your own coding to learn more. I mean, what else can I do. I will be going to two IT universities in the city where I live (maybe several times or continuously) and talking to people there. I dont have money right now, so I am not able to get some paid advive (like php tutor and so on).

    This is basically the situation that I have. I've been learning, but I DON'T UNDERSTAND.

    It is all easy and somebody could explain it to me in an hour of two (especially that I am familiar with that) and everything would become a lot easier after that.

    PS: I am good or intermediate (at least) in knowing the peieces of the puzzle but I still dont get how to get it together as a whole (how it falls down together into place). After having that knowledge it would all start making sense and I would benefit from knowing the certain pieces too. So a whole better thing, but I need to get to that, at this point.
    Last edited by joliett89; Jun 2nd, 2018 at 09:03 AM.

  7. #5
    Regular Coder Vege's Avatar
    Join Date
    Jan 2008
    Posts
    988
    Thanks
    22
    Thanked 134 Times in 133 Posts
    Some professionals create the full html site first without any backend functionality.
    After you know what the frontend needs you create backend to provide it. Search is just a html link to search results etc.

    I usually use Slim micro framework for my routing. And I usually start with routing and standalone services that routes uses.
    It's small, easy to extend, easy to understand and works like every other router in bigger frameworks.
    https://www.slimframework.com/

    Then I would use a ObjectRelationMapping tool to force a good mindset with database tables. Usually there is a reason why some feature you miss is not present in ORM:s etc. https://www.slant.co/topics/5639/~php-orms

  8. Users who have thanked Vege for this post:

    joliett89 (Jun 2nd, 2018)

  9. #6
    Senior Coder benanamen's Avatar
    Join Date
    Oct 2015
    Posts
    1,624
    Thanks
    11
    Thanked 164 Times in 159 Posts
    It sounds like you are wanting to take on a project way beyond your current skill set. I suggest you start with smaller projects and work your way up. By the time you get the experience to take on large/complicated projects your experience will answer most of the questions you are asking. I do highly recommend the blueprint approach for anything other than small projects. PhpStorm is the best IDE money can buy (Not an opinion, it just is). Stick with that.
    To save time, lets just assume I am almost never wrong.

    The XY Problem
    The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

    Make A Donation https://www.paypal.me/KevinRubio

  10. Users who have thanked benanamen for this post:

    joliett89 (Jun 3rd, 2018)

  11. #7
    Regular Coder
    Join Date
    Jul 2011
    Posts
    290
    Thanks
    89
    Thanked 2 Times in 2 Posts
    I dont want to bother and I will go over everything that was written again (when I will be coming back to the edu), but I've started figuring out something like this and this could be correct. People say that there is no one set order of things but I would say that there can be or that there is. Lets say we have a glass table and we build everything underneath it in 3d or that we have that toy for kids with the holes (like circle, square, triangle) and we put all our figures through this.

    The first layer could be (directories)/files + database (just 1 lets assume) - this is a "constant", it will always exist, all project will be going through these "things".

    The second leyer could be deciding whether we are doing oop or non-oop. OOP could include like a 10% of the oop programming or 90% - it would be either present or not (a whole non-oop project).

    Then we have namespaces (we dont have to use this, so I can omit thinking about it to start), scope of variables and other structural things like this.

    As far as files/directories we can also include files, but there is a small number of these things that we need to decide on (organization wise) and it is a set number).

    Session, or some other things - this is not structural - we either have it or not, or we can apply it in a structural way (like in one file that we include when we need this and so on).

    Am I on the right path, is this thinking more or less correct?

    Like get the "PHP for Dummies" see whats there and see how would you organize that.

    And done... Or not really?

    PS. I can also download existing projects (start with small ones) and see how would they be falling through these "holes".

  12. #8
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    North Carolina
    Posts
    1,559
    Thanks
    5
    Thanked 249 Times in 246 Posts
    I think benanamen is on point with his suggestion. Personally I think you're reading a lot more into it than you need to at this point. Pick a smallish project that interests you (and I think something that is of interest to you is key) and start down the path. As you go you will learn about the things you've mentioned and figure out what does or doesn't work and why. As much as you might want to get a checklist of sorts, for lack of a better way to describe it, having one isn't really going to help you in the end. There is no substitute for experience and that only comes by trying (and failing of course).
    Dave .... HostMonster for all of your hosting needs

  13. Users who have thanked djm0219 for this post:

    joliett89 (Jun 3rd, 2018)

  14. #9
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,297
    Thanks
    122
    Thanked 625 Times in 611 Posts
    As others have stated, you're trying to bite off more than you can chew here and that's down to two things:

    1) your over confidence in your ability to do it
    2) your lack of confidence in your ability to learn to program properly / easily (trust me many newbies suffer with both - they seem to go hand in hand and yes... I've been there too)

    Start with some smaller projects, get the hang of what you are doing and your way of doing things. Once you've got the hang of the basics (debugging is so much more important than many o the things you've listed so far) then you can start to progress onto other things. As your confidence in your ability grows so will your enthusiasm. PHP needn't take years to master (though it can if you go about it back to front), just keep at it and before you know it everything will click into place.

    One of your key resources in the php manual. Download other peoples code and look at what it does, lookup function names on the php website (http://www.php.net/<function_name>) and see what it does, what parameters it takes, what it returns... Learn to use a database (it's a lot simpler than you'd think and much easier than writing to text files like everyone seems to think is the best approach). In fact the term database should IMO be banned from learners because it sounds complex and scary, it isn't it's easy and a doddle. It can get more complex as you start doing more complex things like table joins but that is a bit down the road for you to worry about (and even then like most things the more you do it the more natural it becomes).

    So remember this: PHP is basically a scripted text editor. It allows you to modify a html page by following the instructions you write in a script (yes it can do other more complex stuff too but for the time being just think of it as an automated text editor). This means that you can change text on a page, change the image source, use the time and date, perform calculations (not that you'll need that much to start with so don't get scared by that). Once you've got the hang of the basics (literally an afternoon of effort) then you can move on to other bits.

    There is no single best way to learn any programming language (other than learn the basics and learn to debug) so there isn't much more any of us can really say to you other than get on with it and good luck!

  15. Users who have thanked tangoforce for this post:

    joliett89 (Jun 3rd, 2018)

  16. #10
    Regular Coder
    Join Date
    Jul 2011
    Posts
    290
    Thanks
    89
    Thanked 2 Times in 2 Posts
    @tangoforce - I was talking to somebody who was a php programmer and he suggested that what I am doing may not be on the best path. Basically it is not anybodys job to explain me the "matrix" view of the php. Like you have a 3d metal object with different type of holes in it on all the sides and you run it over any real world problem and it outputs a ready and perfect php script (perfect - this will depend on what I do within this matrix, but there are certain things that are set and have its place in 3d). Like I said, no one has to explain it to me as this will make me a php programmer or I would be 75% of the way there (I still need to finish the MySQL and MySQL + PHP part, this is my personal edu goal, the books that I bought - Murach's).

    Matrix:
    1) (directories)/files + database (or databases)
    2) I am thinking OOP or non-OOP project (and all these oop aspects would be laid out in this imaginary 3d model in some way)
    3) scope of variables, sessions, include_once, thinkgs like this.

    Like I am laying on a bed in my room, which is a cuboid in shape and I want to lay out the php language (imaginary) on that, the matrix of the php. The (directories)/files part could be on the ceiling, expandable as needed (left to right or end to the beginning of the ceiling, so to speak), the whole database would be on the floor (and this would be the columns, as the rows will only contain what I will put in there so this is not like a matrix / structure thing, rows get put into this matrix).

    We can include other files in other files, so what would we usually inculde, put somewhere else and put in other places (like database connection). I need to figure this out.

    The OOP matrix could be under the celing like 10 or 20 cm down (imaginary) and all this aspects like inheritance within that in some way.

    I am sure you know what I am talking about, this angle, and having this figured out would basically make me a programmer more or less (with that 14 months of edu experience that I have. I would have this Christmas tree standing up and I've been already learning how to make and "paint" the decoration for this (all these things that you need to understand like how the built-in functions work, regex and so on). I am quite familar with the database already (like the joins and all that; I am still expanding this knowledge from the two Murach's books).

    But yes, this 3d view / the matrix / the structure is what I need. But again, it is not anybodys role to explain it to me. I could find a paid tutor or somebody like that. But this seems to be the key and the "secret" of the PHP.

    Also, at the start, I can probably omit some things in this matrix. Ask - what are the necessary things. Go the non-oop route (figure this out after that), omit the namespaces and focus on the scope of the variables, including other files (or I can skip that too, I dont have to include, I would be including what gets repeated the most which would be like to connection to the database). It seems like I am on the right path and I should be able to figure it out, but this is basically the angle of info that I am looking for.

  17. #11
    Regular Coder
    Join Date
    Jul 2011
    Posts
    290
    Thanks
    89
    Thanked 2 Times in 2 Posts
    For the edu purposes lets assume we work on any non-oop script. As far as I know I need to start with the html/css, then do the dir/file structure and do the database design as the third step. After this I need to do the php coding in this files. What would be or could be the rules of doing this? Would I start with html to the database joining and the other way around (put what comes into the html forms into the database functionality and display what is needed from the database through the html)? Or maybe work on certain functionalities separately as separate steps (like tube/pic script - video import, video conversion, pic import, pic conversion and other things - develop these in certain files that were created for that).

    Or what would be the process like. We can use a simpler example, like a personal dialy diary app (we have a form, we write about a day at the end of the day and add it to a database, this then gets displayed, with pagination for certain months lets say, or whatever). So we do the html/css part (or not really, I am not sure about that, maybe the database first), then the dir/file structure, the database design next (just title, text, date, time of the post, I guess). And then we do the php coding, so where do we start and how do we continue with this and finish?

    If I can get any info this would be great as this would lead me to the possibility of getting better and more info from the Net (google and so on, search for better things, with this understanding).

  18. #12
    Senior Coder benanamen's Avatar
    Join Date
    Oct 2015
    Posts
    1,624
    Thanks
    11
    Thanked 164 Times in 159 Posts
    I have been doing this over 25 years and you have already lost me. Here's what to do. Start with an address book project. It is one that can be very simple or complex. Start with writing the address data to text files and master reading and writing files. Once you have that down, learn Database Normalization and fork your project to use an Sqlite DB. When you master that, fork your project to use Mysql/MariaDB. This assumes you already know HTML. If you dont, start there. Come back when your done or if you get stuck.

    Make sure to create a repo and learn GIT along the way.
    To save time, lets just assume I am almost never wrong.

    The XY Problem
    The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

    Make A Donation https://www.paypal.me/KevinRubio

  19. #13
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,297
    Thanks
    122
    Thanked 625 Times in 611 Posts
    Man.. what on earth is all of this about the matrix, 3d and all the rest of it you keep babbling on about? php is pretty simple, you write code in a file and call it a script.

    That code executes a series of instructions line by line. That's it.

    You're way over complicating this.

  20. #14
    Senior Coder benanamen's Avatar
    Join Date
    Oct 2015
    Posts
    1,624
    Thanks
    11
    Thanked 164 Times in 159 Posts
    Are we being trolled?

    Quote Originally Posted by joliett89 View Post
    For the edu purposes lets assume...
    NO! Lets not assume. Start a project and post specific questions when you get stuck.
    To save time, lets just assume I am almost never wrong.

    The XY Problem
    The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

    Make A Donation https://www.paypal.me/KevinRubio

  21. #15
    Master Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    5,297
    Thanks
    122
    Thanked 625 Times in 611 Posts
    I don't think we're being trolled but some people do seem to think its way more complex than it is. 3D views? has he been watching too many computer based movies?


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •