I noticed that the php-shared host version did not have functions to edit entities before approval. This has now been fixed. The PHP edition now has full entity editing: Changes committed: • php/src/Router.php - Added entityEdit() and entityUpdate() handlers with routes • php/templates/entity_edit.php (new) - Full edit form with Save/Save & approve/Save & reject • php/templates/entities.php - Added Edit link column • installers/php-host/bkbs-php-edition.zip - Rebuilt with changes Features added: • Click "Edit" on any entity row → opens edit form • Edit all fields: name, type, description, status, trust level, notes, JSON fields • Three save buttons: "Save changes", "Save & approve", "Save & reject" • Bulk approve/reject still works as before Github Repository: https://lnkd.in/dXuw_Uzx
PHP edition now has entity editing functions
More Relevant Posts
-
𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝘁𝗵𝗲 𝗣𝗛𝗣 𝗱𝗼-𝘄𝗵𝗶𝗹𝗲 𝗟𝗼𝗼𝗽 Loops help you run the same code multiple times. This saves time and prevents mistakes. In PHP, the do-while loop works differently than other loops. It runs your code first. Then it checks your condition. This means the code inside your loop runs at least one time. This happens even if your condition is false from the start. Use a do-while loop when you must execute an action before you check a rule. Common uses include: - Showing a menu to a user. - Validating input data. - Retrying a failed task. How it works: 1. The computer runs the code inside the do block. 2. The computer checks the condition. 3. If the condition is true, it repeats the loop. 4. If the condition is false, it stops. Compare this to a standard while loop. A while loop checks the condition first. If the condition is false at the start, a while loop never runs. A do-while loop always gives you one attempt. Choosing the right loop makes your PHP code clean and efficient. Source: https://lnkd.in/gzhVsTY5
To view or add a comment, sign in
-
𝗪𝗵𝘆 𝗘𝗻𝘃𝗶𝗿𝗼𝗻𝗺𝗲𝗻𝘁 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 𝗙𝗮𝗶𝗹 𝘁𝗼 𝗦𝘂𝗽𝗽𝗿𝗲𝘀𝘀 𝗪𝗣-𝗖𝗟𝗜 𝗪𝗮𝗿𝗻𝗶𝗻𝗴𝘀 Environment variables often fail to stop PHP Deprecated warnings in WP-CLI. I found this issue on Xserver. An agency reported that plugin lists were failing due to massive amounts of Deprecated messages. The problem is the execution path. On Xserver, the command /usr/bin/wp is a phar binary. It uses a shebang line: #!/usr/bin/env php. This creates a specific startup sequence: - The shell runs /usr/bin/wp. - The env command finds PHP and starts it. - PHP loads the phar and runs WP-CLI. Because the system starts PHP through a shebang, WP-CLI never reads the WP_CLI_PHP_ARGS variable. The variable never reaches the PHP startup process. I tested two methods: 1. Using the variable: 407 Deprecated lines remained. 2. Using the -d flag directly with the PHP binary: 0 lines remained. To fix this, I implemented a three-part structural solution in v1.6.8. Pillar 1: Direct Flag Injection The code now inspects the wp_cli_path. If the path starts with php, php8.2, or any php variant, it injects the -d error_reporting flag immediately after the binary. If it is a bare wp or phar command, it leaves it alone. Pillar 2: JSON Extraction Even with suppressed warnings, other noise can appear in stdout. Instead of parsing the entire string, the code now locates the first [ or { and the last ] or }. It only sends that specific range to the JSON parser. Pillar 3: Unified Error Handling I updated all code to return a tuple containing both the parsed data and the raw stdout. This ensures that if a parse fails, the original output remains available for logs and debugging. I added 51 new tests to cover these changes. These tests check PHP detection, flag positioning, and various JSON noise scenarios. When an environment variable fails, do not just try new configurations. Ask if the variable ever reaches its destination. Source: https://lnkd.in/gKtUxFeg
To view or add a comment, sign in
-
𝗧𝗵𝗲 𝗕𝗹𝗮𝗱𝗲 𝗘𝗿𝗿𝗼𝗿 𝗧𝗵𝗮𝘁 𝗕𝗿𝗲𝗮𝗸𝘀 𝗬𝗼𝘂𝗿 𝗣𝗮𝗴𝗲 You cannot put a Blade directive like @if inside a component attribute list. If you do this, your page will throw a 500 error. The error looks like this: syntax error, unexpected token "endif". Why does this happen? Blade processes things in a specific order. 1. Blade parses component tags first. It treats everything inside the tag as a list of attributes. 2. Blade compiles directives second. By the time Blade looks for your @if statement, it has already treated that code as a plain string of attributes. The directive never finishes correctly. This breaks the PHP code and crashes the page. How to fix it: • Branch around the entire component: Use @if and @else to write two separate components. Use this when many attributes change at once. • Use PHP expressions: Write the logic inside the attribute like this: wire:confirm="{{ $hasToken ? 'Text' : '' }}". Use this for single attribute changes. • Bind a property: Move the logic into your PHP class. Use this for complex logic. Example of the correct way to branch: @if($hasToken) <flux:button variant="danger" wire:confirm="Rotate secret?"> Rotate Secret </flux:button> @else <flux:button variant="primary"> Generate Secret </flux:button> @endif This uses more code, but it works. The real danger: This bug stayed hidden because the page lived behind a feature gate. No one saw it. Your automated tests did not see it either. A feature gate is a way to ship code that no one renders. The solution is a render test. Write a simple test that enables the feature and checks for a 200 status code. If you test both sides of your logic, you catch these errors in your CI pipeline instead of in production. Source: https://lnkd.in/gFQ_mKzn
To view or add a comment, sign in
-
In the previous post, we learned that Reflection allows PHP to inspect classes at runtime. But Reflection only tells us what a class needs. It doesn't create those dependencies. That's the job of Dependency Injection (DI). Let's start with an example. class UserController { private UserService $service; public function __construct() { $this->service = new UserService(); } } At first glance, this looks fine. But imagine UserService changes. Today it has no constructor. Tomorrow it requires a repository. class UserService { public function __construct( private UserRepository $repository ) {} } Now your controller breaks. You must go back and edit it. class UserController { public function __construct() { $this->service = new UserService( new UserRepository() ); } } A month later... UserRepository now needs a database connection. new UserService( new UserRepository( new DatabaseConnection(...) ) ); Every change in the dependency chain forces you to revisit code that shouldn't even care how those objects are created. This is called tight coupling. Instead, let the class declare what it needs. class UserController { public function __construct( private UserService $service ) {} } Now the controller doesn't know—or care—how UserService is created. It simply receives one that's ready to use. That's Dependency Injection. The responsibility of creating objects is moved outside the class. In the next post, we'll answer the obvious question: If the controller no longer creates UserService... who does? #PHP #Laravel #DependencyInjection #SOLID #BackendDevelopment
To view or add a comment, sign in
-
-
PHP 8.5 made closures inside attributes legal. The interesting question was what closures in attributes are actually for. Every declarative framework has the same weak spot: the first value that has to be computed. A message delay that depends on the command. A deduplication key derived from the payload. Until now you had two options, and both were taxes. Option one: expression language strings like 'payload.delayInMilliseconds'. Rename the property and it breaks at runtime. PHPStan sees a string. Your IDE sees a string. So there is no native support for veryfing correctness of those. Option two: leave the declarative model and write a middleware class for one line of logic. Meaning extra classes, configuration and wiring, even for simple things like delaying the execution. Ecotone supports both, but thanks to closures in attributes provides now a third path. Every "expression" property now accepts a real Closure, and the closure executes like a message handler: parameters resolve via #[Payload] with conversion, #[Header] by name, #[Reference] for services. The framework does the plumbing, so the closure body stays one line. Under the hood, the container stores a reference to the declaring class or method and re-reads the attribute via reflection at runtime, since PHP still cannot serialize closures. As a result we get: → Typed, refactorable, IDE-completable inline expressions → Logic lives together, so it's easy to follow what to expect from code → Ability to access different context, like payload, headers, services without rolling separate middlewares #PHP #Ecotone #SoftwareArchitecture
To view or add a comment, sign in
-
-
What's stopping you from upgrading to newer PHP versions? That's a great question from State of PHP 2026 survey from The PHP Foundation and JetBrains. Legacy codebase. Framework compatibility. Fear of downtime. Lack of engineering time. All valid, all real, all in the survey. But I want to go one level deeper - because "legacy codebase" can mean a hundred different things. Is it deprecated functions like mysql_* that force a rewrite? Encrypted vendor code via ionCube that nobody can touch? A Composer dependency graph so tangled that updating one package breaks five others? Or is it simpler than that - no staging environment, so any upgrade is a gamble on production? Those are completely different problems with completely different fixes. So we put together a short follow-up survey, digging into the specifics: technical debt, third-party dependencies, business constraints, infrastructure. Survey: https://lnkd.in/ehPYKwGE Once we've got enough answers, I'll share what we find in a follow-up post - real numbers on what's actually keeping PHP teams stuck, not just guesses. Got a specific blocker that's not even on the list? Feel free to tell me in DM.
To view or add a comment, sign in
-
-
A real bug PHP 8.5 #[\NoDiscard] can help catch: Bulk imports. Imagine a CSV user import. The import method creates valid users, skips invalid rows, and returns an ImportReport containing failed rows. But someone writes: $importer->import($csvRows); The code runs. No exception. Most users are created. The dashboard says “import completed.” But 37 rows failed silently because nobody checked the returned report. With PHP 8.5, we can mark that method: #[\NoDiscard('Import can partially fail. Check the returned report.')] Now PHP warns if the caller ignores the result. That’s the real value of #[\NoDiscard]: not fancy syntax, but catching “everything ran, but we ignored the important result” bugs. Useful for: - bulk imports - payment results - validation results - immutable object updates - API calls with partial failures Small feature. Very practical. Would you use #[\NoDiscard] in your own libraries or application code? #PHP #PHP85 #BackendDevelopment #SoftwareEngineering #CleanCode
To view or add a comment, sign in
-
PHP isn't dead for web scraping. It's just quiet about it. 🐘 Most servers already run it, database integration ships built-in via PDO, and Composer pulls in an HTTP client with 1 command. In this video, we build a full scraper with Guzzle and Symfony DOM crawler, targeting a sandbox site with 1K books across 50 pages, then export everything to CSV. We also cover: 🧑💻 Setting realistic headers and retry logic with backoff ❌ Rotating residential proxies to avoid IP blocks at scale 💡 When to reach for a headless browser instead of curl If PHP's already your stack, there's no reason to switch languages just to scrape. Watch the full video and grab the code in the comments 👇
To view or add a comment, sign in
-
The PHP 8.5 pipe operator Most PHP is still written so you have to read it inside out. You know the pyramid: trim(strtolower(str_replace(' ', '-', $title))) To follow it, your eyes jump to the innermost call, then unwrap each layer backwards. The logic runs in the opposite order to how you read it. PHP 8.5 fixes that with the pipe operator. $slug = $title |> fn($s) => str_replace(' ', '-', $s) |> strtolower(...) |> trim(...); Now it reads top to bottom, in the exact order it executes. First replace spaces, then lowercase, then trim. The data flows down the page. Same result. Far less mental overhead. The shift is small but it adds up. Code is read far more than it is written, and anything that removes a translation step in my head is worth it. Are you on 8.5 yet, or still climbing out of the parentheses pyramid? #PHP #PHP85 #BackendDevelopment #SoftwareEngineering #laravel #latam #remote #simfony
To view or add a comment, sign in
-
Step 1 is complete. https://lnkd.in/gV7rgNv6 This Contractless repository contains the source and installation tools for PHP modules supporting Skein hashing and Falcon signatures, specifically as they relate to interactions with Contractless. These modules will be required for step 2: creating the PHP library for connecting to and interacting with the Contractless RPC. They can also be used independently for other Skein hashing and Falcon signature requirements.
To view or add a comment, sign in
More from this author
-
Uncovering Hidden Vulnerabilities: Strengthening Your Internal Controls Against Theft & Collusion
BRANDON JOUBERT 1y -
Fortifying Your Gates: Addressing Visitor Management Blind Spots with Robust Solutions in SA's Wholesale Distribution
BRANDON JOUBERT 1y -
Power Outages and Peace of Mind: Securing Your KZN Residential Estate During Load Shedding
BRANDON JOUBERT 1y
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development