Skip to main content

Laravel & PHP7 minor test

    Got some time testing on Laravel and PHP7's new feature. Usually, learning basic language is straightforward. Redesigning the sample and studying the difference gain good understanding.

    Due to my short time, PHP7 test paused before the anonymous class definition. Not because of technical reasons... I didn't really agree with the sample that defines an anonymous class under the blueprint of a template(interface).... Usually a template exists because different classes may implement it in different ways. When debugging, a developer needs to trace how a class is defined and used. A better developing habit is to put class definitions somewhere easy to identify. According to this example, an anonymous class hid behind an interface... would cause many troubles such as some classes defining the interface in wild or absolutely opposite ways.


    Fortunately I got another time segment to test on Laravel. “Straightforward” probably is not a common characteristics in modern frameworks….. I try some popular topics to learn more prevalent understanding of modern design, and samples are usually not working. These must be the characteristics of a fast changing world. Sometimes it's annoying, but I kind of like it. Waking up expecting something new happening is intriguing. There are warnings that IT careers are fast-changing and unstable. But I assume a dying world unable to draw out any solution for current dismay is even horrible.


After some fixes, the Quickstart from Laravel finally works, but still not right on visual. Laravel changed its own structure after this tutorial created. Here are some I think important:

Unable to find database....
My first try is mysql, but Laravel complained no DB created. So I tried sqlite3. Tripping off authentication possibilities, the problem of core function changes was found.
The fix: https://laracasts.com/discuss/channels/laravel/connect-to-an-sqlite-db-laravel-documentation-procedure-doesnt-work?page=1
/config/database.php - 'database' => database_path(env('DB_DATABASE','database.sqlite'))
And DB_DATABASE=dbname.sqlite in .env

Unable to find Route file....
Route definition was moved out of app/http/
It was moved to Route/ and expanded to 4 basic functions: api, channels, consoles and web

Database folder get deeper..
Sample frame located at database/migrations/ with time flag as version denotation.

Class definition still located in app/ folder. I got lucky...


Utilizing artisan Laravel, a developer frequently requests the cloud for function framework. For example, when Quickstart downloaded, database/ folder didn't exist. After send request via artisan, database folder and sample DB schema created.
So is new defined class app/task.

It seems a developer using Laravel doesn't really have full control of the changing structure. This is why I previously mentioned Python/Flask was a better entry for modern web app. Flask's framework is much isolated from developer's creation. There are default folder names, but developers get tools to change it. When I deploy Flask to Azure and Azure doesn't support the function factory, together with the entry function's location may change the relation of directories. Sometimes things get very difficult under default definition. I guess this is why Docker gets popular.


Funny test on PHP7:

Altered structure/codes for Laravel Quickstart
https://github.com/atfuture7/learning/tree/master/Laravel/03_quickstart

Comments

  1. Casinos & Software | DRMCDC
    Slots · 당진 출장샵 Video poker · Live dealer casino · Roulette · 창원 출장마사지 Sportsbook · Casino games. 동두천 출장마사지 The best casinos for US players. Video poker is one of the most 김포 출장안마 popular gambling games 광주광역 출장샵 in

    ReplyDelete
  2. It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait to read. Read more info about Qr Code Generate in Laravel Online. I am impressed with your work and skill. Thanks.

    ReplyDelete

Post a Comment

Popular posts from this blog

Bookmark service (MongoDB & Spring REST) -2/2

    I accidentally deleted my development VM. I got lucky having the habit of taking notes. This blog is useful. Development VM is doom to be lost. Rebuild it waste time, but having a clean slate is refreshing~. What concerns me more is my AWS free quota this month is reaching 85%. The second VM I launched but never being used might be the one to blame. (Of course, my mistake.) I terminated the wrong VM. Now I got Linux 2 built. Great, just threw away everything happened on AMI.  1st layer: Page Page class   Originally, I need to prepare getter/setter for all class properties for Spring. By using lombok, I only need to create constructors. lombok will deal with getter/setter and toString(). But there are chances to call getter/setter, but how? .......Naming convention.... Capitalize the 1st character with the prefix get/set.  Annotation @Data was used on this class.  Repository class Spring Docs: Repository https://docs.spring.io/spring-data/mongodb/docs/3....

gamer's interview

This project simulates a gamer's interview. Based on NodeJS+ ReactJS The setting is interviewing a gamer/journalist what's his/her plan of March 2020? The gamer answers his/her game list in plan, how many reviews on demand and how many hours expected. Games selected for review take 5 hours for each, while others take one. This project is designed to practice render html, jsx, component, props introduced in  https://www.w3schools.com/REACT/default.asp . Also fixed other issues to make it work. When trying to modualize objects and tools, my design developed to separate views and processes. And it is quite similar to the initialized structure NodeJS+ReactJS provided. Furthermore, since include local module files are banned by browsers, use NodeJS service seems to be the best option. view file main process object tool

Comments for my Server/Client Web API samples

        Finally, I finished the comments for python/07 and 09 projects. I almost forgot to put the date on source code which is used to note how long it took me. Not precisely in hours….. I didn’t include source code in my previous post. If choosing code-section for this post…… maybe I want to mark out my comment….. (Really?!)          Once my work was developing websites for enterprises, including ERP, CRM or content sites. The sustainability of network and security are important issues. There are 2 methods for HTML Form submission: GET and POST. Submit via POST is secure, compared to GET which piles parameters on URL. RESTful API is mainly using GET.         Yup, even if you have a certification key, if you put the value on the URL, it is visible data. When writing socket-communication, client-server sockets are a pair; both follow the agreement on commands and structures; and there are countless ports for usa...